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

Replace fr_en.py

parent b5123bf4
No related branches found
No related tags found
No related merge requests found
......@@ -27,10 +27,12 @@ class Fr_en_straktor(Wikstraktor):
# p.set_transcription(t.arguments[i+1].value)
if t.normal_name() == self.constants['t_snd']:
p.add_sound(self.get_file_url(t.arguments[-1].value))
j=0
while "=" in t.arguments[j]:
j += 1
p.set_accent(t.arguments[j])
if len(self.wtp.parse(t.get_arg("1").value).templates) != 1:
p.set_accent(t.get_arg("1").value)
else:
p.set_accent(self.wtp.parse(t.get_arg("1").value).templates[0].normal_name())
if t.get_arg("2") != None:
p.set_transcription(t.get_arg("2").value)
if p.accent != None and p.sounds != []:
pronunciations.append(p)
p = Pronunciation()
......@@ -41,6 +43,18 @@ class Fr_en_straktor(Wikstraktor):
global debugEty
debugEty += 1
return "Etymology" + str(debugEty)
def process_POS(self,parsedwikitext):
pos = None
ik = 0
values = list(self.constants['POS'].values())
while pos == None and ik < len(self.constants['POS'].keys()):
if parsedwikitext in values[ik]:
keys = list(self.constants['POS'].keys())
pos = keys[ik]
ik += 1
# print(pos)
return pos
def process_senses(self, entry, pos, sensesContent):
baseId = f"{entry}_{pos}_"
......
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