Skip to content

LookupWord always returns an empty string #16

@agorman

Description

@agorman

Maybe I'm just doing something wrong. I've confirmed the word is in the dictionary and included my code. I can process data and get a hypothesis so things seem to be working well.

# cat /usr/local/share/pocketsphinx/model/en-us/cmudict-en-us.dict |grep hello
hello HH AH L OW
hello(2) HH EH L OW
othello AH TH EH L OW
cfg := sphinx.NewConfig(
    sphinx.HMMDirOption("/usr/local/share/pocketsphinx/model/en-us/en-us"),
    sphinx.DictFileOption("/usr/local/share/pocketsphinx/model/en-us/cmudict-en-us.dict"),
    sphinx.LMFileOption("/usr/local/share/pocketsphinx/model/en-us/en-us.lm.bin"),
)

dec, err := sphinx.NewDecoder(cfg)
if err != nil {
    panic(err)
}
defer dec.Destroy()

w, ok := dec.LookupWord("hello")
if ok {
    fmt.Println(w)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions