You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for a great work.
Bump into an issue with NPE.
Checked a problem with Unit Test:
importcom.github.pemistahl.lingua.api.{Language, LanguageDetectorBuilder}
importorg.scalatest._classLanguageDetectTestextendsFlatSpecwithMatchers {
vallanguageDetector=LanguageDetectorBuilder.
fromLanguages(Language.ENGLISH,Language.GERMAN,Language.FRENCH).
build()
"A language detector" should "detect simple text" in {
(languageDetector.detectLanguageOf("Hello").getIsoCode) should be("en")
}
it should "work without exception for weird texts and chars" in {
noException shouldBe thrownBy {
languageDetector.detectLanguageOf("""\_(ツ)_/¯""")
}
}
}
languageDetector.detectLanguageOf("""\_(ツ)_/¯""") - this is where NPE is occured.
This is a real text from user, actually :)
Callstack:
Caused by: kotlin.KotlinNullPointerException
at com.github.pemistahl.lingua.api.LanguageDetector.getMostLikelyLanguage(LanguageDetector.kt:571)
at com.github.pemistahl.lingua.api.LanguageDetector.detectLanguageOf(LanguageDetector.kt:88)
Thanks
The text was updated successfully, but these errors were encountered:
Hi @abdmob, thank you for using my library and filing this bug report. I appreciate this a lot. 👍
You have found a serious bug, actually. Good catch! The NullPointerException is only thrown in those cases where the input string solely consists of letters that are unknown in any of the supported languages. I have just fixed this in release 0.3.2 with the commit 524e3eb. So please update.
I hope you still enjoy using my library. If you find any more issues, please do not hesitate to report them as well. Thank you and have a nice day.
Thanks for a great work.
Bump into an issue with NPE.
Checked a problem with Unit Test:
languageDetector.detectLanguageOf("""\_(ツ)_/¯""")
- this is where NPE is occured.This is a real text from user, actually :)
Callstack:
Thanks
The text was updated successfully, but these errors were encountered: