Skip to content

Commit

Permalink
fix #1547: [FR] Support '4e' template (#1561)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Jan 18, 2023
1 parent 6a096f4 commit 6c4e2c8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion wikidict/lang/fr/template_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ def render_2e(tpl: str, parts: List[str], data: Dict[str, str]) -> str:
'2<sup>e</sup>'
>>> render_2e("2e", ["partie"], defaultdict(str))
'2<sup>e</sup> partie'
>>> render_2e("3e", [], defaultdict(str))
'3<sup>e</sup>'
>>> render_2e("3e", ["partie"], defaultdict(str))
'3<sup>e</sup> partie'
"""
phrase = f"2{superscript('e')}"
start = tpl[0]
phrase = f"{start}{superscript('e')}"
if parts:
phrase += f" {parts[0]}"
return phrase
Expand Down Expand Up @@ -1267,6 +1272,8 @@ def render_zh_lien(tpl: str, parts: List[str], data: Dict[str, str]) -> str:
template_mapping = {
"1e attestation": render_1e_attestation,
"2e": render_2e,
"3e": render_2e,
"4e": render_2e,
"abréviation": render_abreviation,
"acronyme": render_acronyme,
"agglutination": render_modele_etym,
Expand Down

0 comments on commit 6c4e2c8

Please sign in to comment.