sloria / TextBlob

Simple, Pythonic, text processing--Sentiment analysis, part-of-speech tagging, noun phrase extraction, translation, and more.
https://textblob.readthedocs.io/
MIT License
9.13k stars 1.15k forks source link

Is there a simple way to list all latin language codes ? #342

Open journeytosilius opened 4 years ago

journeytosilius commented 4 years ago

I am writing a script that needs to use one font or another depending on the language detected.

What I want to do is simple : If not Latin, use the NOTO font. Can I do this quick via some method ?

Alternatively, can I list all latin languages defined in TextBlob so I can say if not in list of lang codes, use NOTO ?

Thanks

jenstroeger commented 3 years ago

@chromafunk, take a look at Babel, and at the Unicode character ranges used by your text to map them to the language’s script (see this character code chart).