remove synonyms and antonyms from MW, fix pronounciation

This commit is contained in:
julius 2022-12-09 19:18:59 +00:00
parent 5c5397437c
commit 0c11d07523

View File

@ -36,7 +36,7 @@ class MerriamWebsterParser(WordParser):
@property
def pronounciation(self):
prs = []
for e in self.root.findall(".//*[@class='pr']"):
for e in self.root.findall(".//span[@class='mw no-badge']"):
prs.append(ot(e))
return list(set(prs))
@ -121,9 +121,9 @@ class MerriamWebsterParser(WordParser):
"type": self.type,
"definitions": self.definitions,
"pronounciation": self.pronounciation,
"synonyms": self.synonyms,
"antonyms": self.antonyms,
"synonym_discussion": self.synonym_discussion,
# "synonyms": self.synonyms,
# "antonyms": self.antonyms,
# "synonym_discussion": self.synonym_discussion,
"examples": self.examples,
"history_and_etymology": self.history_and_etymology,
"first_known_use": self.first_known_use,
@ -133,14 +133,14 @@ class MerriamWebsterParser(WordParser):
)
testword = "domicile"
d = MerriamWebsterParser(testword)
# print(d.definitions)
print(d.neighbours)
word_dict = d.todict()
for k, v in word_dict[testword].items():
print(f"### {k} ###\n", v)
exit()
# testword = "domicile"
# d = MerriamWebsterParser(testword)
# # print(d.definitions)
# print(d.neighbours)
# word_dict = d.todict()
# for k, v in word_dict[testword].items():
# print(f"### {k} ###\n", v)
# exit()
q = Queue(MerriamWebsterParser, "en_MerriamWebster/", "_MW.json")
q.loadDB()