Package pocketsphinx :: Module pocketsphinx :: Class Decoder
[hide private]
[frames] | no frames]

Class Decoder

source code

object --+
         |
        Decoder

Proxy of C Decoder struct

Instance Methods [hide private]
 
__setattr__(self, name, value)
x.__setattr__('name', value) <==> x.name = value
source code
 
__getattr__(self, name) source code
 
__repr__(self)
repr(x)
source code
 
__init__(self, *args)
__init__(Decoder self) -> Decoder __init__(Decoder self, Config config) -> Decoder
source code
 
__swig_destroy__(...)
delete_Decoder(Decoder self)
 
__del__(self) source code
 
reinit(self, config)
reinit(Decoder self, Config config)
source code
 
load_dict(self, fdict, ffilter, format)
load_dict(Decoder self, char const * fdict, char const * ffilter, char const * format)
source code
 
save_dict(self, dictfile, format)
save_dict(Decoder self, char const * dictfile, char const * format)
source code
 
add_word(self, word, phones, update)
add_word(Decoder self, char const * word, char const * phones, int update)
source code
 
lookup_word(self, word)
lookup_word(Decoder self, char const * word) -> char *
source code
 
get_lattice(self)
get_lattice(Decoder self) -> Lattice
source code
 
get_config(self)
get_config(Decoder self) -> Config
source code
 
start_stream(self)
start_stream(Decoder self)
source code
 
start_utt(self)
start_utt(Decoder self)
source code
 
end_utt(self)
end_utt(Decoder self)
source code
 
process_raw(self, SDATA, no_search, full_utt)
process_raw(Decoder self, char const * SDATA, bool no_search, bool full_utt) -> int
source code
 
process_cep(self, SDATA, no_search, full_utt)
process_cep(Decoder self, char const * SDATA, bool no_search, bool full_utt) -> int
source code
 
hyp(self)
hyp(Decoder self) -> Hypothesis
source code
 
get_fe(self)
get_fe(Decoder self) -> FrontEnd
source code
 
get_feat(self)
get_feat(Decoder self) -> Feature
source code
 
get_in_speech(self)
get_in_speech(Decoder self) -> bool
source code
 
get_fsg(self, name)
get_fsg(Decoder self, char const * name) -> FsgModel
source code
 
set_fsg(self, name, fsg)
set_fsg(Decoder self, char const * name, FsgModel fsg)
source code
 
set_jsgf_file(self, name, path)
set_jsgf_file(Decoder self, char const * name, char const * path)
source code
 
set_jsgf_string(self, name, jsgf_string)
set_jsgf_string(Decoder self, char const * name, char const * jsgf_string)
source code
 
get_kws(self, name)
get_kws(Decoder self, char const * name) -> char const *
source code
 
set_kws(self, name, keyfile)
set_kws(Decoder self, char const * name, char const * keyfile)
source code
 
set_keyphrase(self, name, keyphrase)
set_keyphrase(Decoder self, char const * name, char const * keyphrase)
source code
 
set_allphone_file(self, name, lmfile)
set_allphone_file(Decoder self, char const * name, char const * lmfile)
source code
 
get_lm(self, name)
get_lm(Decoder self, char const * name) -> NGramModel
source code
 
set_lm(self, name, lm)
set_lm(Decoder self, char const * name, NGramModel lm)
source code
 
set_lm_file(self, name, path)
set_lm_file(Decoder self, char const * name, char const * path)
source code
 
get_logmath(self)
get_logmath(Decoder self) -> LogMath
source code
 
set_search(self, search_name)
set_search(Decoder self, char const * search_name)
source code
 
unset_search(self, search_name)
unset_search(Decoder self, char const * search_name)
source code
 
get_search(self)
get_search(Decoder self) -> char const *
source code
 
n_frames(self)
n_frames(Decoder self) -> int
source code
 
seg(self)
seg(Decoder self) -> SegmentList
source code
 
nbest(self)
nbest(Decoder self) -> NBestList
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
Config
default_config() source code
 
