BoboTiG / ebook-reader-dict

Finally decent dictionaries based on the Wiktionary for your beloved eBook reader. Daily updates & 14 languages supported so far.
http://www.tiger-222.fr/?d=2020/04/17/22/14/21-un-dictionnaire-alternatif-et-complet-pour-votre-liseuse
MIT License
418 stars 24 forks source link

Update __init__.py #2254

Closed chopinesque closed 2 weeks ago

chopinesque commented 2 weeks ago

support more templates

Question: I want the following snippet to be amended so as not to add parenthesis in the expanded templates.

    if text := {
        "αθ": "αρσενικό ή θηλυκό",
        "ταυτ": "ταυτόσημα",
        "αναδρομικός": "αναδρομικός σχηματισμός",
        "κρητ αρχ": "κρητικός τύπος",
        "λατ": "λατινικά",
        "υστερο la": "υστερολατινική",
        "αντιδάνειο": "αντιδάνειο",
        "χρειάζεται": "χρειάζεται",
        "συνων": "συνώνυμα",
        "συνών": "συνώνυμα",
        "ποιητ": "ποιητικός τύπος",
    }.get(tpl, ""):
        return text if data["0"] else term(text)
BoboTiG commented 2 weeks ago

Parenthesis are added by the term() function. If you want only italic, you can call italic(). Have a look at functions into the user_functionS.py file ;)

chopinesque commented 2 weeks ago

Great! Feel free to amend and merge.