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

def + ex OK

N° OK
Pas bien imbriqués 
parent bd4c7d91
No related branches found
No related tags found
No related merge requests found
...@@ -47,9 +47,11 @@ class En_en_straktor(Wikstraktor): ...@@ -47,9 +47,11 @@ class En_en_straktor(Wikstraktor):
l = sensesContent.get_lists(('\\# ', '\\#:','\\## ', '\\##:' )) l = sensesContent.get_lists(('\\# ', '\\#:','\\## ', '\\##:' ))
i = 0 i = 0
senses = [] senses = []
nombreDef = 0
while i < len(l): while i < len(l):
if l[i].pattern == '\\# ': if l[i].pattern == '\\# ':
newSense = Sense(f"{baseId}{i}") nombreDef += 1
newSense = Sense(f"{baseId}{nombreDef}")
if len(l[i].templates) > 0: if len(l[i].templates) > 0:
newSense.set_domain(l[i].templates[-1].arguments[-1].value)#We could use the second parameter for a comment newSense.set_domain(l[i].templates[-1].arguments[-1].value)#We could use the second parameter for a comment
newSense.add_def(self.wiki_language, self.wtp.parse(l[i].items[0]).plain_text().strip()) newSense.add_def(self.wiki_language, self.wtp.parse(l[i].items[0]).plain_text().strip())
...@@ -62,10 +64,12 @@ class En_en_straktor(Wikstraktor): ...@@ -62,10 +64,12 @@ class En_en_straktor(Wikstraktor):
if i == len(l)-1 or l[i+1].pattern == '\\# ' or l[i+1].pattern == '\\## ': if i == len(l)-1 or l[i+1].pattern == '\\# ' or l[i+1].pattern == '\\## ':
senses.append(newSense) senses.append(newSense)
cnt = 0 cnt = 0
nombreSousDef = 0
while l[i].level == 3 and i < len(l) : while l[i].level == 3 and i < len(l) :
cnt +=1 cnt +=1
if l[i].pattern == '\\## ': if l[i].pattern == '\\## ':
newSense2 = Sense(f"{baseId}{i}{cnt}") nombreSousDef += 1
newSense2 = Sense(f"{baseId}{nombreDef}{nombreSousDef}")
if len(l[i].templates) > 0: if len(l[i].templates) > 0:
newSense2.set_domain(l[i].templates[-1].arguments[-1].value)#We could use the second parameter for a comment newSense2.set_domain(l[i].templates[-1].arguments[-1].value)#We could use the second parameter for a comment
newSense2.add_def(self.wiki_language, self.wtp.parse(l[i].items[0]).plain_text().strip()) newSense2.add_def(self.wiki_language, self.wtp.parse(l[i].items[0]).plain_text().strip())
......
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