Skip to content

Commit

Permalink
latin word list
Browse files Browse the repository at this point in the history
  • Loading branch information
cqb13 committed Oct 15, 2024
1 parent ecd723e commit ff76852
Show file tree
Hide file tree
Showing 5 changed files with 1,183,896 additions and 6 deletions.
21 changes: 21 additions & 0 deletions data/formatLatin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import json


def load_latin_words():
with open("latin_words.json", "r") as file:
json_file = json.load(file)
with open("latin_words.txt", "w") as output_file:
for word in json_file:
defs = word["senses"]
str_def = " ".join(defs)
parts = word["parts"]
if str_def.startswith("|"):
str_def = str_def.replace("|", "", 1)
for part in parts:
if part != "---" and part != "zzz":
clean_part = part.replace(" | undeclined", "")
clean_part = clean_part.replace(" | abbreviation", "")
output_file.write(f"{clean_part} :: {str_def}\n")


load_latin_words()
Loading

0 comments on commit ff76852

Please sign in to comment.