Coverage for src / wiktextract / extractor / fr / tags.py: 88%
42 statements
« prev ^ index » next coverage.py v7.12.0, created at 2025-11-28 08:21 +0000
« prev ^ index » next coverage.py v7.12.0, created at 2025-11-28 08:21 +0000
1# Grammatical glossary appendix:
2# https://fr.wiktionary.org/wiki/Annexe:Glossaire_grammatical
3# List of templates:
4# https://fr.wiktionary.org/wiki/Wiktionnaire:Liste_de_tous_les_modèles
5from .models import WordEntry
7# https://en.wikipedia.org/wiki/Grammatical_gender
8GENDER_TAGS: dict[str, str | list[str]] = {
9 "commun": "common",
10 "féminin": "feminine",
11 "masculin": "masculine",
12 "neutre": "neuter",
13 # https://fr.wiktionary.org/wiki/Modèle:mf
14 "masculin et féminin identiques": ["masculine", "feminine"],
15 # table header: https://fr.wiktionary.org/wiki/Modèle:fr-rég
16 "masculin et féminin": ["masculine", "feminine"],
17 # "Modèle:mf ?", "Modèle:fm ?"
18 "masculin ou féminin (l’usage hésite)": ["masculine", "feminine"],
19 "féminin ou masculin (l’usage hésite)": ["feminine", "masculine"],
20 "invariable": "invariable", # Modèle:invar
21 # Modèle:flex-ku-nommixt
22 "masculin sing.": ["masculine", "singular"],
23 "féminin sing.": ["feminine", "singular"],
24 # Template:ja-flx-adj-な
25 "neutre négatif": ["neuter", "negative"],
26 "neutre passé": ["neuter", "past"],
27 "neutre négatif passé": ["neuter", "negative", "past"],
28 "poli négatif": ["polite", "negative"],
29 "poli passé": ["polite", "past"],
30 "poli négatif passé": ["polite", "negative", "past"],
31 # Template:m
32 "masculin animé": ["masculine", "animate"],
33 "masculin inanimé": ["masculine", "inanimate"],
34 # Template:f
35 "féminin animé": ["feminine", "animate"],
36 "féminin inanimé": ["feminine", "inanimate"],
37 # Template:n
38 "neutre animé": ["neuter", "animate"],
39 "neutre inanimé": ["neuter", "inanimate"],
40 # Template:fr-rég
41 "masculin\net féminin": ["masculine", "feminine"],
42}
44# https://en.wikipedia.org/wiki/Grammatical_number
45NUMBER_TAGS: dict[str, str | list[str]] = {
46 "singulier": "singular",
47 "pluriel": "plural",
48 "duel": "dual",
49 "collectif": "collective",
50 "singulatif": "singulative",
51 "indénombrable": "uncountable", # sv-nom-c-ind
52 "au singulier": "singular",
53 "au singulier uniquement": "singular-only",
54 "au pluriel": "plural",
55 "au pluriel uniquement": "plural-only",
56 "singulier et pluriel identiques": ["singular", "plural"],
57 "nom collectif": "collective",
58 # "générique": "", # Modèle:g
59 # "nom d'unité": "", # Modèle:nu
60 "généralement indénombrable": "uncountable",
61 "dénombrable": "countable",
62 # Modèle:br-nom
63 "pluriel 1": "plural",
64 "pluriel 2": "plural",
65 "pluriel 3": "plural",
66 "pluriel 4": "plural",
67 # https://fr.wiktionary.org/wiki/Modèle:avk-tab-conjug
68 "1": "first-person",
69 "2": "second-person",
70 "3": "third-person",
71 "4": "fourth-person",
72 # Template:nl-conj-cons
73 # https://en.wikipedia.org/wiki/Dutch_grammar#Personal_pronouns
74 "ik": ["first-person", "singular"],
75 "jij": ["second-person", "singular", "informal"],
76 "hij, zij, het": "third-person",
77 "wij": ["first-person", "plural"],
78 "jullie": ["second-person", "plural", "informal"],
79 "zij": ["third-person", "plural"],
80 "u": "second-person",
81 # Template:cs-conj-e
82 "já": ["first-person", "singular"],
83 "ty": ["second-person", "singular"],
84 "on\nona\nono": ["third-person", "singular"],
85 "my": ["first-person", "plural"],
86 "vy": ["second-person", "plural"],
87 "oni\nony\nony": ["third-person", "plural"],
88 # Template:ro-verb-1-tab
89 "1ʳᵉ personne du singulier\nprésent de l’indicatif": [
90 "first-person",
91 "singular",
92 "present",
93 "indicative",
94 ],
95 "3ᵉ personne du singulier\nprésent du subjonctif": [
96 "third-person",
97 "singular",
98 "present",
99 "subjunctive",
100 ],
101}
103# https://en.wikipedia.org/wiki/Grammatical_mood
104MOOD_TAGS: dict[str, str] = {
105 "indicatif": "indicative",
106 "subjonctif": "subjunctive",
107 "conditionnel": "conditional",
108 "impératif": "imperative",
109 "volitif": "volitive",
110 "déclaratif": "declarative",
111 "interrogatif": "interrogative",
112 "aperceptif": "apperceptive",
113 "euphémique": "euphemistic",
114 "évidentiel": "evidential",
115 "spéculatif": "speculative",
116 "assertif": "assertive",
117 "hortatif": "hortative",
118 "promissif": "promissive",
119 "conditionnel / subjonctif": ["conditional", "subjunctive"],
120 "conjonctif": "subjunctive",
121 "provisionnel": "temporal",
122 # Template:de-conj
123 "subjonctif i": "subjunctive-i",
124 "subjonctif ii": "subjunctive-ii",
125 "conjectural/volitif": ["conjectural", "volitive"],
126 # Modèle:ro-verb-décl
127 "présomptif": "presumptive",
128 "potentiel": "potential",
129}
131VERB_FORM_TAGS: dict[str, str | list[str]] = {
132 "participe": "participle",
133 "imparfait": "imperfect",
134 # Template:ku-conj-trans
135 "parfait": "perfect",
136 "imparfait narratif": ["imperfect", "narrative"],
137 "infinitif": "infinitive",
138 "gérondif": "gerund",
139 # template "pt-verbe-flexion"
140 "infinitif personnel": ["infinitive", "personal"],
141 "supin": "supine",
142 # Template:ko-conj
143 "conjugaison": "conjugation",
144 "radical": "radical",
145 "formes finales": "final",
146 "registre formel": "formal",
147 "registre informel": "informal",
148 "non poli": "impolite",
149 "poli": "polite",
150 "formes nominales": "nominal",
151 "formes conjonctives": "subjunctive",
152 # Template:ja-在る
153 "formes de base": "base-form",
154 "affirmatif": "affirmative",
155 "négatif": "negative",
156 "adverbial": "adverbial",
157 # Template:bg-verbe186
158 "aoriste": "aorist",
159 "participe passé passif": ["participle", "past", "passive"],
160 "participe passé actif": ["participle", "past", "active"],
161 "participe imparfait": ["participle", "imperfect"],
162 "auxiliaire": "auxiliary",
163 "bitransitif": "ditransitive",
164 "déterminé": "determinate",
165 "indéterminé": "indeterminate",
166 # Template:irrégulier
167 "irrégulier": "irregular",
168 # Template:se-conj
169 "nom d’action": "noun-from-verb",
170 "thème négatif": "negative",
171}
173# https://en.wikipedia.org/wiki/Grammatical_case
174CASE_TAGS: dict[str, str | list[str]] = {
175 "ablatif": "ablative",
176 "accusatif": "accusative",
177 "accusatif génitif": ["accusative", "genitive"],
178 "nominatif": "nominative",
179 "datif": "dative",
180 "génitif": "genitive",
181 "vocatif": "vocative",
182 "instrumental": "instrumental",
183 "locatif": "locative",
184 "comitatif": "comitative",
185 "essif": "essive",
186 "illatif": "illative",
187 # Template:ro-nom-tab
188 "nominatif\naccusatif": ["nominative", "accusative"],
189 "datif\ngénitif": ["dative", "genitive"],
190 # Template:ko-nom
191 "nominatif / attributif": ["nominative", "attributive"],
192 # Modèle:fro-adj
193 "sujet": "subject",
194 "régime": "oblique",
195 # Template:se-décl-pari
196 "accusatif\ngénitif": ["accusative", "genitive"],
197 # Template:fi-décl-ihminen
198 "partitif": "partitive",
199 "inessif": "inessive",
200 "élatif": "elative",
201 "adessif": "adessive",
202 "allatif": "allative",
203 "translatif": "translative",
204 "abessif": "abessive",
205 "instructif": "instructive",
206}
208# https://en.wikipedia.org/wiki/Grammatical_tense
209TENSE_TAGS: dict[str, str | list[str]] = {
210 "présent": "present",
211 "passé": "past",
212 "passé simple": "past",
213 "futur": "future",
214 "futur simple": "future",
215 # https://en.wikipedia.org/wiki/Passé_composé
216 "passé composé": ["past", "multiword-construction"],
217 "plus-que-parfait": "pluperfect",
218 "passé antérieur": ["past", "anterior"],
219 "futur antérieur": ["future", "perfect"],
220 "prétérit": "preterite",
221 "présent simple,\n3ᵉ pers. sing.": ["present", "third-person", "singular"],
222 "participe passé": ["participle", "past"],
223 "participe présent": ["participle", "present"],
224 # Template:ku-conj-trans
225 "présent progressif": ["present", "progressive"],
226 "prétérit et imparfait": ["preterite", "imperfect"],
227 "non passé": "non-past",
228 "présent / futur": ["present", "future"],
229 # Template:de-conj
230 "futur i": "future-i",
231 "futur ii": "future-ii",
232 # Template:it-irrégulier-avere-1
233 "présent affirmatif": ["present", "affirmative"],
234 "présent négatif": ["present", "negative"],
235 # Modèle:ro-verb-décl
236 "infinitif passé": ["infinitive", "past"],
237 "futur populaire": ["future", "colloquial"],
238 "futur littéraire": ["future", "literary"],
239 "présent progrésif": ["present", "progressive"],
240}
242# https://en.wikipedia.org/wiki/Grammatical_person
243PERSON_TAGS: dict[str, str | list[str]] = {
244 "1ᵉ personne": "first-person",
245 "1ʳᵉ personne": "first-person",
246 "2ᵉ personne": "second-person",
247 "3ᵉ personne": "third-person",
248 # Modèle:avk-conj
249 "1ʳᵉ du sing.": ["first-person", "singular"],
250 "2ᵉ du sing.": ["second-person", "singular"],
251 "3ᵉ du sing.": ["third-person", "singular"],
252 "1ʳᵉ du plur.": ["first-person", "plural"],
253 "2ᵉ du plur.": ["second-person", "plural"],
254 "3ᵉ du plur.": ["third-person", "plural"],
255 "4ᵉ du plur.": ["fourth-person", "plural"],
256 # Modèle:ro-verb-décl
257 "1ʳᵉ personne\n(eu)": "first-person",
258 "2ᵉ personne\n(tu)": "second-person",
259 "3ᵉ personne\n(el/ea/el)": "third-person",
260 "1ʳᵉ personne\n(noi)": "first-person",
261 "2ᵉ personne\n(voi)": "second-person",
262 "3ᵉ personne\n(ei/ele/ele)": "third-person",
263 # Template:se-conj
264 "je": ["first-person", "singular"],
265 "tu": ["second-person", "singular"],
266 "il/elle": ["third-person", "singular"],
267 "nous deux": ["first-person", "dual"],
268 "vous deux": ["second-person", "dual"],
269 "ils/elles deux": ["third-person", "dual"],
270 "nous": ["first-person", "plural"],
271 "vous": ["second-person", "plural"],
272 "ils/elles": ["third-person", "plural"],
273}
275SEMANTICS_TAGS: dict[str, str] = {
276 # https://en.wikipedia.org/wiki/Definiteness
277 "défini": "definite",
278 "indéfini": "indefinite",
279 # template:ro-nom-tab
280 "articulé": "definite",
281 "non articulé": "indefinite",
282}
284COMPARISON_TAGS: dict[str, str] = {
285 # https://en.wikipedia.org/wiki/Comparison_(grammar)
286 "positif": "positive",
287 "comparatif": "comparative",
288 "superlatif": "superlative",
289 "non comparable": "not-comparable",
290 "superlatif absolu": ["superlative", "absolute"],
291}
293# https://en.wikipedia.org/wiki/Occitan_language#Writing_system
294OCCITAN_NORM_TAGS: dict[str, str] = {
295 # https://fr.wiktionary.org/wiki/Modèle:oc-norme_mistralienne
296 "graphie mistralienne": "Mistralian",
297 # https://fr.wiktionary.org/wiki/Modèle:oc-norme_classique
298 # "graphie normalisée": "",
299 # Modèle:oc-norme bonnaudienne
300 # "graphie bonnaudienne": "",
301}
303# https://en.wikipedia.org/wiki/Breton_mutations
304# https://fr.wiktionary.org/wiki/Modèle:br-nom
305BRETON_MUTATION_TAGS: dict[str, str] = {
306 "non muté": "unmutated",
307 "adoucissante": "mutation-soft",
308 "durcissante": "mutation-hard",
309 "spirante": "mutation-spirant",
310 "nasale": "mutation-nasal",
311}
313JA_TAGS: dict[str, str] = {
314 # https://fr.wiktionary.org/wiki/Modèle:ja-trans
315 "kanji": "kanji",
316 "hiragana": "hiragana",
317 "katakana": "katakana",
318 "transcription": "transcription",
319}
321OTHER_GRAMMATICAL_TAGS: dict[str, str] = {
322 # https://fr.wiktionary.org/wiki/Modèle:be-tab-cas
323 "prépositionnel": "prepositional",
324 "anglicisme": "Anglicism",
325 "pronominal": "pronominal",
326 "diminutif": "diminutive",
327 "réfléchi": "reflexive", # Modèle:réfl
328 "réciproque": "reciprocal", # Modèle:réciproque
329 "impersonnel": "impersonal", # Modèle:impers
330 "transitif": "transitive", # Modèle:t
331 "transitif indirect": ["transitive", "indirect"], # Modèle:transitif indir
332 "intransitif": "intransitive", # Modèle:i
333 "injurieux": "offensive", # Modèle:injurieux
334 # Modèle:zh-formes
335 "simplifié": "Simplified-Chinese",
336 "traditionnel": "Traditional-Chinese",
337 # Modèle:flex-ku-nomf
338 "ézafé principal": ["ezafe", "primary"],
339 "ézafé secondaire": ["ezafe", "secondary"],
340 "cas oblique": "oblique",
341 # Modèle:ku-conj-trans
342 "forme affirmative": "affirmative",
343 "forme négative": "negative",
344 # Modèle:bg-nom
345 "forme de base": "base-form",
346 "pluriel numéral": ["plural", "numeral"],
347 "animé": "animate",
348 "inanimé": "inanimate",
349 # Template:ko-nom
350 "hangeul": "hangeul",
351 "hanja": "hanja",
352 "avec clitique": "clitic",
353 "indéclinable": "indeclinable",
354 "toponyme": "toponymic",
355 "applicatif": "applicative",
356 "causatif": "causative",
357 "sigle": "abbreviation",
358 "attributif": "attributive",
359 "prédicatif": "predicative",
360 # Template:cy-mut
361 "non muté": "unmutated",
362 "lénition": "lenition",
363 "nasalisation": "nasalization",
364 "syllabaire": "Syllabics",
365 "par ellipse": "ellipsis", # Template:ellipse
366 "ironique": "ironic",
367 "suffixe": "suffix",
368 # Template:avk-tab-conjug
369 "conjugaison présent indicatif": ["present", "indicative"],
370 # Modèle:de-adjectif-déclinaisons
371 "déclinaison forte": "strong",
372 "déclinaison faible": "weak",
373 "déclinaison mixte": "mixed",
374 "singulier / pluriel": ["singular", "plural"],
375 # Template:ja-する
376 "inaccompli": "uncompleted",
377 "imperfectif (未然形, mizen-kei)": "imperfective",
378 "continuatif (連用形, ren'yō-kei)": "continuative",
379 "conclusif (終止形, shūshi-kei)": "terminal",
380 "attributif (連体形, rentai-kei)": "attributive",
381 "hypothétique (仮定形, katei-kei)": "hypothetical",
382 "impératif (命令形, meirei-kei)": "imperative",
383 "forme en -te": "gerund",
384 "désidératif adjectif variable (flexions)": ["desiderative", "adjective"],
385 # Template:ja-flx-adj-な
386 "imperfectif (未然形)": "imperfective",
387 "continuatif (連用形)": "continuative",
388 "conclusif (終止形)": "terminal",
389 "attributif (連体形)": "attributive",
390 "hypothétique (仮定形)": "hypothetical",
391 "impératif (命令形)": "imperative",
392 # Template:ko-nom
393 "avec\nclitique": "clitic",
394 "thème": "stem",
395 "nominatif\n/ attributif": ["nominative", "attributive"],
396 "seulement": "exclusive",
397 # Template:pt-conj/*
398 "formas impessoais\n(formes impersonnelles)": "impersonal",
399 "infinitivo (infinitif)": "infinitive",
400 "gerúndio (gérondif)": "gerund",
401 "particípio (participe)": "participle",
402 "formas pessoais\n(formes personnelles)": "personal",
403 "singular (singulier)": "singular",
404 "plural (pluriel)": "plural",
405 "primeira (première)": "first-person",
406 "segunda (deuxième)": "second-person",
407 "terceira (troisième)": "third-person",
408 "infinitivo pessoal\n(infinitif personnel)": ["infinitive", "personal"],
409 "modo indicativo (indicatif)": "indicative",
410 "presente\n(présent)": "present",
411 "pretérito imperfeito\n(prétérit imparfait)": ["imperfect", "preterite"],
412 "pretérito perfeito\n(prétérit parfait)": ["perfect", "preterite"],
413 "pretérito mais-que-perfeito\n(prétérit plus-que-parfait)": [
414 "perfect",
415 "pluperfect",
416 ],
417 "futuro do presente\n(futur du présent)": "future",
418 "futuro do pretérito\n(futur du prétérit)": "conditional",
419 "modo subjuntivo (conjuntivo) (mode subjonctif)": "subjunctive",
420 "futuro\n(futur)": "future",
421 "mode imperativo (impératif)": "imperative",
422 "afirmativo\n(affirmatif)": "affirmative",
423 "negativo\n(négatif)": "negative",
424 "brésilien": "Brazilian",
425}
427# template text before gloss
428SENSE_TAGS: dict[str, str] = {
429 # https://fr.wiktionary.org/wiki/Modèle:figuré
430 # https://fr.wiktionary.org/wiki/Catégorie:Modèles_de_relation_entre_les_définitions
431 # Catégorie:Modèles de genre textuel
432 # Catégorie:Modèles de registre
433 "sens figuré": "figuratively",
434 "sens propre": "literally",
435 "par métonymie": "metonymically", # Modèle:par métonymie
436 "par hyperbole": "hyperbole",
437 "par extension": "broadly",
438 "par analogie": "analogy",
439 "en particulier": "especially",
440 "par litote": "litotes",
441 "par euphémisme": "euphemism",
442 "spécifiquement": "specifically",
443 "génériquement": "generically",
444 "spécialement": "especially",
445 "généralement": "generally",
446 "enclise": "enclitic",
447 "idiotisme": "idiomatic",
448 "péjoratif": "pejorative",
449 "désuet": "obsolete",
450 "archaïsme": "archaic",
451 "vieilli": "dated",
452 "néologisme": "neologism",
453 "argot": "slang",
454 "rare": "rare",
455 # "plus rare": "rare",
456 "littéraire": "literary", # Modèle:littéraire
457 "poétique": "poetic", # Modèle:poétique
458 # "didactique": "", # Modèle:didactique
459 "soutenu": "formal", # Modèle:soutenu
460 "informel": "informal", # Modèle:informel
461 "familier": "familiar", # Modèle:familier
462 "très familier": "very-familiar", # Modèle:très familier
463 "populaire": "colloquial", # Modèle:populaire
464 "vulgaire": "vulgar", # Modèle:vulgaire
465 "langage enfantin": "childish", # Modèle:enfantin
466 # Catégorie:Modèles de thématique
467 "anglicisme informatique": "Anglicism",
468 "proverbe": "proverb",
469 "collectivement": "collectively",
470 "courant": "common", # Modèle:courant
471 "adjectif attribut": ["adjective", "attributive"],
472}
474# https://en.wikipedia.org/wiki/Voice_(grammar)
475VOICE_TAGS: dict[str, str | list[str]] = {
476 # https://fr.wiktionary.org/wiki/Modèle:eo-conj
477 "participe actif": ["participle", "active"],
478 "participe passif": ["participle", "passive"],
479 "adverbe actif": ["adverb", "active"],
480 "adverbe passif": ["adverb", "passive"],
481 "substantif\nactif": ["subsuntive", "active"],
482 "substantif\npassif": ["subsuntive", "passive"],
483 "actif": "active",
484 "passif": "passive",
485 "adverbe": "adverb",
486}
488# Module:lexique/data
489LEXIQUE_TAGS = {
490 "hindouisme": "Hinduism",
491 "judaïsme": "Judaism",
492 "marxisme": "Marxism",
493 "nazisme": "Nazism",
494 "physique": "physical",
495 "rhétorique": "rhetoric",
496 "antiquité": "Ancient",
497 "antiquité grecque": "Ancient-Greek",
498 "antiquité romaine": "Ancient-Roman",
499 "bible": "Biblical",
500 "moyen âge": "Middle-Ages",
501 "union européenne": "European-Union",
502 "analyse": "analytic",
503}
505# Template:cmn-pron
506# https://fr.wiktionary.org/wiki/自由
507ZH_PRON_TAGS = {
508 "pinyin": "Pinyin",
509 "efeo": "EFEO", # https://en.wikipedia.org/wiki/EFEO_Chinese_transcription
510 "wade-giles": "Wade-Giles",
511 "yale": "Yale",
512 "zhuyin": "Bopomofo",
513 "mandarin": "Mandarin",
514 "cantonais": "Cantonese",
515 "cantonais (yue)": "Cantonese",
516 "jyutping": "Jyutping",
517 "hakka": "Hakka",
518 "pha̍k-fa-sṳ": "Phak-fa-su",
519 "meixian, guangdong": ["Meixian", "Guangdong"],
520 "jin": "Jin",
521 "mindong": "Min-Dong",
522 # https://en.wikipedia.org/wiki/Bàng-uâ-cê
523 "bàng-uâ-cê (fuzhou)": ["Bang-ua-ce", "Fuzhou"],
524 "minnan": "Min-Nan",
525 "pe̍h-ōe-jī (hokkien : fujian, taïwan)": [
526 "Peh-oe-ji",
527 "Hokkien",
528 "Fujian",
529 "Taiwan",
530 ],
531 "chaozhou, peng'im": ["Chaozhou", "Peng'im"],
532 "wu": "Wu",
533 "shanghai": "Shanghai",
534 "chinois médiéval": "Medieval-Chinese",
535 "chinois archaïque": "Old-Chinese",
536 "baxter-sagart": "Baxter-Sagart",
537 "zhengzhang": "Zhengzhang",
538}
540ASPECT_TAGS = {
541 "perfectif": "perfective", # Modèle:perfectif
542 "imperfectif": "imperfective", # Modèle:imperfectif
543}
545GRAMMATICAL_TAGS: dict[str, str | list[str]] = {
546 **GENDER_TAGS,
547 **NUMBER_TAGS,
548 **MOOD_TAGS,
549 **VERB_FORM_TAGS,
550 **CASE_TAGS,
551 **TENSE_TAGS,
552 **PERSON_TAGS,
553 **SEMANTICS_TAGS,
554 **COMPARISON_TAGS,
555 **OCCITAN_NORM_TAGS,
556 **BRETON_MUTATION_TAGS,
557 **JA_TAGS,
558 **OTHER_GRAMMATICAL_TAGS,
559 **SENSE_TAGS,
560 **VOICE_TAGS,
561 **LEXIQUE_TAGS,
562 **ZH_PRON_TAGS,
563 **ASPECT_TAGS,
564}
567def translate_raw_tags(data: WordEntry) -> WordEntry:
568 from .topics import SLANG_TOPICS, TOPIC_TAGS
570 raw_tags = []
571 for raw_tag in data.raw_tags:
572 raw_tag_lower = raw_tag.lower()
573 if raw_tag_lower in GRAMMATICAL_TAGS:
574 tr_tag = GRAMMATICAL_TAGS[raw_tag_lower]
575 if isinstance(tr_tag, str) and tr_tag not in data.tags:
576 data.tags.append(tr_tag)
577 elif isinstance(tr_tag, list): 577 ↛ 571line 577 didn't jump to line 571 because the condition on line 577 was always true
578 for t in tr_tag:
579 if t not in data.tags:
580 data.tags.append(t)
581 elif hasattr(data, "topics") and raw_tag_lower in TOPIC_TAGS:
582 data.topics.append(TOPIC_TAGS[raw_tag_lower])
583 elif hasattr(data, "topics") and raw_tag_lower in SLANG_TOPICS: 583 ↛ 584line 583 didn't jump to line 584 because the condition on line 583 was never true
584 data.topics.append(SLANG_TOPICS[raw_tag_lower])
585 if "slang" not in data.tags:
586 data.tags.append("slang")
587 else:
588 raw_tags.append(raw_tag)
589 data.raw_tags = raw_tags
590 return data