diff --git a/.gitignore b/.gitignore index e51146c..abfc489 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -SavedDictionary.txt +SavedDictionary* JMDict JMDict_e *.dict diff --git a/freedict_to_textractor.html b/freedict_to_textractor.html index e89caf1..0dbc8d9 100644 --- a/freedict_to_textractor.html +++ b/freedict_to_textractor.html @@ -57,7 +57,7 @@ } saveStringToFile(Object.keys(definitions).map( definition => definitions[definition].map(term => "|TERM|" + term).join("") + - "|DEFINITION|" + definition.replace(/\n/g, "
") + "|END|" + "|DEFINITION|

" + definition.replace(/\n/g, "
") + "|END|" ).join("\n"), "SavedDictionary.txt"); } diff --git a/jmdict_to_textractor.py b/jmdict_to_textractor.py index cc26c1c..7e24f99 100644 --- a/jmdict_to_textractor.py +++ b/jmdict_to_textractor.py @@ -42,7 +42,7 @@ def inflect(term): for term, definitions in definitions_by_term.items(): outfile.writelines(f"|TERM|{inflection}" for inflection in inflect(term)) - outfile.write(f"|DEFINITION|({', '.join(filter(lambda word: word not in exclude, term.words))})") - outfile.writelines(f"\n

{definition}

" for definition in definitions) + outfile.write(f"|DEFINITION|

({', '.join(filter(lambda word: word not in exclude, term.words))})") + outfile.writelines(f"\n

{definition}" for definition in definitions) outfile.write("|END|\n") outfile.write(open("inflections.txt", "r", encoding="utf-8").read())