Skip to content

Commit

Permalink
break before definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Artikash committed Mar 27, 2020
1 parent 25bf2e2 commit 6d71285
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SavedDictionary.txt
SavedDictionary*
JMDict
JMDict_e
*.dict
Expand Down
2 changes: 1 addition & 1 deletion freedict_to_textractor.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
}
saveStringToFile(Object.keys(definitions).map(
definition => definitions[definition].map(term => "|TERM|" + term).join("") +
"|DEFINITION|" + definition.replace(/\n/g, "<br>") + "|END|"
"|DEFINITION|<p>" + definition.replace(/\n/g, "<br>") + "|END|"
).join("\n"), "SavedDictionary.txt");
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions jmdict_to_textractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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|<small>({', '.join(filter(lambda word: word not in exclude, term.words))})</small>")
outfile.writelines(f"\n<p>{definition}</p>" for definition in definitions)
outfile.write(f"|DEFINITION|<p><small>({', '.join(filter(lambda word: word not in exclude, term.words))})</small>")
outfile.writelines(f"\n<p>{definition}" for definition in definitions)
outfile.write("|END|\n")
outfile.write(open("inflections.txt", "r", encoding="utf-8").read())

0 comments on commit 6d71285

Please sign in to comment.