Any Python expert around? Problem with Python script for automating furigana/Kanji cloze deletion

A's Avatar

A

08 Aug, 2015 09:52 AM

https://gist.github.com/dlip/163d429553bfc899d94f
I'm trying to run this script through a huge deck similar to core10k, but this one has 25000+ notes, but the thing is when I run the script it always gives me ignore <insert number of newlines here> which is weird because debug = False by default, IIRC an if conditional shouldn't run with a False boolean.

I think the part of the code that makes this happen is this (inside the for loop)

else:
    if debug:
      out.write("IGNORED" + result + "\t" + meaning + "\n")
    ignored += 1
I'm sure I've set the correct column numbers for the fields if that has anything to do with the ignored message.
The out file is always blank.

Ignore the uploaded images btw, they were for a previous thread.



Just changed if foundany: to if True, looks like it didn't catch the True inside else


EDIT

Scratch that, it worked but it isn't clozing properly. The number of clozes were VERY few (only 8 when there should be around 20k+)
I'm sure I should leave knownkanji.txt empty right? so that it'd cloze every Kanji it sees?

  1. 1 Posted by A on 08 Aug, 2015 11:29 AM

    A's Avatar

    EDIT:
    Just got it to work but it only resulted in around 4000 cards, I'm sure it should be around 6k+ (for 6k).

  2. System closed this discussion on 23 Feb, 2016 12:11 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac