SAIR
SAIR

Reputation: 1131

How to determine text's language using Android Mobile Vision Api

I am using mobile vision API and successfully able to detect text in all supported languages.

Now I want to determine the langue of detected text i.e if its English, French etc. I have explored the API documentation but I am not able to find any method to get that. I am following this sample and I have gone through the API Documentation

Is there a workaround to achieve that

Upvotes: 0

Views: 2245

Answers (2)

Piotr Prus
Piotr Prus

Reputation: 355

I got the same problem. I found this method in documentation:

line.getLanguage();

but this method is returning empty string. Maybe you will have more lack. Link to docs: https://developers.google.com/android/reference/com/google/android/gms/vision/text/Line.html#getLanguage()

Update 02.11.2018

I spoke with some firebasers at Firebase Summit and i got info that language feature now works for cloud text recognition, but it is unavailable for Mobile Vision :(

Upvotes: 2

Ying Li
Ying Li

Reputation: 2519

You can use the getLanguage method on the entire returned TextBlock, this should work.

Upvotes: 0

Related Questions