-
Notifications
You must be signed in to change notification settings - Fork 65
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
IllegalStateException thrown for unusual case #24
Comments
You can hack the API by passing same language twice: |
Thanks @krzysztofpcy, that's a great workaround for now. I still think this issue should be resolved in an upcoming version. |
It never ceases to amaze me how creative people become to widen a tool's use cases which were never intended to be supported. :-)
If you just want to determine whether some text is English or not and you cannot reliably exclude any other language in your data set, then please use In any case, I will change the api so that an exception is thrown whenever |
Thanks for your response and advice with my use case - much appreciated. I know you've already tagged it for the next release, but the confidence scoring issue would be really useful to me too as it would allow me to avoid the overhead of including all other languages so I look forward to it. |
I'm able to configure the
LanguageDetector
as follows:When trying to compute the probabilities of the languages for the content
그 가격으로는 최상
, the following exception is thrown:This exception is not thrown for other clearly non-English content (e.g.
여보세요
), although changing fromLanguage.UNKNOWN
toLanguage.GERMAN
solves this issue.If
Language.UNKNOWN
is not meant to be included in thefromLanguages
collection, a suitable exception should be thrown to indicate this.As a side note, my use case for including
Language.ENGLISH
andLanguage.UNKNOWN
is that, for my use case, I only care to know whether or not the language is English so would prefer to maintain the ability to includeLanguage.UNKNOWN
.The text was updated successfully, but these errors were encountered: