This is my first contribution to a javascript project (I normally do Python) but it was pretty simple so I think it is fine.
Produces output like this:
"書","しょ","book; document; calligraphy (esp. Chinese); penmanship; handwriting; letter","Locked","3800"
"前","まえ","in front (of); before (e.g. a building); before; earlier; (the) front; frontal part; forward","Locked","100"
"子ども","こども","child","Locked","2300"
"なんて","なんて","things like; something like; someone like; such a thing as; (the fact) that; to think that","Blacklisted","100"
"の","の","indicates possessive; nominalizes verbs and adjectives; substitutes for ""ga"" in subordinate phrases; (at sentence-end, falling tone) indicates a confident conclusion; (at sentence-end) indicates emotional emphasis; (at sentence-end, rising tone) indicates question","Blacklisted","100"
Tested on a deck with ~4000 cards.
Small notes:
Had to add :scope to the querySelector() lines to get them to properly search (idea from this StackOverflow post). The problem I was receiving was in the English line when I was doing div:nth-child(2), it was pulling the second child in the first vocabulary word's div rather than the second vocabulary word.
Replaced all " with "" in the English definitions, then surrounded each entry in each row with "..." to properly allow quotation marks in the English definitions. Without this, standard csv parsers will get to the quotation marks in the middle of the English definition and start parsing things weirdly there. An example is in the の word above.
For some reason, the English definitions in the HTML all started with a random space, so I removed that.
Removed a blank column at the end of each row by removing the extra comma before the new line character.
This is my first contribution to a javascript project (I normally do Python) but it was pretty simple so I think it is fine.
Produces output like this:
Tested on a deck with ~4000 cards.
Small notes:
:scope
to thequerySelector()
lines to get them to properly search (idea from this StackOverflow post). The problem I was receiving was in the English line when I was doingdiv:nth-child(2)
, it was pulling the second child in the first vocabulary word's div rather than the second vocabulary word."
with""
in the English definitions, then surrounded each entry in each row with"..."
to properly allow quotation marks in the English definitions. Without this, standard csv parsers will get to the quotation marks in the middle of the English definition and start parsing things weirdly there. An example is in the の word above.