Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

[Android&iOS] Support language problem fix #33

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

UnRyongPark
Copy link

Nice to find your great plug-in.
If you are not satisfied with the code that I modified, please request modification:)

I tested it on my cell phone using your plug-in and found that no input other than Korean and English was returned normally.

After debugging the code, After changing the parameter to String, it was confirmed to be working properly.
(SpeechRecognitionPlugin.java:67-68)

Once you've seen it working properly in the example app, I wonder why you've added Locale. Did I use it wrong?

@UnRyongPark
Copy link
Author

+@
I tested iOS version.

It was confirmed that only a few languages were hard-coded to support.

So, other than the four languages that were declared directly, i immediately created and changed them to deliver.
(SwiftSpeechRecognitionPlugin.swift:175)

@UnRyongPark UnRyongPark changed the title [Android] Always return local language or English problem fixed [Android&iOS] Support language problem fix Apr 2, 2019
@UnRyongPark
Copy link
Author

@rxlabz
Feedback please. :)
I am not good at English, so I don't know if I explained it correctly.

@vintage
Copy link

vintage commented May 6, 2019

Hey @UnRyongPark - thanks for PR. Could you describe a bit more on what's been fixed and how to reproduce issue on current master branch? I've been using the plugin for speech recognition for Polish language and it works like a charm - no issue detected. You mentioned that only Korean and English works normally for you?

@UnRyongPark
Copy link
Author

UnRyongPark commented May 6, 2019

@vintage Hello :D
Thanks your comment!

that is two problem.

  1. android
    um.. this is i want feedback, I'm not a client programmer, so I do not know if I did it wrong, but the Locale setting did not work properly and I did not recognize the language I wanted.

  2. ios
    hardcoding in speech target langs(speech_recognition/ios/Classes/SwiftSpeechRecognitionPlugin.swift, line 13~17).
    maybe you are try English, French, Russian, Italian, and Spanish work normally, but no sets for other languages are declared.
    (like korean, japanese or non-english speaking culture in general)

  • added: i changed only one line(line 175, switch default: return franch => return new SFSpeechRecognizer with locale)

@vintage
Copy link

vintage commented May 7, 2019

I didn't yet tested the speech recognition on iOS in my app - will do that probably later this month, so will back on this one a bit later on if that's a not a problem :)

As for Android to detect Polish language I've used following code:

_speech = SpeechRecognition();
_speech.setRecognitionResultHandler((String text) {
      print("Recognized text is $text");
});
_speech.setRecognitionCompleteHandler((_) {
      Future.delayed(Duration(seconds: 1)).then((_) {
        _speech.listen(locale: 'pl_PL');
      });
});
_speech.listen(locale: 'pl_PL');

And it properly detects the language and accent. Can you provide what locale did you pass to the listen function.

@UnRyongPark
Copy link
Author

@vintage oh! cool!
i will try your solution.
If it works, I'll remove the commit and its contents.
Thank you: D

ps. A little worrisome is to split the locale code and use only two.(SpeechRecognitionPlugin.java, line 91~92)
Some languages use three parameters.

@ngoan98tv
Copy link

Thanks for your contribution @UnRyongPark
I just test this package with Vietnamese while my device in English, by switching these two languages several times I realize this package using device language instead of the language I set in listen() method. But @UnRyongPark fixed it.
@rxlabz, hope you can merge this PR soon to improve the package.

@UnRyongPark
Copy link
Author

@vintage
Sorry for the late response.
I've been busy and haven't tested it yet.
i will test and feedback by November.

@ngoan98tv Thanks :D I think there's a better way. I will be updating the PR further in the near future.

@kevincmanning
Copy link

Any chance of this being merged soon? I want to use Japanese and there aren't many options for plugins. If this won't be merged, I'll need to do a custom build for myself soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants