Skip to content

Commit 9e1e329

Browse files
committed
Fix wiktionary format
1 parent 372138e commit 9e1e329

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

vocabsieve/dictformats.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,11 @@ def parseKaikki(path, lang) -> dict[str, str]:
284284
def kaikki_line_to_textdef(row: dict) -> str:
285285
res = ""
286286
if row.get("pos"):
287-
res += f"<i>{row['pos'].capitalize()}</i>"
288-
res += "\n<strong>"
287+
res += f"<i>{row['pos'].capitalize()}</i> <br>\n"
288+
res += "<strong>"
289289
if row.get("head_templates"):
290-
res += f"{row['head_templates'][-1]['expansion']}"
291-
res += "</strong>\n"
290+
res += f"{row['head_templates'][-1]['expansion']}".replace("\n","").replace("<br>","")
291+
res += "</strong><br>\n"
292292
if row.get("sounds"):
293293
for item in row['sounds']:
294294
if item.get('ipa'):
@@ -300,10 +300,10 @@ def kaikki_line_to_textdef(row: dict) -> str:
300300
for item in row['senses']:
301301
if item.get("raw_glosses"):
302302
for defi in item['raw_glosses']:
303-
res += "\n" + str(count) + ". " + defi
303+
res += "<br>\n" + str(count) + ". " + defi
304304
count += 1
305305
elif item.get("glosses"):
306306
for defi in item['glosses']:
307-
res += "\n" + str(count) + ". " + defi
307+
res += "<br>\n" + str(count) + ". " + defi
308308
count += 1
309309
return res

0 commit comments

Comments
 (0)