简体   繁体   中英

How to spell word to google assistant before sending it to dialogflow

Don't know if it's the good place to ask that question but i'm making my own action for google assistant. Users need to spell some word with letters and numbers (like RJ34343KR). In dialogflow side, all is okay, i defined a regexp entity and it seems working when i use keyboard to ask question to my assistant.

But when i speak, google assistant is not able to understand that I spell letter. No problem for numbers. I try to spell: "RU304304" and it gives: "Are you 3 0 4 3 0 4".

Don't know if it matters but my assistant language is french (i give you an example in english for better understanding)

I do not find anything in the doc. Except that link

Anyone can help me on this?

Thanks !

MC

Edit after the Google assistant support reply:

Here is the answer from Google:

For speech recognition in Google Assistant, it can only transcribed words or phrases that are language supported. It appears that "RU304304" input is not a word so it recognized "RU" as "are you". What you can do is to implement suggestion chips for this response or type the code in keyboard. For more information about suggestion chip, please check this documentation.

So it seems pretty clear, no way to spell letters to google home. It's like a big limitation is it?

I've encountered this problem aswell in an older project when I used a sys.any entity to look for a product code in user input. The work around that I used was change certain words that Google changed to words back to characters or symbols.

function customReplace(serial) {
      let converted = serial.replace("are", "R");
      converted = converted.replace("bee", "B");
      converted = converted.replace("for", "4");
      converted = converted.replace("slash", "/");
      return converted;
    }

I do recommend to only use this in the handler where you want the product codes, because this code will change other input such as "That was for bob too" into "That was 4 bob 2" and that might mess with your responses.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM