Menu

Word not in dictionary

Help
Jake Nix
2012-08-09
2012-09-22
  • Jake Nix

    Jake Nix - 2012-08-09

    I'm creating a language model file with bin/x86-linux/pronounce from the trunk
    of Logios. In the logs it says:

    KERRANG - By LtoS rules
    

    All other words say 'Main '.

    When running my program it complains that the word "kerrang" is not in the
    dictionary, however the generated .dic file contains:

    KERRANG K EH R AH NG
    

    Am I doing something wrong?

     
  • bic-user

    bic-user - 2012-08-09

    can you provide language model and dictionary that you are trying to use in
    your program?

     
  • Jake Nix

    Jake Nix - 2012-08-09

    I've just fixed this; I changed the word kerrang to uppercase in my grammar
    file and it is recognized by pocketsphinx now.

    I'm not sure why, but normal words like "goodbye" only work if they are in
    upper case in my grammar; the new word "kerrang" only works if it's upper
    case.

    Here is my .dic:

    VOLUME UP   V AA L Y UW M AH P
    VOLUME DOWN V AA L Y UW M D AW N
    VOLUME MUTE V AA L Y UW M M Y UW T
    RADIO ON    R EY D IY OW AA N
    RADIO OFF   R EY D IY OW AO F
    STATION S T EY SH AH N
    GOODBYE G UH D B AY
    CANCEL  K AE N S AH L
    STATION LIST    S T EY SH AH N L IH S T
    RADIO LANCASHIRE    R EY D IY OW L AE NG K AH SH AY R
    THE BAY DH AH B EY
    PLANET ROCK P L AE N AH T R AA K
    RADIO TWO   R EY D IY OW T UW
    JAZZ F M    JH AE Z EH F EH M
    BASS DRIVE  B AE S D R AY V
    BREAK BEAT  B R EY K B IY T
    KERRANG K EH R AH NG
    

    LM: http://pastebin.com/NAg1rYPN

    Grammar:

    #JSGF V1.0;
    
    grammar radio;
    
    public <command> = ( <list> | <greeting> | <response> | <station> | <volume> );
    
    <list> = ( station list );
    <greeting> = ( hello | goodbye | cancel );
    <response> =  ( yes | yeah | no | nope | o k );
    <station> =  ( the bay | radio two | jazz f m | planet rock | radio lancashire | bass drive | break beat | KERRANG );
    <volume> = volume ( up | down | mute );
    
     
  • Jake Nix

    Jake Nix - 2012-08-09

    Sorry, I meant: normal words like "goodbye" only work if they are in lower
    case in my grammar;

     
  • Jake Nix

    Jake Nix - 2012-08-09

    This is now solved by adding any unknown words pronunciations to

    /usr/share/pocketsphinx/model/lm/en_US/cmu07a.dic
    

    with the word in lower case and pronunciation in caps.

    What I don't understand is that even though I pass my own generated .dic file
    to my program (modified pocketsphinx_continous); it ignores the dictionary and
    uses the default /usr/share/pocketsphinx/model/lm/en_US/cmu07a.dic

    Can someone explain this behaviour? I'm confused.

    I would like my program to be able to dynamically add new words (radio
    stations), then write a script to add these automatically. But at this stage
    it'll be difficult as I would need to check if the words was previously
    unknown, then add it to the global .dic - but this defeats the object of
    specifying your own dictionary file....

    Any advice would be greatly appreciated!

    Thanks!

     
  • Nickolay V. Shmyrev

    What I don't understand is that even though I pass my own generated .dic
    file to my program (modified pocketsphinx_continous); it ignores the
    dictionary and uses the default
    /usr/share/pocketsphinx/model/lm/en_US/cmu07a.dic Can someone explain this
    behaviour?

    It's easy to explain. Your modifications were not correct, you had to modify
    some other place.

    I'm confused. I would like my program to be able to dynamically add new
    words (radio stations), then write a script to add these automatically. But at
    this stage it'll be difficult as I would need to check if the words was
    previously unknown, then add it to the global .dic - but this defeats the
    object of specifying your own dictionary file....

    You can use ps_add_word function to add the words to the dictionary. There is
    no need to modify the global one.

    In case you still decide to modify the global dictionary, you need to do it
    properly

    I'm creating a language model file with bin/x86-linux/pronounce from the
    trunk of Logios. In the logs it says:

    New g2p support has just been committed to Sphinxtrain trunk. You might want
    to try to use it instead of pronounce.

     
  • Jake Nix

    Jake Nix - 2012-08-10

    Thanks for your reply :)

     

Log in to post a comment.