Skip to content
Snippets Groups Projects
Commit e664747a authored by Enzo Simonnet's avatar Enzo Simonnet
Browse files

Replace wikstraktor.py

parent e9cf4ddf
No related branches found
No related tags found
No related merge requests found
...@@ -258,7 +258,7 @@ class ParserContext: ...@@ -258,7 +258,7 @@ class ParserContext:
#Dans le dictionnaire de keys, il n'y a jamais de senses ou de POS #Dans le dictionnaire de keys, il n'y a jamais de senses ou de POS
res = Entry(self.lemma) res = Entry(self.lemma)
for l in self.context: for l in self.context:
print(l.keys()) #print(l.keys())
if "pro" in l.keys(): if "pro" in l.keys():
res.set_pronunciations(l['pro']) res.set_pronunciations(l['pro'])
if "ety" in l.keys(): if "ety" in l.keys():
...@@ -371,16 +371,16 @@ class Wikstraktor: ...@@ -371,16 +371,16 @@ class Wikstraktor:
res = title == self.constants['pro'] res = title == self.constants['pro']
else: else:
res = title in self.constants['pro'] res = title in self.constants['pro']
print(title, res) #print(title, res)
return res return res
def isEty(self, title): def isEty(self, title):
if type(self.constants['ety']) == str: if type(self.constants['ety']) == str:
res = title == self.constants['ety'] res = title == self.constants['ety']
else: else:
res = title in self.constants['ety'] res = title in self.constants['ety']
return res return res
def process_POS(self, parsedwikitext): def process_POS(self, parsedwikitext):
pass#in subclass pass#in subclass
...@@ -402,7 +402,7 @@ class Wikstraktor: ...@@ -402,7 +402,7 @@ class Wikstraktor:
if __name__ == "__main__": if __name__ == "__main__":
#e = Wikstraktor.get_instance('en', "en") #e = Wikstraktor.get_instance('en', "en")
f = Wikstraktor.get_instance('fr', 'en') f = Wikstraktor.get_instance('en', 'en')
# print(e.get_file_url("File:LL-Q1860 (eng)-Nattes à chat----parent.wav")) # print(e.get_file_url("File:LL-Q1860 (eng)-Nattes à chat----parent.wav"))
# print(e.get_file_url("File:LL-Q1860 (eng)-Nattes à chat-parent.wav")) # print(e.get_file_url("File:LL-Q1860 (eng)-Nattes à chat-parent.wav"))
#e.fetch("water") #e.fetch("water")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment