Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #200: [FR] Retrieve all italic templates #206

Merged
merged 1 commit into from
Nov 9, 2020

Conversation

lasconic
Copy link
Collaborator

@lasconic lasconic commented Nov 8, 2020

@BoboTiG
Copy link
Owner

BoboTiG commented Nov 9, 2020

There are duplicates in the templates_italic dict:

diff --git a/scripts/lang/fr/__init__.py b/scripts/lang/fr/__init__.py
index a65ff47..d9ab16d 100644
--- a/scripts/lang/fr/__init__.py
+++ b/scripts/lang/fr/__init__.py
@@ -198,15 +198,11 @@
     "admin": "Administration",
     "aéro": "Aéronautique",
     "agri": "Agriculture",
-    "agrumes": "Botanique",
-    "alcaloïdes": "Chimie",
     "analogie": "Par analogie",
     "angl": "Anglicisme",
-    "animaux": "Zoologie",
     "anat": "Anatomie",
     "antiq": "Antiquité",
     "apposition": "En apposition",
-    "arbres": "Botanique",
     "arch": "Archaïsme",
     "archaïque": "Archaïsme",
     "archi": "Architecture",
@@ -215,7 +211,6 @@
     "argot typographes": "Argot des typographes",
     "argot voleurs": "Argot des voleurs",
     "astron": "Astronomie",
-    "atomes": "Chimie",
     "au figuré": "Figuré",
     "audiovi": "Audiovisuel",
     "auto": "Automobile",
@@ -224,48 +219,30 @@
     "BD": "Bande dessinée",
     "BDD": "Bases de données",
     "BE": "Belgique",
-    "bactéries": "Bactériologie",
-    "bateaux": "Navigation",
     "bdd": "Bases de données",
     "bioch": "Biochimie",
     "biol": "Biologie",
     "b-m-cour": "Beaucoup moins courant",
-    "boissons": "Boisson",
     "botan": "Botanique",
     "bot.": "Botanique",
-    "bovins": "Zoologie",
     "CA": "Canada",
     "CH": "Suisse",
     "CI": "Côte d’Ivoire",
-    "canards": "Ornithologie",
-    "caprins": "Zoologie",
     "cartes": "Cartes à jouer",
     "catholicisme": "Christianisme",
-    "champignons": "Mycologie",
-    "chaussures": "Vêtement",
-    "chiens": "Zoologie",
     "chim": "Chimie",
     "chir": "Chirurgie",
     "ciné": "Cinéma",
-    "cnidaires": "Zoologie",
-    "cours d’eau": "Géographie",
     "cuis": "Cuisine",
     "comm": "Commerce",
-    "commerces": "Commerce",
     "composants": "Électronique",
     "compta": "Comptabilité",
     "constr": "Construction",
-    "coquillages": "Coquillage",
     "cour": "Courant",
     "cout": "Couture",
-    "couvre-chefs": "Habillement",
     "cycl": "Cyclisme",
-    "cétacés": "Mammalogie",
-    "danses": "Danse",
     "dermatol": "Dermatologie",
     "didact": "Didactique",
-    "diacritiques": "Grammaire",
-    "dinosaures": "Paléontologie",
     "diplo": "Diplomatie",
     "EU": "Europe",
     "élec": "Électricité",
@@ -282,32 +259,20 @@
     "écolo": "Écologie",
     "écon": "Économie",
     "éduc": "Éducation",
-    "électoraux": "Systèmes électoraux",
-    "éléments": "Chimie",
     "énergie": "Industrie de l’énergie",
     "épithète": "Employé comme épithète",
     "FR": "France",
-    "familles de plantes": "Botanique",
     "ferro": "Chemin de fer",
     "ferroviaire": "Chemin de fer",
     "figure": "Rhétorique",
-    "figures": "Rhétorique",
     "finan": "Finance",
     "finances": "Finance",
     "fonderie": "Métallurgie",
-    "formations musicales": "Musique",
     "formel": "Soutenu",
     "fortification": "Architecture",
-    "fromages": "Fromage",
-    "fruits": "Botanique",
     "gastronomie": "Cuisine",
-    "genres musicaux": "Musique",
-    "gentilés": "Géographie",
     "germ": "Germanisme",
-    "giraffidés": "Zoologie",
-    "grades": "Militaire",
     "graphe": "Théorie des graphes",
-    "gâteaux": "Cuisine",
     "géog": "Géographie",
     "géol": "Géologie",
     "géom": "Géométrie",
@@ -327,27 +292,18 @@
     "indus": "Industrie",
     "info": "Informatique",
     "injur": "Injurieux",
-    "insectes": "Entomologie",
-    "insultes": "Insulte",
     "intrans": "Intransitif",
     "iron": "Ironique",
     "jardi": "Jardinage",
     "juri": "Droit",
     "jurisprudence": "Droit",
     "just": "Justice",
-    "langages": "Informatique",
-    "langues": "Linguistique",
-    "lapins": "Zoologie",
-    "lianes": "Botanique",
     "ling": "Linguistique",
     "litt": "Littéraire",
     "logi": "Logique",
     "légis": "Droit",
-    "légumes": "Botanique",
     "maçon": "Maçonnerie",
     "maladie": "Nosologie",
-    "maladies": "Nosologie",
-    "mammifères": "Zoologie",
     "manège": "Équitation",
     "marque": "Marque commerciale",
     "math": "Mathématiques",
@@ -357,16 +313,8 @@
     "menu": "Menuiserie",
     "mercatique": "Marketing",
     "métrol": "Métrologie",
-    "meubles": "Mobilier",
-    "meubles héraldiques": "Héraldique",
     "mili": "Militaire",
     "minér": "Minéralogie",
-    "minéraux": "Minéralogie",
-    "mollusques": "Malacologie",
-    "montagnes": "Géographie",
-    "monnaies": "Numismatique",
-    "mouches": "Entomologie",
-    "muscles": "Anatomie",
     "musi": "Musique",
     "mythol": "Mythologie",
     "méca": "Mécanique",
@@ -374,7 +322,6 @@
     "métal": "Métallurgie",
     "métaph": "Figuré",
     "métaphore": "Figuré",
-    "métaplasmes": "Linguistique",
     "météo": "Météorologie",
     "météorol": "Météorologie",
     "méton": "Par métonymie",
@@ -382,16 +329,13 @@
     "muscle": "Anatomie",
     "neurol": "Neurologie",
     "nom-coll": "Nom collectif",
-    "nuages": "Météorologie",
     "nucl": "Nucléaire",
     "numis": "Numismatique",
     "néol": "Néologisme",
     "oenol": "Œnologie",
-    "oiseaux": "Ornithologie",
     "opti": "Optique",
     "ornithol": "Ornithologie",
     "ortho1990": "Orthographe rectifiée de 1990",
-    "ovins": "Zoologie",
     "POO": "Programmation orientée objet",
     "p us": "Peu usité",
     "paléogr": "Paléographie",
@@ -401,8 +345,6 @@
     "particulier": "En particulier",
     "pathologie": "Nosologie",
     "pâtes": "Cuisine",
-    "pays": "Géographie",
-    "peupliers": "Botanique",
     "pêch": "Pêche",
     "péj": "Péjoratif",
     "philo": "Philosophie",
@@ -410,17 +352,10 @@
     "phys": "Physique",
     "pl-rare": "Plus rare",
     "plais": "Par plaisanterie",
-    "planètes": "Astronomie",
-    "plantes": "Botanique",
-    "pléonasmes": "Pléonasme",
     "poés": "Poésie",
-    "poissons": "Ichtyologie",
     "polit": "Politique",
-    "pommes": "Botanique",
     "popu": "Populaire",
-    "poules": "Élevage",
     "presse": "Journalisme",
-    "primates": "Zoologie",
     "procédure": "Justice",
     "prog": "Programmation informatique",
     "programmation": "Programmation informatique",
@@ -428,51 +363,33 @@
     "propre": "Sens propre",
     "propriété": "Droit",
     "propulsion": "Propulsion spatiale",
-    "protéines": "Biochimie",
     "prov": "Proverbial",
-    "prunes": "Botanique",
-    "préparations": "Cuisine",
     "psychia": "Psychiatrie",
     "psychol": "Psychologie",
     "QC": "Québec",
     "RDC": "Congo-Kinshasa",
     "RDCongo": "Congo-Kinshasa",
-    "raies": "Ichtyologie",
     "reli": "Religion",
-    "religieux": "Religion",
-    "reptiles": "Herpétologie",
-    "roches": "Pétrographie",
     "régional": "Régionalisme",
     "réseaux": "Réseaux informatiques",
-    "salades": "Cuisine",
-    "salles": "Construction",
-    "saules": "Botanique",
     "sci-fi": "Science-fiction",
     "scol": "Éducation",
     "scolaire": "Éducation",
-    "serpents": "Herpétologie",
     "sexe": "Sexualité",
     "sigle": "Sigle",
-    "singes": "Zoologie",
     "sociol": "Sociologie",
-    "soldats": "Militaire",
     "sout": "Soutenu",
     "spéc": "Spécialement",
-    "sports": "Sport",
     "stat": "Statistiques",
-    "substances": "Chimie",
     "sylv": "Sylviculture",
     "TAAF": "Vocabulaire des TAAF",
     "tech": "Technique",
     "technol": "Technologie",
     "temps": "Chronologie",
     "text": "Textile",
-    "textiles": "Textile",
     "théât": "Théâtre",
     "théol": "Théologie",
-    "thérapies": "Médecine",
     "télécom": "Télécommunications",
-    "tortues": "Zoologie",
     "tr-fam": "Très familier",
     "trans": "Transitif",
     "transit": "Transitif",
@@ -483,13 +400,9 @@
     "télé": "Audiovisuel",
     "US": "États-Unis",
     "USA": "États-Unis",
-    "unités": "Métrologie",
-    "usines": "Industrie",
-    "vents": "Météorologie",
     "vieux": "Vieilli",
     "vélo": "Cyclisme",
     "vête": "Habillement",
-    "vêtements": "Habillement",
     "zool": "Zoologie",
     "zootechnie": "Zoologie",
 }

@lasconic lasconic force-pushed the add-domain-templates branch from a133c4f to 5cae397 Compare November 9, 2020 10:14
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 9, 2020

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.14%.

Quality metrics Before After Change
Complexity 25.20 😞 25.20 😞 0.00
Method Length 466.60 ⛔ 434.60 ⛔ -32.00 👍
Working memory 164.00 ⛔ 143.60 ⛔ -20.40 👍
Quality 42.86% 😞 42.72% 😞 -0.14% 👎
Other metrics Before After Change
Lines 1387 1307 -80
Changed files Quality Before Quality After Quality Change
scripts/lang/fr/init.py 45.21% 😞 45.22% 😞 0.01% 👍
tests/test_fr.py 39.35% 😞 38.98% 😞 -0.37% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
scripts/lang/fr/init.py last_template_handler 126 ⛔ 802 ⛔ 24 ⛔ 2.30% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
tests/test_fr.py test_parse_word 0 ⭐ 346 ⛔ 186 ⛔ 35.57% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/test_fr.py test_clean_template 0 ⭐ 195 😞 117 ⛔ 42.39% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Retrieve all italic templates
2 participants