pemistahl / lingua

The most accurate natural language detection library for Java and the JVM, suitable for long and short text alike
Apache License 2.0
689 stars 61 forks source link

Getting language name #211

Closed hasandiwan closed 4 months ago

hasandiwan commented 4 months ago

String text = "hello world"; LanguageDetector detector = LanguageDetectorBuilder.fromAllLanguages().build(); Language language = detector.detectLanguage(text);

Now how do I get "English" from the language object? language.toString() doesn't work, nor does language.name().

pemistahl commented 4 months ago

You mean you want "English" but not "ENGLISH"? This is currently not supported. You will have to write this logic yourself.

hasandiwan commented 4 months ago

You mean you want "English" but not "ENGLISH"?

I'll settle for "ENGLISH", but not "null", mate.

-- OpenPGP: https://hasan.d8u.us/openpgp.asc If you wish to request my time, please do so using bit.ly/hd1AppointmentRequest http://bit.ly/hd1AppointmentRequest. Si vous voudriez faire connnaisance, allez a bit.ly/hd1AppointmentRequest http://bit.ly/hd1AppointmentRequest.

https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1Sent from my mobile device Envoye de mon portable