Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Basic usage example inaccurate? #51

Closed
jmcnab57 opened this issue Nov 7, 2018 · 1 comment
Closed

Basic usage example inaccurate? #51

jmcnab57 opened this issue Nov 7, 2018 · 1 comment

Comments

@jmcnab57
Copy link

jmcnab57 commented Nov 7, 2018

Running a fresh installation via pip install pocketsphinx and copy pasting the basic usage example to make sure all is good. I noticed that the \site-packages\pocketsphinx folder does not contain a test\data as would be implied from the DATADIR = "pocketsphinx/test/data" in the basic usage example. As a result the code will run error out at stream = open(path.join(DATADIR, 'goforward.raw'), 'rb').

Perhaps the example should be updated to properly reflect the current instillation? Not sure if this repository is still being actively developed/used.

@slowrunner
Copy link

slowrunner commented Jun 17, 2019

This change allowed me to run the example.py:

# MODELDIR = "pocketsphinx/model"
MODELDIR = "/usr/local/lib/python3.5/dist-packages/pocketsphinx/model"
# DATADIR = "pocketsphinx/test/data"
DATADIR = "/usr/local/lib/python3.5/dist-packages/pocketsphinx/data"

# Create a decoder with certain model
config = Decoder.default_config()
# config.set_string('-hmm', path.join(MODELDIR, 'en-us/en-us'))
config.set_string('-hmm', path.join(MODELDIR, 'en-us'))
# config.set_string('-lm', path.join(MODELDIR, 'en-us/en-us.lm.bin'))
config.set_string('-lm', path.join(MODELDIR, 'en-us.lm.bin'))
# config.set_string('-dict', path.join(MODELDIR, 'en-us/cmudict-en-us.dict'))
config.set_string('-dict', path.join(MODELDIR, 'cmudict-en-us.dict'))

@nshmyrev nshmyrev closed this as completed Oct 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants