Search code examples
androidgoogle-apispeech-recognitionspeech-to-textgoogle-speech-api

English US language code changed? Google Speech Api v2 not returning the correct result


Just noticed the English US words no longer display the correct spelling. This previously was ok - now it displays the English UK spelling. Below is a list of some words that I found .For example if I say center and set the language code as en-US I am getting the result as centre which is English UK.

I am using Google api v2

https://www.google.com/speech-api/v2/recognize?output=json&lang=en-US&key=my_key"

WORDS ENDING IN –RE

British English words that end in -re often end in -er in American English:

British and US

centre          center 

fibre           fiber 

litre           liter 

theatre         theater or theatre 

Even though I am giving the language code as en-US the result returned will be in British English.Is this a common issue or US English code is no longer working. Any help will be appreciated.

Edit

I just noticed this issue is with ok google also Even though my input is in English us ,the answers I am getting is in English Uk.These are some other words

Words ending in -our

British English words ending in -our usually end in -or in American English:

British and US

colour        color

flavour       flavor

humour        humor

labour        labor

neighbour     neighbor

Verbs in British English that can be spelled with either -ize or -ise at the end are always spelled with -ize at the end in American English:

British and US

apologize or apologise      apologize

organize or organise        organize

recognize or recognise      recognize

Words ending in -yse

Verbs in British English that end in -yse are always spelled -yze in American English:

British and US

analyse              analyze

breathalyse          breathalyze

paralyse             paralyze

Solution

  • I finally found a solution for it.I know most of the people don't just care if the result is in English UK or English US.But the problem was my app is a spelling app .So showing English UK words for English US language was a big problem for me.And the solution is really simple just get rid off Locale when English US is selected,ie replace en-US to en and your speech recognizing url looks like this https://www.google.com/speech-api/v2/recognize?output=json&lang=en&key=my_key. And use the locale for all other languages like en-GB for uk English.

    Edit

    Change url to

    https://www.google.com/speech-api/v2/recognize?output=json&lang=0000&key=my_key .

    Hoping this lasts longer.