How to see if word exists in Pocketsphinx dictionary?

前端 未结 3 1922
醉酒成梦
醉酒成梦 2021-01-22 18:40

I simply want to see if a string exists in a dictionary file. (Dictionary file at bottom of question)

I want to check if the voice recognizer can recogn

3条回答
  •  没有蜡笔的小新
    2021-01-22 19:04

    You could load the dictionary to a arraylist by reading it line by line and to get only the words do

    arraylist.add(line.split("\\s+")[0]);

    And then check if it exist by

    if(arraylist.contains(word))

提交回复
热议问题