You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the language detection example in the README is no longer working in current main version.
Using simplemma==0.9.1 it works as advertised (although the returned ratios are a bit different from those in the README):
>>> from simplemma import in_target_language, lang_detector
>>> lang_detector('"Exoplaneta, též extrasolární planeta, je planeta obíhající kolem jiné hvězdy než kolem Slunce."', lang=("cs", "sk"))
[('cs', 0.8), ('unk', 0.19999999999999996), ('sk', 0.1)]
But with current main version the import of simplemma.lang_detector is not working:
>>> from simplemma import in_target_language, lang_detector
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'lang_detector' from 'simplemma'
It works if I change lang_detector to langdetect:
>>> from simplemma import in_target_language, langdetect
>>> langdetect('"Exoplaneta, též extrasolární planeta, je planeta obíhající kolem jiné hvězdy než kolem Slunce."', lang=("cs", "sk"))
[('cs', 0.75), ('sk', 0.125), ('unk', 0.25)]
Should the documentation be fixed to correspond with the current naming in the code, or the function langdetect renamed back to lang_detector so the API remains stable?
The text was updated successfully, but these errors were encountered:
I guess we can use an alias an import it during init. This was a question we discussed with @juanjoDiaz but something must have got lost around the way.
I noticed that the language detection example in the README is no longer working in current
main
version.Using simplemma==0.9.1 it works as advertised (although the returned ratios are a bit different from those in the README):
But with current
main
version the import ofsimplemma.lang_detector
is not working:It works if I change
lang_detector
tolangdetect
:Should the documentation be fixed to correspond with the current naming in the code, or the function
langdetect
renamed back tolang_detector
so the API remains stable?The text was updated successfully, but these errors were encountered: