@@ -1079,6 +1079,43 @@ def render_sigle(tpl: str, parts: list[str], data: defaultdict[str, str], *, wor
1079
1079
return phrase
1080
1080
1081
1081
1082
+ def render_substantivation_de (tpl : str , parts : list [str ], data : defaultdict [str , str ], * , word : str = "" ) -> str :
1083
+ """
1084
+ >>> render_substantivation_de("substantivation de", ["mot", "fr"], defaultdict(str))
1085
+ 'Substantivation de <i>mot</i>'
1086
+ >>> render_substantivation_de("substantivation de", ["mot", "fr"], defaultdict(str, {"type": "adjectif"}))
1087
+ 'Substantivation de l’adjectif <i>mot</i>'
1088
+ >>> render_substantivation_de("substantivation de", ["mot", "fr"], defaultdict(str, {"type": "infinitif"}))
1089
+ 'Substantivation de l’infinitif <i>mot</i>'
1090
+ >>> render_substantivation_de("substantivation de", ["mot", "fr"], defaultdict(str, {"type": "participe"}))
1091
+ 'Substantivation du participe du verbe <i>mot</i>'
1092
+ >>> render_substantivation_de("substantivation de", ["mot", "fr"], defaultdict(str, {"type": "locution verbale"}))
1093
+ 'Substantivation de la locution verbale <i>mot</i>'
1094
+ >>> render_substantivation_de("substantivation de", ["mot", "fr"], defaultdict(str, {"type": "locution verbale", "sens": "verbeux"}))
1095
+ 'Substantivation de la locution verbale <i>mot</i> (« verbeux »)'
1096
+ """
1097
+ text = "Substantivation"
1098
+
1099
+ match type_ := data ["type" ]:
1100
+ case "adjectif" | "infinitif" :
1101
+ text += f" de l’{ type_ } "
1102
+ case "locution verbale" :
1103
+ text += f" de la { type_ } "
1104
+ case "participe" :
1105
+ text += f" du { type_ } du verbe"
1106
+ case "" :
1107
+ text += " de"
1108
+ case _:
1109
+ assert 0 , f"Unhandled { tpl !r} type { type_ !r} ."
1110
+
1111
+ text += f" { italic (parts [0 ])} "
1112
+
1113
+ if sens := data ["sens" ]:
1114
+ text += f" (« { sens } »)"
1115
+
1116
+ return text
1117
+
1118
+
1082
1119
def render_suisse (tpl : str , parts : list [str ], data : defaultdict [str , str ], * , word : str = "" ) -> str :
1083
1120
"""
1084
1121
>>> render_suisse("Suisse", ["fr"], defaultdict(str, {"précision":"Fribourg, Valais, Vaud"}))
@@ -1374,6 +1411,7 @@ def render_zh_lien(tpl: str, parts: list[str], data: defaultdict[str, str], *, w
1374
1411
"sigle" : render_sigle ,
1375
1412
"source?" : render_refnec ,
1376
1413
"source ?" : render_refnec ,
1414
+ "substantivation de" : render_substantivation_de ,
1377
1415
"Suisse" : render_suisse ,
1378
1416
"supplétion" : render_suppletion ,
1379
1417
"syncope" : render_modele_etym ,
0 commit comments