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

Source Code for Module pocketsphinx.pocketsphinx

  1  # This file was automatically generated by SWIG (http://www.swig.org). 
  2  # Version 3.0.5 
  3  # 
  4  # Do not make changes to this file unless you know what you are doing--modify 
  5  # the SWIG interface file instead. 
  6   
  7   
  8   
  9   
 10  """ 
 11  This documentation was automatically generated using original comments in 
 12  Doxygen format. As some C types and data structures cannot be directly mapped 
 13  into Python types, some non-trivial type conversion could have place. 
 14  Basically a type is replaced with another one that has the closest match, and 
 15  sometimes one argument of generated function comprises several arguments of the 
 16  original function (usually two). 
 17   
 18  Functions having error code as the return value and returning effective 
 19  value in one of its arguments are transformed so that the effective value is 
 20  returned in a regular fashion and run-time exception is being thrown in case of 
 21  negative error code. 
 22  """ 
 23   
 24   
 25  from sys import version_info 
 26  if version_info >= (2, 6, 0): 
27 - def swig_import_helper():
28 from os.path import dirname 29 import imp 30 fp = None 31 try: 32 fp, pathname, description = imp.find_module('_pocketsphinx', [dirname(__file__)]) 33 except ImportError: 34 import _pocketsphinx 35 return _pocketsphinx 36 if fp is not None: 37 try: 38 _mod = imp.load_module('_pocketsphinx', fp, pathname, description) 39 finally: 40 fp.close() 41 return _mod
42 _pocketsphinx = swig_import_helper() 43 del swig_import_helper 44 else: 45 import _pocketsphinx 46 del version_info 47 try: 48 _swig_property = property 49 except NameError: 50 pass # Python < 2.2 doesn't have 'property'. 51 52
53 -def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
54 if (name == "thisown"): 55 return self.this.own(value) 56 if (name == "this"): 57 if type(value).__name__ == 'SwigPyObject': 58 self.__dict__[name] = value 59 return 60 method = class_type.__swig_setmethods__.get(name, None) 61 if method: 62 return method(self, value) 63 if (not static): 64 if _newclass: 65 object.__setattr__(self, name, value) 66 else: 67 self.__dict__[name] = value 68 else: 69 raise AttributeError("You cannot add attributes to %s" % self)
70 71
72 -def _swig_setattr(self, class_type, name, value):
73 return _swig_setattr_nondynamic(self, class_type, name, value, 0)
74 75
76 -def _swig_getattr_nondynamic(self, class_type, name, static=1):
77 if (name == "thisown"): 78 return self.this.own() 79 method = class_type.__swig_getmethods__.get(name, None) 80 if method: 81 return method(self) 82 if (not static): 83 return object.__getattr__(self, name) 84 else: 85 raise AttributeError(name)
86
87 -def _swig_getattr(self, class_type, name):
88 return _swig_getattr_nondynamic(self, class_type, name, 0)
89 90
91 -def _swig_repr(self):
92 try: 93 strthis = "proxy of " + self.this.__repr__() 94 except: 95 strthis = "" 96 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
97 98 try: 99 _object = object 100 _newclass = 1 101 except AttributeError:
102 - class _object:
103 pass
104 _newclass = 0 105 106 107 import sphinxbase
108 -class Hypothesis(_object):
109 """Proxy of C Hypothesis struct""" 110 __swig_setmethods__ = {} 111 __setattr__ = lambda self, name, value: _swig_setattr(self, Hypothesis, name, value) 112 __swig_getmethods__ = {} 113 __getattr__ = lambda self, name: _swig_getattr(self, Hypothesis, name) 114 __repr__ = _swig_repr 115 __swig_setmethods__["hypstr"] = _pocketsphinx.Hypothesis_hypstr_set 116 __swig_getmethods__["hypstr"] = _pocketsphinx.Hypothesis_hypstr_get 117 if _newclass: 118 hypstr = _swig_property(_pocketsphinx.Hypothesis_hypstr_get, _pocketsphinx.Hypothesis_hypstr_set) 119 __swig_setmethods__["best_score"] = _pocketsphinx.Hypothesis_best_score_set 120 __swig_getmethods__["best_score"] = _pocketsphinx.Hypothesis_best_score_get 121 if _newclass: 122 best_score = _swig_property(_pocketsphinx.Hypothesis_best_score_get, _pocketsphinx.Hypothesis_best_score_set) 123 __swig_setmethods__["prob"] = _pocketsphinx.Hypothesis_prob_set 124 __swig_getmethods__["prob"] = _pocketsphinx.Hypothesis_prob_get 125 if _newclass: 126 prob = _swig_property(_pocketsphinx.Hypothesis_prob_get, _pocketsphinx.Hypothesis_prob_set) 127
128 - def __init__(self, hypstr, best_score, prob):
129 """__init__(Hypothesis self, char const * hypstr, int best_score, int prob) -> Hypothesis""" 130 this = _pocketsphinx.new_Hypothesis(hypstr, best_score, prob) 131 try: 132 self.this.append(this) 133 except: 134 self.this = this
135 __swig_destroy__ = _pocketsphinx.delete_Hypothesis 136 __del__ = lambda self: None
137 Hypothesis_swigregister = _pocketsphinx.Hypothesis_swigregister 138 Hypothesis_swigregister(Hypothesis) 139
140 -class Segment(_object):
141 """Proxy of C Segment struct""" 142 __swig_setmethods__ = {} 143 __setattr__ = lambda self, name, value: _swig_setattr(self, Segment, name, value) 144 __swig_getmethods__ = {} 145 __getattr__ = lambda self, name: _swig_getattr(self, Segment, name) 146 __repr__ = _swig_repr 147 __swig_setmethods__["word"] = _pocketsphinx.Segment_word_set 148 __swig_getmethods__["word"] = _pocketsphinx.Segment_word_get 149 if _newclass: 150 word = _swig_property(_pocketsphinx.Segment_word_get, _pocketsphinx.Segment_word_set) 151 __swig_setmethods__["ascore"] = _pocketsphinx.Segment_ascore_set 152 __swig_getmethods__["ascore"] = _pocketsphinx.Segment_ascore_get 153 if _newclass: 154 ascore = _swig_property(_pocketsphinx.Segment_ascore_get, _pocketsphinx.Segment_ascore_set) 155 __swig_setmethods__["lscore"] = _pocketsphinx.Segment_lscore_set 156 __swig_getmethods__["lscore"] = _pocketsphinx.Segment_lscore_get 157 if _newclass: 158 lscore = _swig_property(_pocketsphinx.Segment_lscore_get, _pocketsphinx.Segment_lscore_set) 159 __swig_setmethods__["lback"] = _pocketsphinx.Segment_lback_set 160 __swig_getmethods__["lback"] = _pocketsphinx.Segment_lback_get 161 if _newclass: 162 lback = _swig_property(_pocketsphinx.Segment_lback_get, _pocketsphinx.Segment_lback_set) 163 __swig_setmethods__["prob"] = _pocketsphinx.Segment_prob_set 164 __swig_getmethods__["prob"] = _pocketsphinx.Segment_prob_get 165 if _newclass: 166 prob = _swig_property(_pocketsphinx.Segment_prob_get, _pocketsphinx.Segment_prob_set) 167 __swig_setmethods__["start_frame"] = _pocketsphinx.Segment_start_frame_set 168 __swig_getmethods__["start_frame"] = _pocketsphinx.Segment_start_frame_get 169 if _newclass: 170 start_frame = _swig_property(_pocketsphinx.Segment_start_frame_get, _pocketsphinx.Segment_start_frame_set) 171 __swig_setmethods__["end_frame"] = _pocketsphinx.Segment_end_frame_set 172 __swig_getmethods__["end_frame"] = _pocketsphinx.Segment_end_frame_get 173 if _newclass: 174 end_frame = _swig_property(_pocketsphinx.Segment_end_frame_get, _pocketsphinx.Segment_end_frame_set) 175
176 - def fromIter(itor):
177 """fromIter(void * itor) -> Segment""" 178 return _pocketsphinx.Segment_fromIter(itor)
179 180 if _newclass: 181 fromIter = staticmethod(fromIter) 182 __swig_getmethods__["fromIter"] = lambda x: fromIter 183 __swig_destroy__ = _pocketsphinx.delete_Segment 184 __del__ = lambda self: None 185
186 - def __init__(self):
187 """__init__(Segment self) -> Segment""" 188 this = _pocketsphinx.new_Segment() 189 try: 190 self.this.append(this) 191 except: 192 self.this = this
193 Segment_swigregister = _pocketsphinx.Segment_swigregister 194 Segment_swigregister(Segment) 195
196 -def Segment_fromIter(itor):
197 """Segment_fromIter(void * itor) -> Segment""" 198 return _pocketsphinx.Segment_fromIter(itor)
199
200 -class NBest(_object):
201 """Proxy of C NBest struct""" 202 __swig_setmethods__ = {} 203 __setattr__ = lambda self, name, value: _swig_setattr(self, NBest, name, value) 204 __swig_getmethods__ = {} 205 __getattr__ = lambda self, name: _swig_getattr(self, NBest, name) 206 __repr__ = _swig_repr 207 __swig_setmethods__["hypstr"] = _pocketsphinx.NBest_hypstr_set 208 __swig_getmethods__["hypstr"] = _pocketsphinx.NBest_hypstr_get 209 if _newclass: 210 hypstr = _swig_property(_pocketsphinx.NBest_hypstr_get, _pocketsphinx.NBest_hypstr_set) 211 __swig_setmethods__["score"] = _pocketsphinx.NBest_score_set 212 __swig_getmethods__["score"] = _pocketsphinx.NBest_score_get 213 if _newclass: 214 score = _swig_property(_pocketsphinx.NBest_score_get, _pocketsphinx.NBest_score_set) 215
216 - def fromIter(itor):
217 """fromIter(void * itor) -> NBest""" 218 return _pocketsphinx.NBest_fromIter(itor)
219 220 if _newclass: 221 fromIter = staticmethod(fromIter) 222 __swig_getmethods__["fromIter"] = lambda x: fromIter 223
224 - def hyp(self):
225 """hyp(NBest self) -> Hypothesis""" 226 return _pocketsphinx.NBest_hyp(self)
227 228 __swig_destroy__ = _pocketsphinx.delete_NBest 229 __del__ = lambda self: None 230
231 - def __init__(self):
232 """__init__(NBest self) -> NBest""" 233 this = _pocketsphinx.new_NBest() 234 try: 235 self.this.append(this) 236 except: 237 self.this = this
238 NBest_swigregister = _pocketsphinx.NBest_swigregister 239 NBest_swigregister(NBest) 240
241 -def NBest_fromIter(itor):
242 """NBest_fromIter(void * itor) -> NBest""" 243 return _pocketsphinx.NBest_fromIter(itor)
244
245 -class SegmentIterator(_object):
246 """Proxy of C SegmentIterator struct""" 247 __swig_setmethods__ = {} 248 __setattr__ = lambda self, name, value: _swig_setattr(self, SegmentIterator, name, value) 249 __swig_getmethods__ = {} 250 __getattr__ = lambda self, name: _swig_getattr(self, SegmentIterator, name) 251 __repr__ = _swig_repr 252
253 - def __init__(self, ptr):
254 """__init__(SegmentIterator self, void * ptr) -> SegmentIterator""" 255 this = _pocketsphinx.new_SegmentIterator(ptr) 256 try: 257 self.this.append(this) 258 except: 259 self.this = this
260 __swig_destroy__ = _pocketsphinx.delete_SegmentIterator 261 __del__ = lambda self: None 262
263 - def next(self):
264 """next(SegmentIterator self) -> Segment""" 265 return _pocketsphinx.SegmentIterator_next(self)
266 267
268 - def __next__(self):
269 """__next__(SegmentIterator self) -> Segment""" 270 return _pocketsphinx.SegmentIterator___next__(self)
271 272 SegmentIterator_swigregister = _pocketsphinx.SegmentIterator_swigregister 273 SegmentIterator_swigregister(SegmentIterator) 274
275 -class NBestIterator(_object):
276 """Proxy of C NBestIterator struct""" 277 __swig_setmethods__ = {} 278 __setattr__ = lambda self, name, value: _swig_setattr(self, NBestIterator, name, value) 279 __swig_getmethods__ = {} 280 __getattr__ = lambda self, name: _swig_getattr(self, NBestIterator, name) 281 __repr__ = _swig_repr 282
283 - def __init__(self, ptr):
284 """__init__(NBestIterator self, void * ptr) -> NBestIterator""" 285 this = _pocketsphinx.new_NBestIterator(ptr) 286 try: 287 self.this.append(this) 288 except: 289 self.this = this
290 __swig_destroy__ = _pocketsphinx.delete_NBestIterator 291 __del__ = lambda self: None 292
293 - def next(self):
294 """next(NBestIterator self) -> NBest""" 295 return _pocketsphinx.NBestIterator_next(self)
296 297
298 - def __next__(self):
299 """__next__(NBestIterator self) -> NBest""" 300 return _pocketsphinx.NBestIterator___next__(self)
301 302 NBestIterator_swigregister = _pocketsphinx.NBestIterator_swigregister 303 NBestIterator_swigregister(NBestIterator) 304
305 -class Decoder(_object):
306 """Proxy of C Decoder struct""" 307 __swig_setmethods__ = {} 308 __setattr__ = lambda self, name, value: _swig_setattr(self, Decoder, name, value) 309 __swig_getmethods__ = {} 310 __getattr__ = lambda self, name: _swig_getattr(self, Decoder, name) 311 __repr__ = _swig_repr 312
313 - def __init__(self, *args):
314 """ 315 __init__(Decoder self) -> Decoder 316 __init__(Decoder self, Config config) -> Decoder 317 """ 318 this = _pocketsphinx.new_Decoder(*args) 319 try: 320 self.this.append(this) 321 except: 322 self.this = this
323 __swig_destroy__ = _pocketsphinx.delete_Decoder 324 __del__ = lambda self: None 325
326 - def reinit(self, config):
327 """reinit(Decoder self, Config config)""" 328 return _pocketsphinx.Decoder_reinit(self, config)
329 330
331 - def load_dict(self, fdict, ffilter, format):
332 """load_dict(Decoder self, char const * fdict, char const * ffilter, char const * format)""" 333 return _pocketsphinx.Decoder_load_dict(self, fdict, ffilter, format)
334 335
336 - def save_dict(self, dictfile, format):
337 """save_dict(Decoder self, char const * dictfile, char const * format)""" 338 return _pocketsphinx.Decoder_save_dict(self, dictfile, format)
339 340
341 - def add_word(self, word, phones, update):
342 """add_word(Decoder self, char const * word, char const * phones, int update)""" 343 return _pocketsphinx.Decoder_add_word(self, word, phones, update)
344 345
346 - def lookup_word(self, word):
347 """lookup_word(Decoder self, char const * word) -> char *""" 348 return _pocketsphinx.Decoder_lookup_word(self, word)
349 350
351 - def get_lattice(self):
352 """get_lattice(Decoder self) -> Lattice""" 353 return _pocketsphinx.Decoder_get_lattice(self)
354 355
356 - def get_config(self):
357 """get_config(Decoder self) -> Config""" 358 return _pocketsphinx.Decoder_get_config(self)
359 360
361 - def default_config():
362 """default_config() -> Config""" 363 return _pocketsphinx.Decoder_default_config()
364 365 if _newclass: 366 default_config = staticmethod(default_config) 367 __swig_getmethods__["default_config"] = lambda x: default_config 368
369 - def file_config(path):
370 """file_config(char const * path) -> Config""" 371 return _pocketsphinx.Decoder_file_config(path)
372 373 if _newclass: 374 file_config = staticmethod(file_config) 375 __swig_getmethods__["file_config"] = lambda x: file_config 376
377 - def start_stream(self):
378 """start_stream(Decoder self)""" 379 return _pocketsphinx.Decoder_start_stream(self)
380 381
382 - def start_utt(self):
383 """start_utt(Decoder self)""" 384 return _pocketsphinx.Decoder_start_utt(self)
385 386
387 - def end_utt(self):
388 """end_utt(Decoder self)""" 389 return _pocketsphinx.Decoder_end_utt(self)
390 391
392 - def process_raw(self, SDATA, no_search, full_utt):
393 """process_raw(Decoder self, char const * SDATA, bool no_search, bool full_utt) -> int""" 394 return _pocketsphinx.Decoder_process_raw(self, SDATA, no_search, full_utt)
395 396
397 - def process_cep(self, SDATA, no_search, full_utt):
398 """process_cep(Decoder self, char const * SDATA, bool no_search, bool full_utt) -> int""" 399 return _pocketsphinx.Decoder_process_cep(self, SDATA, no_search, full_utt)
400 401
402 - def hyp(self):
403 """hyp(Decoder self) -> Hypothesis""" 404 return _pocketsphinx.Decoder_hyp(self)
405 406
407 - def get_fe(self):
408 """get_fe(Decoder self) -> FrontEnd""" 409 return _pocketsphinx.Decoder_get_fe(self)
410 411
412 - def get_feat(self):
413 """get_feat(Decoder self) -> Feature""" 414 return _pocketsphinx.Decoder_get_feat(self)
415 416
417 - def get_in_speech(self):
418 """get_in_speech(Decoder self) -> bool""" 419 return _pocketsphinx.Decoder_get_in_speech(self)
420 421
422 - def get_fsg(self, name):
423 """ 424 get_fsg(Decoder self, char const * name) -> FsgModel 425 426 Get the finite-state grammar set object for this decoder. 427 428 If FSG decoding is not enabled, this returns NULL. Call 429 ps_set_fsgset() to enable it. 430 431 The current FSG set object for this decoder, or NULL if none is 432 available. 433 """ 434 return _pocketsphinx.Decoder_get_fsg(self, name)
435 436
437 - def set_fsg(self, name, fsg):
438 """ 439 set_fsg(Decoder self, char const * name, FsgModel fsg) 440 441 Adds new search based on finite state grammar. 442 443 Associates FSG search with the provided name. The search can be 444 activated using ps_set_search(). 445 446 See: ps_set_search 447 """ 448 return _pocketsphinx.Decoder_set_fsg(self, name, fsg)
449 450
451 - def set_jsgf_file(self, name, path):
452 """ 453 set_jsgf_file(Decoder self, char const * name, char const * path) 454 455 Adds new search using JSGF model. 456 457 Convenient method to load JSGF model and create a search. 458 459 See: ps_set_fsg 460 """ 461 return _pocketsphinx.Decoder_set_jsgf_file(self, name, path)
462 463
464 - def set_jsgf_string(self, name, jsgf_string):
465 """ 466 set_jsgf_string(Decoder self, char const * name, char const * jsgf_string) 467 468 Adds new search using JSGF model. 469 470 Convenience method to parse JSGF model from string and create a 471 search. 472 473 See: ps_set_fsg 474 """ 475 return _pocketsphinx.Decoder_set_jsgf_string(self, name, jsgf_string)
476 477
478 - def get_kws(self, name):
479 """ 480 get_kws(Decoder self, char const * name) -> char const * 481 482 Get the current Key phrase to spot. 483 484 If KWS is not enabled, this returns NULL. Call ps_update_kws() to 485 enable it. 486 487 The current keyphrase to spot 488 """ 489 return _pocketsphinx.Decoder_get_kws(self, name)
490 491
492 - def set_kws(self, name, keyfile):
493 """ 494 set_kws(Decoder self, char const * name, char const * keyfile) 495 496 Adds keyphrases from a file to spotting. 497 498 Associates KWS search with the provided name. The search can be 499 activated using ps_set_search(). 500 501 See: ps_set_search 502 """ 503 return _pocketsphinx.Decoder_set_kws(self, name, keyfile)
504 505
506 - def set_keyphrase(self, name, keyphrase):
507 """ 508 set_keyphrase(Decoder self, char const * name, char const * keyphrase) 509 510 Adds new keyphrase to spot. 511 512 Associates KWS search with the provided name. The search can be 513 activated using ps_set_search(). 514 515 See: ps_set_search 516 """ 517 return _pocketsphinx.Decoder_set_keyphrase(self, name, keyphrase)
518 519
520 - def set_allphone_file(self, name, lmfile):
521 """ 522 set_allphone_file(Decoder self, char const * name, char const * lmfile) 523 524 Adds new search based on phone N-gram language model. 525 526 Convenient method to load N-gram model and create a search. 527 528 See: ps_set_allphone 529 """ 530 return _pocketsphinx.Decoder_set_allphone_file(self, name, lmfile)
531 532
533 - def get_lm(self, name):
534 """ 535 get_lm(Decoder self, char const * name) -> NGramModel 536 537 Get the language model set object for this decoder. 538 539 If N-Gram decoding is not enabled, this will return NULL. You will 540 need to enable it using ps_set_lmset(). 541 542 The language model set object for this decoder. The decoder retains 543 ownership of this pointer, so you should not attempt to free it 544 manually. Use ngram_model_retain() if you wish to reuse it elsewhere. 545 546 """ 547 return _pocketsphinx.Decoder_get_lm(self, name)
548 549
550 - def set_lm(self, name, lm):
551 """ 552 set_lm(Decoder self, char const * name, NGramModel lm) 553 554 Adds new search based on N-gram language model. 555 556 Associates N-gram search with the provided name. The search can be 557 activated using ps_set_search(). 558 559 See: ps_set_search. 560 """ 561 return _pocketsphinx.Decoder_set_lm(self, name, lm)
562 563
564 - def set_lm_file(self, name, path):
565 """ 566 set_lm_file(Decoder self, char const * name, char const * path) 567 568 Adds new search based on N-gram language model. 569 570 Convenient method to load N-gram model and create a search. 571 572 See: ps_set_lm 573 """ 574 return _pocketsphinx.Decoder_set_lm_file(self, name, path)
575 576
577 - def get_logmath(self):
578 """get_logmath(Decoder self) -> LogMath""" 579 return _pocketsphinx.Decoder_get_logmath(self)
580 581
582 - def set_search(self, search_name):
583 """ 584 set_search(Decoder self, char const * search_name) 585 586 Actives search with the provided name. 587 588 Activates search with the provided name. The search must be added 589 before using either ps_set_fsg(), ps_set_lm() or ps_set_kws(). 590 591 0 on success, -1 on failure 592 """ 593 return _pocketsphinx.Decoder_set_search(self, search_name)
594 595
596 - def unset_search(self, search_name):
597 """ 598 unset_search(Decoder self, char const * search_name) 599 600 Unsets the search and releases related resources. 601 602 Unsets the search previously added with using either ps_set_fsg(), 603 ps_set_lm() or ps_set_kws(). 604 605 See: ps_set_fsg 606 607 ps_set_lm 608 609 ps_set_kws 610 """ 611 return _pocketsphinx.Decoder_unset_search(self, search_name)
612 613
614 - def get_search(self):
615 """ 616 get_search(Decoder self) -> char const * 617 618 Returns name of curent search in decoder. 619 620 See: ps_set_search 621 """ 622 return _pocketsphinx.Decoder_get_search(self)
623 624
625 - def n_frames(self):
626 """n_frames(Decoder self) -> int""" 627 return _pocketsphinx.Decoder_n_frames(self)
628 629
630 - def seg(self):
631 """seg(Decoder self) -> SegmentList""" 632 return _pocketsphinx.Decoder_seg(self)
633 634
635 - def nbest(self):
636 """nbest(Decoder self) -> NBestList""" 637 return _pocketsphinx.Decoder_nbest(self)
638 639 Decoder_swigregister = _pocketsphinx.Decoder_swigregister 640 Decoder_swigregister(Decoder) 641
642 -def Decoder_default_config():
643 """Decoder_default_config() -> Config""" 644 return _pocketsphinx.Decoder_default_config()
645
646 -def Decoder_file_config(path):
647 """Decoder_file_config(char const * path) -> Config""" 648 return _pocketsphinx.Decoder_file_config(path)
649
650 -class Lattice(_object):
651 """Proxy of C Lattice struct""" 652 __swig_setmethods__ = {} 653 __setattr__ = lambda self, name, value: _swig_setattr(self, Lattice, name, value) 654 __swig_getmethods__ = {} 655 __getattr__ = lambda self, name: _swig_getattr(self, Lattice, name) 656 __repr__ = _swig_repr 657
658 - def __init__(self, *args):
659 """ 660 __init__(Lattice self, char const * path) -> Lattice 661 __init__(Lattice self, Decoder decoder, char * path) -> Lattice 662 """ 663 this = _pocketsphinx.new_Lattice(*args) 664 try: 665 self.this.append(this) 666 except: 667 self.this = this
668 __swig_destroy__ = _pocketsphinx.delete_Lattice 669 __del__ = lambda self: None 670
671 - def write(self, path):
672 """ 673 write(Lattice self, char const * path) 674 675 Write a lattice to disk. 676 677 0 for success, <0 on failure. 678 """ 679 return _pocketsphinx.Lattice_write(self, path)
680 681
682 - def write_htk(self, path):
683 """ 684 write_htk(Lattice self, char const * path) 685 686 Write a lattice to disk in HTK format. 687 688 0 for success, <0 on failure. 689 """ 690 return _pocketsphinx.Lattice_write_htk(self, path)
691 692 Lattice_swigregister = _pocketsphinx.Lattice_swigregister 693 Lattice_swigregister(Lattice) 694
695 -class NBestList(_object):
696 """Proxy of C NBestList struct""" 697 __swig_setmethods__ = {} 698 __setattr__ = lambda self, name, value: _swig_setattr(self, NBestList, name, value) 699 __swig_getmethods__ = {} 700 __getattr__ = lambda self, name: _swig_getattr(self, NBestList, name) 701
702 - def __init__(self, *args, **kwargs):
703 raise AttributeError("No constructor defined")
704 __repr__ = _swig_repr 705
706 - def __iter__(self):
707 """__iter__(NBestList self) -> NBestIterator""" 708 return _pocketsphinx.NBestList___iter__(self)
709 710 __swig_destroy__ = _pocketsphinx.delete_NBestList 711 __del__ = lambda self: None
712 NBestList_swigregister = _pocketsphinx.NBestList_swigregister 713 NBestList_swigregister(NBestList) 714
715 -class SegmentList(_object):
716 """Proxy of C SegmentList struct""" 717 __swig_setmethods__ = {} 718 __setattr__ = lambda self, name, value: _swig_setattr(self, SegmentList, name, value) 719 __swig_getmethods__ = {} 720 __getattr__ = lambda self, name: _swig_getattr(self, SegmentList, name) 721
722 - def __init__(self, *args, **kwargs):
723 raise AttributeError("No constructor defined")
724 __repr__ = _swig_repr 725
726 - def __iter__(self):
727 """__iter__(SegmentList self) -> SegmentIterator""" 728 return _pocketsphinx.SegmentList___iter__(self)
729 730 __swig_destroy__ = _pocketsphinx.delete_SegmentList 731 __del__ = lambda self: None
732 SegmentList_swigregister = _pocketsphinx.SegmentList_swigregister 733 SegmentList_swigregister(SegmentList) 734 735 # This file is compatible with both classic and new-style classes. 736