Package sphinxbase :: Module sphinxbase :: Class FsgModel
[hide private]
[frames] | no frames]

Class FsgModel

source code

object --+
         |
        FsgModel

Proxy of C FsgModel 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__(FsgModel self, char const * name, LogMath logmath, float lw, int n) -> FsgModel __init__(FsgModel self, char const * path, LogMath logmath, float lw) -> FsgModel
source code
 
__swig_destroy__(...)
delete_FsgModel(FsgModel self)
 
__del__(self) source code
 
word_id(self, word)
word_id(FsgModel self, char const * word) -> int
source code
 
word_add(self, word)
word_add(FsgModel self, char const * word) -> int
source code
 
trans_add(self, src, dst, logp, wid)
trans_add(FsgModel self, int src, int dst, int logp, int wid)
source code
 
null_trans_add(self, src, dst, logp)
null_trans_add(FsgModel self, int src, int dst, int logp) -> int
source code
 
tag_trans_add(self, src, dst, logp, wid)
tag_trans_add(FsgModel self, int src, int dst, int logp, int wid) -> int
source code
 
add_silence(self, silword, state, silprob)
add_silence(FsgModel self, char const * silword, int state, float silprob) -> int
source code
 
add_alt(self, baseword, altword)
add_alt(FsgModel self, char const * baseword, char const * altword) -> int
source code
 
writefile(self, path)
writefile(FsgModel self, char const * path)
source code

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

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__(FsgModel self, char const * name, LogMath logmath, float lw, int n) -> FsgModel __init__(FsgModel self, char const * path, LogMath logmath, float lw) -> FsgModel

Overrides: object.__init__

word_id(self, word)

source code 

word_id(FsgModel self, char const * word) -> int

Look up a word in the FSG vocabulary.

Word ID for this word

word_add(self, word)

source code 

word_add(FsgModel self, char const * word) -> int

Add a word to the FSG vocabulary.

Word ID for this new word.

trans_add(self, src, dst, logp, wid)

source code 

trans_add(FsgModel self, int src, int dst, int logp, int wid)

Add the given transition to the FSG transition matrix.

Duplicates (i.e., two transitions between the same states, with the same word label) are flagged and only the highest prob retained.

null_trans_add(self, src, dst, logp)

source code 

null_trans_add(FsgModel self, int src, int dst, int logp) -> int

Add a null transition between the given states.

There can be at most one null transition between the given states; duplicates are flagged and only the best prob retained. Transition probs must be <= 1 (i.e., logprob <= 0).

1 if a new transition was added, 0 if the prob of an existing transition was upgraded; -1 if nothing was changed.

tag_trans_add(self, src, dst, logp, wid)

source code 

tag_trans_add(FsgModel self, int src, int dst, int logp, int wid) -> int

Add a "tag" transition between the given states.

A "tag" transition is a null transition with a non-null word ID, which corresponds to a semantic tag or other symbol to be output when this transition is taken.

As above, there can be at most one null or tag transition between the given states; duplicates are flagged and only the best prob retained. Transition probs must be <= 1 (i.e., logprob <= 0).

1 if a new transition was added, 0 if the prob of an existing transition was upgraded; -1 if nothing was changed.

add_silence(self, silword, state, silprob)

source code 

add_silence(FsgModel self, char const * silword, int state, float silprob) -> int

Add silence word transitions to each state in given FSG.

Parameters:
-----------

state:  state to add a self-loop to, or -1 for all states.

silprob:  probability of silence transition. 

add_alt(self, baseword, altword)

source code 

add_alt(FsgModel self, char const * baseword, char const * altword) -> int

Add alternate pronunciation transitions for a word in given FSG.

writefile(self, path)

source code 

writefile(FsgModel self, char const * path)

Write FSG to a file.