Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\p{IsLatin} is used and does not work on Android #3

Closed
arnt opened this issue Mar 21, 2019 · 3 comments
Closed

\p{IsLatin} is used and does not work on Android #3

arnt opened this issue Mar 21, 2019 · 3 comments
Assignees
Labels
Android issues occurring on Android systems bug Something isn't working

Comments

@arnt
Copy link

arnt commented Mar 21, 2019

LanguageDetector.kt line 412 uses \p{IsLatin}, which definitely ought to work on Android, but doesn't. Using \p{Latin} works, so I suggest you do that. The next two lines probably have the same issue.

Looks great BTW, and I love that you included Latin already.

@pemistahl
Copy link
Owner

Hello @arnt, thank you for using my library and letting me know about this problem.

I'm going to fix this bug in the upcoming release 0.4.0. I still need some time to finish it but it won't take long anymore.

@pemistahl pemistahl self-assigned this Mar 22, 2019
@pemistahl pemistahl added bug Something isn't working Android issues occurring on Android systems labels Mar 22, 2019
@pemistahl
Copy link
Owner

I've just fixed this problem with commit fd52216.

Interestingly enough, I get a PatternSyntaxException on my developer machine with the standard JDK 8 using the character classes without the "Is-" prefix. Anyway, now both notation variants are tried in order, so one of them ought to work.

I will close this issue once release 0.4.0 is completed.

Thanks again for your contribution. Very much appreciated.

@arnt
Copy link
Author

arnt commented Mar 22, 2019

That was quick!

I looked more thoroughly at the documentation, and it seems that the misunderstanding in the SO question is that "latin" isn't actually a unicode category. One might easily think so, but it's not. Sigh. IMO both the Java documentation and the Android implementation could do with some improvement.

Anyway. Such is life. Thanks for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android issues occurring on Android systems bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants