Reputation: 284
TextClassificationManager
is available from API-26
. Its public methods available for classify text .
My requirement is i need to detect language from a giver Text offline.
TextClassificationManager
also have detectLanguages()
method but its hidden.
Can i Use TextClassificationManager
to detect language ?
I have searched a bit and i Found This Project Using TextClassificationManager
by Reflection. But it throws NoSuchMethodErrror
and Returns ..
So if anyone Used TextClassificationManager
for this purpose can help me .
Upvotes: 0
Views: 318
Reputation: 2167
It's a bad decision to use hidden functions via reflection. You can never know if the function will be there and available so you have to prepare a fallback mechanism.
For Android SDK 26-27 You can try and use this Android lib project - https://github.com/rmtheis/language-detection but be aware that it's no longer maintained so use it for your own research but it's probably not a good idea to use it for production or apps released in Google Play.
Upvotes: 1