file_config(path)
file_config(char const * path) -> Config
source code
Class Variables [hide private]
  __swig_setmethods__ = {}
  __swig_getmethods__ = {}
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__setattr__(self, name, value)

source code 

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__init__(self, *args)
(Constructor)

source code 

__init__(Decoder self) -> Decoder __init__(Decoder self, Config config) -> Decoder

Overrides: object.__init__

get_fsg(self, name)

source code 

get_fsg(Decoder self, char const * name) -> FsgModel

Get the finite-state grammar set object for this decoder.

If FSG decoding is not enabled, this returns NULL. Call ps_set_fsgset() to enable it.

The current FSG set object for this decoder, or NULL if none is available.

set_fsg(self, name, fsg)

source code 

set_fsg(Decoder self, char const * name, FsgModel fsg)

Adds new search based on finite state grammar.

Associates FSG search with the provided name. The search can be activated using ps_set_search().

See: ps_set_search

set_jsgf_file(self, name, path)

source code 

set_jsgf_file(Decoder self, char const * name, char const * path)

Adds new search using JSGF model.

Convenient method to load JSGF model and create a search.

See: ps_set_fsg

set_jsgf_string(self, name, jsgf_string)

source code 

set_jsgf_string(Decoder self, char const * name, char const * jsgf_string)

Adds new search using JSGF model.

Convenience method to parse JSGF model from string and create a search.

See: ps_set_fsg

get_kws(self, name)

source code 

get_kws(Decoder self, char const * name) -> char const *

Get the current Key phrase to spot.

If KWS is not enabled, this returns NULL. Call ps_update_kws() to enable it.

The current keyphrase to spot

set_kws(self, name, keyfile)

source code 

set_kws(Decoder self, char const * name, char const * keyfile)

Adds keyphrases from a file to spotting.

Associates KWS search with the provided name. The search can be activated using ps_set_search().

See: ps_set_search

set_keyphrase(self, name, keyphrase)

source code 

set_keyphrase(Decoder self, char const * name, char const * keyphrase)

Adds new keyphrase to spot.

Associates KWS search with the provided name. The search can be activated using ps_set_search().

See: ps_set_search

set_allphone_file(self, name, lmfile)

source code 

set_allphone_file(Decoder self, char const * name, char const * lmfile)

Adds new search based on phone N-gram language model.

Convenient method to load N-gram model and create a search.

See: ps_set_allphone

get_lm(self, name)

source code 

get_lm(Decoder self, char const * name) -> NGramModel

Get the language model set object for this decoder.

If N-Gram decoding is not enabled, this will return NULL. You will need to enable it using ps_set_lmset().

The language model set object for this decoder. The decoder retains ownership of this pointer, so you should not attempt to free it manually. Use ngram_model_retain() if you wish to reuse it elsewhere.

set_lm(self, name, lm)

source code 

set_lm(Decoder self, char const * name, NGramModel lm)

Adds new search based on N-gram language model.

Associates N-gram search with the provided name. The search can be activated using ps_set_search().

See: ps_set_search.

set_lm_file(self, name, path)

source code 

set_lm_file(Decoder self, char const * name, char const * path)

Adds new search based on N-gram language model.

Convenient method to load N-gram model and create a search.

See: ps_set_lm

set_search(self, search_name)

source code 

set_search(Decoder self, char const * search_name)

Actives search with the provided name.

Activates search with the provided name. The search must be added before using either ps_set_fsg(), ps_set_lm() or ps_set_kws().

0 on success, -1 on failure

unset_search(self, search_name)

source code 

unset_search(Decoder self, char const * search_name)

Unsets the search and releases related resources.

Unsets the search previously added with using either ps_set_fsg(), ps_set_lm() or ps_set_kws().

See: ps_set_fsg

ps_set_lm

ps_set_kws

get_search(self)

source code 

get_search(Decoder self) -> char const *

Returns name of curent search in decoder.

See: ps_set_search