#25
How to retrieve the CommandLn from Config
Hi,
I'm trying to get the command line from a config as in the code below:
cfg := sphinx.NewConfig(
sphinx.HMMDirOption("/usr/local/share/pocketsphinx/model/en-us/en-us"),
sphinx.DictFileOption("test/art_db.phone"),
sphinx.LMFileOption("/usr/local/share/pocketsphinx/model/en-us/en-us.lm.bin"),
)
fmt.Println("cfg =", cfg)
cmdLn := cfg.CommandLn()
fmt.Println("cmdLn =", cmdLn)which produces:
cfg = &{map[-dict:test/art_db.phone -hmm:/usr/local/share/pocketsphinx/model/en-us/en-us -lm:/usr/local/share/pocketsphinx/model/en-us/en-us.lm.bin] <nil>}
cmdLn = &{}It looks like the configuration options are there but the call to CommandLn comes up empty. I guess I must be missing something here so how should I get the command line?
The reason I want the command line is because I'd like to call DefaultSearchArgs to get the -hmm and -lm settings rather than doing it explicitly as I've shown here, and that call expects a []CommandLn parameter
Any help would be welcome. Thanks...
Activity
2Thanks for getting back promptly. Not sure what you mean though, .Deref() on what object, Config, CommandLn? As far as I can see .Deref() is defined on Arg, FsgLink and JSGFRuleIter.
Try calling
.Deref()on the object