LanguageDetector needs at least 2 languages to choose from Error #170
Replies: 2 comments
-
I am not the author of the library, but I think I can answer this question. |
Beta Was this translation helpful? Give feedback.
-
@serega is right. Lingua needs to load at least two language models so that it can compare the ngram probabilities of those two languages in order to choose the most likely language. There is no absolute confidence metric yet which can tell you whether some text is English or not without looking at other languages for comparison. I will try to work on such a feature but that's pretty tough to implement. |
Beta Was this translation helpful? Give feedback.
-
Hi, I copied the sample code into my project and deleted all the languages except english:
My use case is that I am building a game like wordle, and I want some function that I can pass an arbitrary string into and have the function return a bool whether the string is a valid english word or not...
Is there a reason this is not supported by lingua-rs? Or am is there some other function I could be calling to efficiently accomplish this? thanks!
PS. here is the full error I see when running it:
Beta Was this translation helpful? Give feedback.
All reactions