optimaize/language-detector

Not able to choose certain languages to include

Closed this issue · 1 comments

I am working on a project that needs to detect the language of short texts, but they will only ever be Tagalog or English. I wanted to remove all the other language profiles to increase the accuracy of the detection, but am having trouble doing so. When I just removed the files for the other profiles, it says that they're missing - is there a hard coded list somewhere?

How is the best way to go about doing this?

(I used to use the shuyo library, and was able to very easily just delete the other language profiles, but it doesn't seem to work the same way with this library?)

Instead of:

//load all languages:
List<LanguageProfile> languageProfiles = new LanguageProfileReader().readAllBuiltIn();

There are other methods: readBuiltIn(LdLocale.fromString("en") and others.