Removing gstreamer plugin
[profile/ivi/pocketsphinx.git] / python / pocketsphinx.c
1 /* Generated by Cython 0.13 on Sat Oct 16 11:46:23 2010 */
2
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6     #error Python headers needed to compile C extensions, please install development version of Python.
7 #else
8
9 #include <stddef.h> /* For offsetof */
10 #ifndef offsetof
11 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
12 #endif
13
14 #if !defined(WIN32) && !defined(MS_WINDOWS)
15   #ifndef __stdcall
16     #define __stdcall
17   #endif
18   #ifndef __cdecl
19     #define __cdecl
20   #endif
21   #ifndef __fastcall
22     #define __fastcall
23   #endif
24 #endif
25
26 #ifndef DL_IMPORT
27   #define DL_IMPORT(t) t
28 #endif
29 #ifndef DL_EXPORT
30   #define DL_EXPORT(t) t
31 #endif
32
33 #ifndef PY_LONG_LONG
34   #define PY_LONG_LONG LONG_LONG
35 #endif
36
37 #if PY_VERSION_HEX < 0x02040000
38   #define METH_COEXIST 0
39   #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
40   #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
41 #endif
42
43 #if PY_VERSION_HEX < 0x02050000
44   typedef int Py_ssize_t;
45   #define PY_SSIZE_T_MAX INT_MAX
46   #define PY_SSIZE_T_MIN INT_MIN
47   #define PY_FORMAT_SIZE_T ""
48   #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
49   #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
50   #define PyNumber_Index(o)    PyNumber_Int(o)
51   #define PyIndex_Check(o)     PyNumber_Check(o)
52   #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
53 #endif
54
55 #if PY_VERSION_HEX < 0x02060000
56   #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
57   #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
58   #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
59   #define PyVarObject_HEAD_INIT(type, size) \
60           PyObject_HEAD_INIT(type) size,
61   #define PyType_Modified(t)
62
63   typedef struct {
64      void *buf;
65      PyObject *obj;
66      Py_ssize_t len;
67      Py_ssize_t itemsize;
68      int readonly;
69      int ndim;
70      char *format;
71      Py_ssize_t *shape;
72      Py_ssize_t *strides;
73      Py_ssize_t *suboffsets;
74      void *internal;
75   } Py_buffer;
76
77   #define PyBUF_SIMPLE 0
78   #define PyBUF_WRITABLE 0x0001
79   #define PyBUF_FORMAT 0x0004
80   #define PyBUF_ND 0x0008
81   #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
82   #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
83   #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
84   #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
85   #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
86
87 #endif
88
89 #if PY_MAJOR_VERSION < 3
90   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
91 #else
92   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
93 #endif
94
95 #if PY_MAJOR_VERSION >= 3
96   #define Py_TPFLAGS_CHECKTYPES 0
97   #define Py_TPFLAGS_HAVE_INDEX 0
98 #endif
99
100 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
101   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
102 #endif
103
104 #if PY_MAJOR_VERSION >= 3
105   #define PyBaseString_Type            PyUnicode_Type
106   #define PyStringObject               PyUnicodeObject
107   #define PyString_Type                PyUnicode_Type
108   #define PyString_Check               PyUnicode_Check
109   #define PyString_CheckExact          PyUnicode_CheckExact
110 #endif
111
112 #if PY_VERSION_HEX < 0x02060000
113   #define PyBytesObject                PyStringObject
114   #define PyBytes_Type                 PyString_Type
115   #define PyBytes_Check                PyString_Check
116   #define PyBytes_CheckExact           PyString_CheckExact
117   #define PyBytes_FromString           PyString_FromString
118   #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
119   #define PyBytes_FromFormat           PyString_FromFormat
120   #define PyBytes_DecodeEscape         PyString_DecodeEscape
121   #define PyBytes_AsString             PyString_AsString
122   #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
123   #define PyBytes_Size                 PyString_Size
124   #define PyBytes_AS_STRING            PyString_AS_STRING
125   #define PyBytes_GET_SIZE             PyString_GET_SIZE
126   #define PyBytes_Repr                 PyString_Repr
127   #define PyBytes_Concat               PyString_Concat
128   #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
129   #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
130   #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
131 #endif
132
133 #ifndef PySet_CheckExact
134 #  define PySet_CheckExact(obj)          (Py_TYPE(obj) == &PySet_Type)
135 #endif
136
137 #if PY_MAJOR_VERSION >= 3
138   #define PyInt_Type                   PyLong_Type
139   #define PyInt_Check(op)              PyLong_Check(op)
140   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
141   #define PyInt_FromString             PyLong_FromString
142   #define PyInt_FromUnicode            PyLong_FromUnicode
143   #define PyInt_FromLong               PyLong_FromLong
144   #define PyInt_FromSize_t             PyLong_FromSize_t
145   #define PyInt_FromSsize_t            PyLong_FromSsize_t
146   #define PyInt_AsLong                 PyLong_AsLong
147   #define PyInt_AS_LONG                PyLong_AS_LONG
148   #define PyInt_AsSsize_t              PyLong_AsSsize_t
149   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
150   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
151 #endif
152
153 #if PY_MAJOR_VERSION >= 3
154   #define PyBoolObject PyLongObject
155 #endif
156
157
158 #if PY_MAJOR_VERSION >= 3
159   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
160   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
161 #else
162   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
163   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
164 #endif
165
166 #if PY_MAJOR_VERSION >= 3
167   #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
168 #endif
169
170 #if PY_VERSION_HEX < 0x02050000
171   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
172   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
173   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
174 #else
175   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
176   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
177   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
178 #endif
179
180 #if PY_VERSION_HEX < 0x02050000
181   #define __Pyx_NAMESTR(n) ((char *)(n))
182   #define __Pyx_DOCSTR(n)  ((char *)(n))
183 #else
184   #define __Pyx_NAMESTR(n) (n)
185   #define __Pyx_DOCSTR(n)  (n)
186 #endif
187
188 #ifdef __cplusplus
189 #define __PYX_EXTERN_C extern "C"
190 #else
191 #define __PYX_EXTERN_C extern
192 #endif
193
194 #if defined(WIN32) || defined(MS_WINDOWS)
195 #define _USE_MATH_DEFINES
196 #endif
197 #include <math.h>
198 #define __PYX_HAVE_API__pocketsphinx
199 #include "sphinxbase/logmath.h"
200 #include "sphinxbase/cmd_ln.h"
201 #include "sphinxbase/ckd_alloc.h"
202 #include "sphinxbase/fsg_model.h"
203 #include "sphinxbase/ngram_model.h"
204 #include "sphinxbase/huff_code.h"
205 #include "stdio.h"
206 #include "bogus_pygobject.h"
207 #include "fsg_set.h"
208 #include "ps_lattice.h"
209 #include "pocketsphinx.h"
210
211 /* inline attribute */
212 #ifndef CYTHON_INLINE
213   #if defined(__GNUC__)
214     #define CYTHON_INLINE __inline__
215   #elif defined(_MSC_VER)
216     #define CYTHON_INLINE __inline
217   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218     #define CYTHON_INLINE inline
219   #else
220     #define CYTHON_INLINE 
221   #endif
222 #endif
223
224 /* unused attribute */
225 #ifndef CYTHON_UNUSED
226 # if defined(__GNUC__)
227 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
228 #     define CYTHON_UNUSED __attribute__ ((__unused__)) 
229 #   else
230 #     define CYTHON_UNUSED
231 #   endif
232 # elif defined(__ICC) || defined(__INTEL_COMPILER)
233 #   define CYTHON_UNUSED __attribute__ ((__unused__)) 
234 # else
235 #   define CYTHON_UNUSED 
236 # endif
237 #endif
238
239 typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
240
241
242 /* Type Conversion Predeclarations */
243
244 #define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
245 #define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
246
247 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
248 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
249 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
250
251 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
252 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
253 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
254
255 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
256
257
258 #ifdef __GNUC__
259 /* Test for GCC > 2.95 */
260 #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
261 #define likely(x)   __builtin_expect(!!(x), 1)
262 #define unlikely(x) __builtin_expect(!!(x), 0)
263 #else /* __GNUC__ > 2 ... */
264 #define likely(x)   (x)
265 #define unlikely(x) (x)
266 #endif /* __GNUC__ > 2 ... */
267 #else /* __GNUC__ */
268 #define likely(x)   (x)
269 #define unlikely(x) (x)
270 #endif /* __GNUC__ */
271     
272 static PyObject *__pyx_m;
273 static PyObject *__pyx_b;
274 static PyObject *__pyx_empty_tuple;
275 static PyObject *__pyx_empty_bytes;
276 static int __pyx_lineno;
277 static int __pyx_clineno = 0;
278 static const char * __pyx_cfilenm= __FILE__;
279 static const char *__pyx_filename;
280
281
282 static const char *__pyx_f[] = {
283   "pocketsphinx.pyx",
284   "sphinxbase.pxd",
285   "pocketsphinx.pxd",
286 };
287
288 typedef float __pyx_t_10sphinxbase_float32;
289
290 typedef int __pyx_t_10sphinxbase_int32;
291
292 typedef double __pyx_t_10sphinxbase_float64;
293
294 /* Type declarations */
295
296 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":159
297  *     cdef set_iter(NGramIter self, ngram_iter_t *itor)
298  * 
299  * cdef class HuffCode:             # <<<<<<<<<<<<<<
300  *     cdef huff_code_t *hc
301  *     cdef file fh
302  */
303
304 struct __pyx_obj_10sphinxbase_HuffCode {
305   PyObject_HEAD
306   huff_code_t *hc;
307   PyObject *fh;
308 };
309
310 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":138
311  * 
312  * # Extension classes
313  * cdef class NGramModel:             # <<<<<<<<<<<<<<
314  *     cdef ngram_model_t *lm
315  *     cdef logmath_t *lmath
316  */
317
318 struct __pyx_obj_10sphinxbase_NGramModel {
319   PyObject_HEAD
320   struct __pyx_vtabstruct_10sphinxbase_NGramModel *__pyx_vtab;
321   ngram_model_t *lm;
322   logmath_t *lmath;
323   float lw;
324   float wip;
325   float uw;
326 };
327
328 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":151
329  *     cdef readonly n_frames
330  * 
331  * cdef class LatLink:             # <<<<<<<<<<<<<<
332  *     cdef ps_latlink_t *link
333  *     cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
334  */
335
336 struct __pyx_obj_12pocketsphinx_LatLink {
337   PyObject_HEAD
338   struct __pyx_vtabstruct_12pocketsphinx_LatLink *__pyx_vtab;
339   ps_latlink_t *link;
340   ps_lattice_t *dag;
341   char *word;
342   char *baseword;
343   int sf;
344   int ef;
345   double prob;
346 };
347
348 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":164
349  *     cdef int first_link
350  * 
351  * cdef class LatNode:             # <<<<<<<<<<<<<<
352  *     cdef ps_latnode_t *node
353  *     cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
354  */
355
356 struct __pyx_obj_12pocketsphinx_LatNode {
357   PyObject_HEAD
358   struct __pyx_vtabstruct_12pocketsphinx_LatNode *__pyx_vtab;
359   ps_latnode_t *node;
360   ps_lattice_t *dag;
361   char *word;
362   char *baseword;
363   int sf;
364   int fef;
365   int lef;
366   double prob;
367   struct __pyx_obj_12pocketsphinx_LatLink *best_exit;
368 };
369
370 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":138
371  * 
372  * # Now, our extension classes
373  * cdef class Decoder:             # <<<<<<<<<<<<<<
374  *     cdef ps_decoder_t *ps
375  *     cdef char **argv
376  */
377
378 struct __pyx_obj_12pocketsphinx_Decoder {
379   PyObject_HEAD
380   struct __pyx_vtabstruct_12pocketsphinx_Decoder *__pyx_vtab;
381   ps_decoder_t *ps;
382   char **argv;
383   int argc;
384 };
385
386 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":146
387  *     cdef set_lmath(NGramModel self, logmath_t *lmath)
388  * 
389  * cdef class LogMath:             # <<<<<<<<<<<<<<
390  *     cdef logmath_t *lmath
391  * 
392  */
393
394 struct __pyx_obj_10sphinxbase_LogMath {
395   PyObject_HEAD
396   logmath_t *lmath;
397 };
398
399 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":173
400  *     cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node)
401  * 
402  * cdef class LatNodeIterator:             # <<<<<<<<<<<<<<
403  *     cdef ps_lattice_t *dag
404  *     cdef ps_latnode_iter_t *itor
405  */
406
407 struct __pyx_obj_12pocketsphinx_LatNodeIterator {
408   PyObject_HEAD
409   ps_lattice_t *dag;
410   ps_latnode_iter_t *itor;
411   int first_node;
412   int start;
413   int end;
414 };
415
416 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":144
417  *     cdef set_boxed(Decoder self, box)
418  * 
419  * cdef class Lattice:             # <<<<<<<<<<<<<<
420  *     cdef ps_lattice_t *dag
421  *     cdef read_dag(Lattice self, Decoder ps, latfile)
422  */
423
424 struct __pyx_obj_12pocketsphinx_Lattice {
425   PyObject_HEAD
426   struct __pyx_vtabstruct_12pocketsphinx_Lattice *__pyx_vtab;
427   ps_lattice_t *dag;
428   PyObject *n_frames;
429 };
430
431 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":159
432  *     cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link)
433  * 
434  * cdef class LatLinkIterator:             # <<<<<<<<<<<<<<
435  *     cdef ps_lattice_t *dag
436  *     cdef ps_latlink_iter_t *itor
437  */
438
439 struct __pyx_obj_12pocketsphinx_LatLinkIterator {
440   PyObject_HEAD
441   ps_lattice_t *dag;
442   ps_latlink_iter_t *itor;
443   int first_link;
444 };
445
446 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":149
447  *     cdef logmath_t *lmath
448  * 
449  * cdef class NGramIter:             # <<<<<<<<<<<<<<
450  *     cdef NGramModel lm
451  *     cdef ngram_iter_t *itor
452  */
453
454 struct __pyx_obj_10sphinxbase_NGramIter {
455   PyObject_HEAD
456   struct __pyx_vtabstruct_10sphinxbase_NGramIter *__pyx_vtab;
457   struct __pyx_obj_10sphinxbase_NGramModel *lm;
458   ngram_iter_t *itor;
459   int first_item;
460   int m;
461   float log_prob;
462   float log_bowt;
463   PyObject *words;
464 };
465
466
467 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":227
468  *         return link
469  * 
470  * cdef class Lattice:             # <<<<<<<<<<<<<<
471  *     """
472  *     Word lattice.
473  */
474
475 struct __pyx_vtabstruct_12pocketsphinx_Lattice {
476   PyObject *(*read_dag)(struct __pyx_obj_12pocketsphinx_Lattice *, struct __pyx_obj_12pocketsphinx_Decoder *, PyObject *);
477   PyObject *(*set_dag)(struct __pyx_obj_12pocketsphinx_Lattice *, ps_lattice_t *);
478   PyObject *(*set_boxed)(struct __pyx_obj_12pocketsphinx_Lattice *, PyObject *);
479 };
480 static struct __pyx_vtabstruct_12pocketsphinx_Lattice *__pyx_vtabptr_12pocketsphinx_Lattice;
481
482
483 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":132
484  *         return node
485  * 
486  * cdef class LatLink:             # <<<<<<<<<<<<<<
487  *     """
488  *     Link (edge) in a word lattice, connecting two nodes.
489  */
490
491 struct __pyx_vtabstruct_12pocketsphinx_LatLink {
492   PyObject *(*set_link)(struct __pyx_obj_12pocketsphinx_LatLink *, ps_lattice_t *, ps_latlink_t *);
493 };
494 static struct __pyx_vtabstruct_12pocketsphinx_LatLink *__pyx_vtabptr_12pocketsphinx_LatLink;
495
496
497 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":149
498  *     cdef logmath_t *lmath
499  * 
500  * cdef class NGramIter:             # <<<<<<<<<<<<<<
501  *     cdef NGramModel lm
502  *     cdef ngram_iter_t *itor
503  */
504
505 struct __pyx_vtabstruct_10sphinxbase_NGramIter {
506   PyObject *(*set_iter)(struct __pyx_obj_10sphinxbase_NGramIter *, ngram_iter_t *);
507 };
508 static struct __pyx_vtabstruct_10sphinxbase_NGramIter *__pyx_vtabptr_10sphinxbase_NGramIter;
509
510
511 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":371
512  *             raise RuntimeError, "Failed to write lattice to %s" % outfile
513  * 
514  * cdef class Decoder:             # <<<<<<<<<<<<<<
515  *     """
516  *     PocketSphinx speech decoder.
517  */
518
519 struct __pyx_vtabstruct_12pocketsphinx_Decoder {
520   PyObject *(*set_boxed)(struct __pyx_obj_12pocketsphinx_Decoder *, PyObject *);
521 };
522 static struct __pyx_vtabstruct_12pocketsphinx_Decoder *__pyx_vtabptr_12pocketsphinx_Decoder;
523
524
525 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":10
526  * # Author: David Huggins-Daines <dhuggins@cs.cmu.edu>
527  * 
528  * cdef class LatNode:             # <<<<<<<<<<<<<<
529  *     """
530  *     Node in a word lattice.
531  */
532
533 struct __pyx_vtabstruct_12pocketsphinx_LatNode {
534   PyObject *(*set_node)(struct __pyx_obj_12pocketsphinx_LatNode *, ps_lattice_t *, ps_latnode_t *);
535 };
536 static struct __pyx_vtabstruct_12pocketsphinx_LatNode *__pyx_vtabptr_12pocketsphinx_LatNode;
537
538
539 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":138
540  * 
541  * # Extension classes
542  * cdef class NGramModel:             # <<<<<<<<<<<<<<
543  *     cdef ngram_model_t *lm
544  *     cdef logmath_t *lmath
545  */
546
547 struct __pyx_vtabstruct_10sphinxbase_NGramModel {
548   PyObject *(*set_lm)(struct __pyx_obj_10sphinxbase_NGramModel *, ngram_model_t *);
549   PyObject *(*set_lmath)(struct __pyx_obj_10sphinxbase_NGramModel *, logmath_t *);
550 };
551 static struct __pyx_vtabstruct_10sphinxbase_NGramModel *__pyx_vtabptr_10sphinxbase_NGramModel;
552
553 #ifndef CYTHON_REFNANNY
554   #define CYTHON_REFNANNY 0
555 #endif
556
557 #if CYTHON_REFNANNY
558   typedef struct {
559     void (*INCREF)(void*, PyObject*, int);
560     void (*DECREF)(void*, PyObject*, int);
561     void (*GOTREF)(void*, PyObject*, int);
562     void (*GIVEREF)(void*, PyObject*, int);
563     void* (*SetupContext)(const char*, int, const char*);
564     void (*FinishContext)(void**);
565   } __Pyx_RefNannyAPIStruct;
566   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
567   static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
568     PyObject *m = NULL, *p = NULL;
569     void *r = NULL;
570     m = PyImport_ImportModule((char *)modname);
571     if (!m) goto end;
572     p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
573     if (!p) goto end;
574     r = PyLong_AsVoidPtr(p);
575   end:
576     Py_XDECREF(p);
577     Py_XDECREF(m);
578     return (__Pyx_RefNannyAPIStruct *)r;
579   }
580   #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
581   #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
582   #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
583   #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
584   #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
585   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
586   #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
587 #else
588   #define __Pyx_RefNannySetupContext(name)
589   #define __Pyx_RefNannyFinishContext()
590   #define __Pyx_INCREF(r) Py_INCREF(r)
591   #define __Pyx_DECREF(r) Py_DECREF(r)
592   #define __Pyx_GOTREF(r)
593   #define __Pyx_GIVEREF(r)
594   #define __Pyx_XDECREF(r) Py_XDECREF(r)
595 #endif /* CYTHON_REFNANNY */
596 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
597 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
598
599 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
600
601 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
602     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
603
604 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
605     const char* function_name, int kw_allowed); /*proto*/
606
607 static void __Pyx_RaiseDoubleKeywordsError(
608     const char* func_name, PyObject* kw_name); /*proto*/
609
610 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
611
612 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
613
614 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
615     const char *name, int exact); /*proto*/
616
617 static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; }
618 static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
619     return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
620 }
621
622 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
623
624 static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);
625
626
627 #if PY_MAJOR_VERSION >= 3
628 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
629     PyObject *value;
630     if (unlikely(d == Py_None)) {
631         __Pyx_RaiseNoneIndexingError();
632         return NULL;
633     }
634     value = PyDict_GetItemWithError(d, key);
635     if (unlikely(!value)) {
636         if (!PyErr_Occurred())
637             PyErr_SetObject(PyExc_KeyError, key);
638         return NULL;
639     }
640     Py_INCREF(value);
641     return value;
642 }
643 #else
644     #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
645 #endif
646
647
648 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
649     PyObject *r;
650     if (!j) return NULL;
651     r = PyObject_GetItem(o, j);
652     Py_DECREF(j);
653     return r;
654 }
655
656
657 #define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
658                                                     __Pyx_GetItemInt_List_Fast(o, i) : \
659                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
660
661 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
662     if (likely(o != Py_None)) {
663         if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
664             PyObject *r = PyList_GET_ITEM(o, i);
665             Py_INCREF(r);
666             return r;
667         }
668         else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
669             PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
670             Py_INCREF(r);
671             return r;
672         }
673     }
674     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
675 }
676
677 #define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
678                                                     __Pyx_GetItemInt_Tuple_Fast(o, i) : \
679                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
680
681 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
682     if (likely(o != Py_None)) {
683         if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
684             PyObject *r = PyTuple_GET_ITEM(o, i);
685             Py_INCREF(r);
686             return r;
687         }
688         else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
689             PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
690             Py_INCREF(r);
691             return r;
692         }
693     }
694     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
695 }
696
697
698 #define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
699                                                     __Pyx_GetItemInt_Fast(o, i) : \
700                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
701
702 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
703     PyObject *r;
704     if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
705         r = PyList_GET_ITEM(o, i);
706         Py_INCREF(r);
707     }
708     else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
709         r = PyTuple_GET_ITEM(o, i);
710         Py_INCREF(r);
711     }
712     else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
713         r = PySequence_GetItem(o, i);
714     }
715     else {
716         r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
717     }
718     return r;
719 }
720
721 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
722 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
723
724 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
725
726 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
727
728 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
729
730 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
731
732 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
733
734 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
735
736 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
737
738 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
739
740 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
741
742 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
743
744 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
745
746 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
747
748 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
749
750 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
751
752 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
753
754 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
755
756 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
757
758 static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
759
760 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict);  /*proto*/
761
762 static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
763
764 static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
765
766 static void __Pyx_AddTraceback(const char *funcname); /*proto*/
767
768 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
769 /* Module declarations from sphinxbase */
770
771 static PyTypeObject *__pyx_ptype_10sphinxbase_NGramModel = 0;
772 static PyTypeObject *__pyx_ptype_10sphinxbase_LogMath = 0;
773 static PyTypeObject *__pyx_ptype_10sphinxbase_NGramIter = 0;
774 static PyTypeObject *__pyx_ptype_10sphinxbase_HuffCode = 0;
775 /* Module declarations from pocketsphinx */
776
777 static PyTypeObject *__pyx_ptype_12pocketsphinx_Decoder = 0;
778 static PyTypeObject *__pyx_ptype_12pocketsphinx_Lattice = 0;
779 static PyTypeObject *__pyx_ptype_12pocketsphinx_LatLink = 0;
780 static PyTypeObject *__pyx_ptype_12pocketsphinx_LatLinkIterator = 0;
781 static PyTypeObject *__pyx_ptype_12pocketsphinx_LatNode = 0;
782 static PyTypeObject *__pyx_ptype_12pocketsphinx_LatNodeIterator = 0;
783 #define __Pyx_MODULE_NAME "pocketsphinx"
784 int __pyx_module_is_main_pocketsphinx = 0;
785
786 /* Implementation of pocketsphinx */
787 static PyObject *__pyx_builtin_StopIteration;
788 static PyObject *__pyx_builtin_RuntimeError;
789 static char __pyx_k_1[] = "Failed to read lattice from %s";
790 static char __pyx_k_2[] = "Failed to write lattice to %s";
791 static char __pyx_k_3[] = "-";
792 static char __pyx_k_4[] = "Failed to parse argument list";
793 static char __pyx_k_5[] = "Failed to initialize PocketSphinx";
794 static char __pyx_k_6[] = "Failed to start utterance processing";
795 static char __pyx_k_9[] = "Failed to process %d samples of audio data";
796 static char __pyx_k_10[] = "Failed to stop utterance processing";
797 static char __pyx_k_11[] = "Failed to create word lattice";
798 static char __pyx_k_12[] = "-lw";
799 static char __pyx_k_13[] = "-wip";
800 static char __pyx_k_14[] = "-uw";
801 static char __pyx_k_16[] = "LatNode.exits (line 53)";
802 static char __pyx_k_17[] = "LatNode.entries (line 69)";
803 static char __pyx_k_18[] = "LatNodeIterator.__next__ (line 98)";
804 static char __pyx_k_19[] = "LatLink.nodes (line 164)";
805 static char __pyx_k_20[] = "LatLink.pred (line 181)";
806 static char __pyx_k_21[] = "LatLinkIterator.__next__ (line 209)";
807 static char __pyx_k_22[] = "Lattice.bestpath (line 287)";
808 static char __pyx_k_23[] = "Lattice.posterior (line 317)";
809 static char __pyx_k_24[] = "Lattice.nodes (line 338)";
810 static char __pyx_k_25[] = "Lattice.write (line 358)";
811 static char __pyx_k_26[] = "Decoder.decode_raw (line 441)";
812 static char __pyx_k_27[] = "Decoder.decode_senscr (line 464)";
813 static char __pyx_k_28[] = "Decoder.start_utt (line 483)";
814 static char __pyx_k_29[] = "Decoder.process_raw (line 499)";
815 static char __pyx_k_30[] = "Decoder.ps_end_utt (line 525)";
816 static char __pyx_k_31[] = "Decoder.get_hyp (line 532)";
817 static char __pyx_k_32[] = "Decoder.get_prob (line 555)";
818 static char __pyx_k_33[] = "Decoder.get_lattice (line 569)";
819 static char __pyx_k_34[] = "Decoder.get_lmset (line 589)";
820 static char __pyx_k_35[] = "Decoder.add_word (line 616)";
821 static char __pyx_k_36[] = "Decoder.load_dict (line 631)";
822 static char __pyx_k_37[] = "Decoder.save_dict (line 644)";
823 static char __pyx_k__ef[] = "ef";
824 static char __pyx_k__fh[] = "fh";
825 static char __pyx_k__lm[] = "lm";
826 static char __pyx_k__lw[] = "lw";
827 static char __pyx_k__ps[] = "ps";
828 static char __pyx_k__sf[] = "sf";
829 static char __pyx_k__uw[] = "uw";
830 static char __pyx_k__dag[] = "dag";
831 static char __pyx_k__end[] = "end";
832 static char __pyx_k__fef[] = "fef";
833 static char __pyx_k__lef[] = "lef";
834 static char __pyx_k__lwf[] = "lwf";
835 static char __pyx_k__wip[] = "wip";
836 static char __pyx_k__argc[] = "argc";
837 static char __pyx_k__argv[] = "argv";
838 static char __pyx_k__data[] = "data";
839 static char __pyx_k__itor[] = "itor";
840 static char __pyx_k__link[] = "link";
841 static char __pyx_k__node[] = "node";
842 static char __pyx_k__pred[] = "pred";
843 static char __pyx_k__prob[] = "prob";
844 static char __pyx_k__word[] = "word";
845 static char __pyx_k__boxed[] = "boxed";
846 static char __pyx_k__exits[] = "exits";
847 static char __pyx_k__lmset[] = "lmset";
848 static char __pyx_k__nodes[] = "nodes";
849 static char __pyx_k__start[] = "start";
850 static char __pyx_k__uttid[] = "uttid";
851 static char __pyx_k__words[] = "words";
852 static char __pyx_k__write[] = "write";
853 static char __pyx_k__ascale[] = "ascale";
854 static char __pyx_k__format[] = "format";
855 static char __pyx_k__phones[] = "phones";
856 static char __pyx_k__set_lm[] = "set_lm";
857 static char __pyx_k__update[] = "update";
858 static char __pyx_k__Decoder[] = "Decoder";
859 static char __pyx_k__LatLink[] = "LatLink";
860 static char __pyx_k__LatNode[] = "LatNode";
861 static char __pyx_k__Lattice[] = "Lattice";
862 static char __pyx_k__entries[] = "entries";
863 static char __pyx_k__get_hyp[] = "get_hyp";
864 static char __pyx_k__latfile[] = "latfile";
865 static char __pyx_k__set_dag[] = "set_dag";
866 static char __pyx_k____main__[] = "__main__";
867 static char __pyx_k____next__[] = "__next__";
868 static char __pyx_k____test__[] = "__test__";
869 static char __pyx_k__add_word[] = "add_word";
870 static char __pyx_k__baseword[] = "baseword";
871 static char __pyx_k__bestpath[] = "bestpath";
872 static char __pyx_k__dictfile[] = "dictfile";
873 static char __pyx_k__full_utt[] = "full_utt";
874 static char __pyx_k__get_prob[] = "get_prob";
875 static char __pyx_k__log_bowt[] = "log_bowt";
876 static char __pyx_k__log_prob[] = "log_prob";
877 static char __pyx_k__maxsamps[] = "maxsamps";
878 static char __pyx_k__n_frames[] = "n_frames";
879 static char __pyx_k__read_dag[] = "read_dag";
880 static char __pyx_k__set_link[] = "set_link";
881 static char __pyx_k__set_node[] = "set_node";
882 static char __pyx_k__best_exit[] = "best_exit";
883 static char __pyx_k__fdictfile[] = "fdictfile";
884 static char __pyx_k__get_lmset[] = "get_lmset";
885 static char __pyx_k__load_dict[] = "load_dict";
886 static char __pyx_k__no_search[] = "no_search";
887 static char __pyx_k__posterior[] = "posterior";
888 static char __pyx_k__save_dict[] = "save_dict";
889 static char __pyx_k__set_boxed[] = "set_boxed";
890 static char __pyx_k__set_lmath[] = "set_lmath";
891 static char __pyx_k__start_utt[] = "start_utt";
892 static char __pyx_k__decode_raw[] = "decode_raw";
893 static char __pyx_k__first_link[] = "first_link";
894 static char __pyx_k__first_node[] = "first_node";
895 static char __pyx_k__ps_end_utt[] = "ps_end_utt";
896 static char __pyx_k__get_lattice[] = "get_lattice";
897 static char __pyx_k__process_raw[] = "process_raw";
898 static char __pyx_k__RuntimeError[] = "RuntimeError";
899 static char __pyx_k__StopIteration[] = "StopIteration";
900 static char __pyx_k__decode_senscr[] = "decode_senscr";
901 static char __pyx_k__LatLinkIterator[] = "LatLinkIterator";
902 static char __pyx_k__LatNodeIterator[] = "LatNodeIterator";
903 static PyObject *__pyx_kp_s_1;
904 static PyObject *__pyx_kp_s_10;
905 static PyObject *__pyx_kp_s_11;
906 static PyObject *__pyx_kp_u_16;
907 static PyObject *__pyx_kp_u_17;
908 static PyObject *__pyx_kp_u_18;
909 static PyObject *__pyx_kp_u_19;
910 static PyObject *__pyx_kp_s_2;
911 static PyObject *__pyx_kp_u_20;
912 static PyObject *__pyx_kp_u_21;
913 static PyObject *__pyx_kp_u_22;
914 static PyObject *__pyx_kp_u_23;
915 static PyObject *__pyx_kp_u_24;
916 static PyObject *__pyx_kp_u_25;
917 static PyObject *__pyx_kp_u_26;
918 static PyObject *__pyx_kp_u_27;
919 static PyObject *__pyx_kp_u_28;
920 static PyObject *__pyx_kp_u_29;
921 static PyObject *__pyx_kp_s_3;
922 static PyObject *__pyx_kp_u_30;
923 static PyObject *__pyx_kp_u_31;
924 static PyObject *__pyx_kp_u_32;
925 static PyObject *__pyx_kp_u_33;
926 static PyObject *__pyx_kp_u_34;
927 static PyObject *__pyx_kp_u_35;
928 static PyObject *__pyx_kp_u_36;
929 static PyObject *__pyx_kp_u_37;
930 static PyObject *__pyx_kp_s_4;
931 static PyObject *__pyx_kp_s_5;
932 static PyObject *__pyx_kp_s_6;
933 static PyObject *__pyx_kp_s_9;
934 static PyObject *__pyx_n_s__Decoder;
935 static PyObject *__pyx_n_s__LatLink;
936 static PyObject *__pyx_n_s__LatLinkIterator;
937 static PyObject *__pyx_n_s__LatNode;
938 static PyObject *__pyx_n_s__LatNodeIterator;
939 static PyObject *__pyx_n_s__Lattice;
940 static PyObject *__pyx_n_s__RuntimeError;
941 static PyObject *__pyx_n_s__StopIteration;
942 static PyObject *__pyx_n_s____main__;
943 static PyObject *__pyx_n_s____next__;
944 static PyObject *__pyx_n_s____test__;
945 static PyObject *__pyx_n_s__add_word;
946 static PyObject *__pyx_n_s__argc;
947 static PyObject *__pyx_n_s__argv;
948 static PyObject *__pyx_n_s__ascale;
949 static PyObject *__pyx_n_s__baseword;
950 static PyObject *__pyx_n_s__best_exit;
951 static PyObject *__pyx_n_s__bestpath;
952 static PyObject *__pyx_n_s__boxed;
953 static PyObject *__pyx_n_s__dag;
954 static PyObject *__pyx_n_s__data;
955 static PyObject *__pyx_n_s__decode_raw;
956 static PyObject *__pyx_n_s__decode_senscr;
957 static PyObject *__pyx_n_s__dictfile;
958 static PyObject *__pyx_n_s__ef;
959 static PyObject *__pyx_n_s__end;
960 static PyObject *__pyx_n_s__entries;
961 static PyObject *__pyx_n_s__exits;
962 static PyObject *__pyx_n_s__fdictfile;
963 static PyObject *__pyx_n_s__fef;
964 static PyObject *__pyx_n_s__fh;
965 static PyObject *__pyx_n_s__first_link;
966 static PyObject *__pyx_n_s__first_node;
967 static PyObject *__pyx_n_s__format;
968 static PyObject *__pyx_n_s__full_utt;
969 static PyObject *__pyx_n_s__get_hyp;
970 static PyObject *__pyx_n_s__get_lattice;
971 static PyObject *__pyx_n_s__get_lmset;
972 static PyObject *__pyx_n_s__get_prob;
973 static PyObject *__pyx_n_s__itor;
974 static PyObject *__pyx_n_s__latfile;
975 static PyObject *__pyx_n_s__lef;
976 static PyObject *__pyx_n_s__link;
977 static PyObject *__pyx_n_s__lm;
978 static PyObject *__pyx_n_s__lmset;
979 static PyObject *__pyx_n_s__load_dict;
980 static PyObject *__pyx_n_s__log_bowt;
981 static PyObject *__pyx_n_s__log_prob;
982 static PyObject *__pyx_n_s__lw;
983 static PyObject *__pyx_n_s__lwf;
984 static PyObject *__pyx_n_s__maxsamps;
985 static PyObject *__pyx_n_s__n_frames;
986 static PyObject *__pyx_n_s__no_search;
987 static PyObject *__pyx_n_s__node;
988 static PyObject *__pyx_n_s__nodes;
989 static PyObject *__pyx_n_s__phones;
990 static PyObject *__pyx_n_s__posterior;
991 static PyObject *__pyx_n_s__pred;
992 static PyObject *__pyx_n_s__prob;
993 static PyObject *__pyx_n_s__process_raw;
994 static PyObject *__pyx_n_s__ps;
995 static PyObject *__pyx_n_s__ps_end_utt;
996 static PyObject *__pyx_n_s__read_dag;
997 static PyObject *__pyx_n_s__save_dict;
998 static PyObject *__pyx_n_s__set_boxed;
999 static PyObject *__pyx_n_s__set_dag;
1000 static PyObject *__pyx_n_s__set_link;
1001 static PyObject *__pyx_n_s__set_lm;
1002 static PyObject *__pyx_n_s__set_lmath;
1003 static PyObject *__pyx_n_s__set_node;
1004 static PyObject *__pyx_n_s__sf;
1005 static PyObject *__pyx_n_s__start;
1006 static PyObject *__pyx_n_s__start_utt;
1007 static PyObject *__pyx_n_s__update;
1008 static PyObject *__pyx_n_s__uttid;
1009 static PyObject *__pyx_n_s__uw;
1010 static PyObject *__pyx_n_s__wip;
1011 static PyObject *__pyx_n_s__word;
1012 static PyObject *__pyx_n_s__words;
1013 static PyObject *__pyx_n_s__write;
1014 static PyObject *__pyx_int_0;
1015 static PyObject *__pyx_int_neg_1;
1016 static PyObject *__pyx_k_7;
1017 static PyObject *__pyx_k_8;
1018 static PyObject *__pyx_k_15;
1019
1020 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":29
1021  *     @type prob: float
1022  *     """
1023  *     def __cinit__(self):             # <<<<<<<<<<<<<<
1024  *         self.node = NULL
1025  * 
1026  */
1027
1028 static int __pyx_pf_12pocketsphinx_7LatNode___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1029 static int __pyx_pf_12pocketsphinx_7LatNode___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1030   int __pyx_r;
1031   __Pyx_RefNannySetupContext("__cinit__");
1032   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
1033     __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
1034   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
1035
1036   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":30
1037  *     """
1038  *     def __cinit__(self):
1039  *         self.node = NULL             # <<<<<<<<<<<<<<
1040  * 
1041  *     cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node):
1042  */
1043   ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->node = NULL;
1044
1045   __pyx_r = 0;
1046   __Pyx_RefNannyFinishContext();
1047   return __pyx_r;
1048 }
1049
1050 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":32
1051  *         self.node = NULL
1052  * 
1053  *     cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node):             # <<<<<<<<<<<<<<
1054  *         """
1055  *         Internal function - binds this to a PocketSphinx lattice node.
1056  */
1057
1058 static  PyObject *__pyx_f_12pocketsphinx_7LatNode_set_node(struct __pyx_obj_12pocketsphinx_LatNode *__pyx_v_self, ps_lattice_t *__pyx_v_dag, ps_latnode_t *__pyx_v_node) {
1059   short __pyx_v_fef;
1060   short __pyx_v_lef;
1061   ps_latlink_t *__pyx_v_best_exit;
1062   PyObject *__pyx_r = NULL;
1063   int __pyx_t_1;
1064   PyObject *__pyx_t_2 = NULL;
1065   __Pyx_RefNannySetupContext("set_node");
1066
1067   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":38
1068  *         cdef short fef, lef
1069  *         cdef ps_latlink_t *best_exit
1070  *         self.dag = dag             # <<<<<<<<<<<<<<
1071  *         self.node = node
1072  *         self.word = ps_latnode_word(dag, node)
1073  */
1074   __pyx_v_self->dag = __pyx_v_dag;
1075
1076   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":39
1077  *         cdef ps_latlink_t *best_exit
1078  *         self.dag = dag
1079  *         self.node = node             # <<<<<<<<<<<<<<
1080  *         self.word = ps_latnode_word(dag, node)
1081  *         self.baseword = ps_latnode_baseword(dag, node)
1082  */
1083   __pyx_v_self->node = __pyx_v_node;
1084
1085   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":40
1086  *         self.dag = dag
1087  *         self.node = node
1088  *         self.word = ps_latnode_word(dag, node)             # <<<<<<<<<<<<<<
1089  *         self.baseword = ps_latnode_baseword(dag, node)
1090  *         self.sf = ps_latnode_times(node, &fef, &lef)
1091  */
1092   __pyx_v_self->word = ps_latnode_word(__pyx_v_dag, __pyx_v_node);
1093
1094   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":41
1095  *         self.node = node
1096  *         self.word = ps_latnode_word(dag, node)
1097  *         self.baseword = ps_latnode_baseword(dag, node)             # <<<<<<<<<<<<<<
1098  *         self.sf = ps_latnode_times(node, &fef, &lef)
1099  *         self.fef = fef
1100  */
1101   __pyx_v_self->baseword = ps_latnode_baseword(__pyx_v_dag, __pyx_v_node);
1102
1103   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":42
1104  *         self.word = ps_latnode_word(dag, node)
1105  *         self.baseword = ps_latnode_baseword(dag, node)
1106  *         self.sf = ps_latnode_times(node, &fef, &lef)             # <<<<<<<<<<<<<<
1107  *         self.fef = fef
1108  *         self.lef = lef
1109  */
1110   __pyx_v_self->sf = ps_latnode_times(__pyx_v_node, (&__pyx_v_fef), (&__pyx_v_lef));
1111
1112   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":43
1113  *         self.baseword = ps_latnode_baseword(dag, node)
1114  *         self.sf = ps_latnode_times(node, &fef, &lef)
1115  *         self.fef = fef             # <<<<<<<<<<<<<<
1116  *         self.lef = lef
1117  *         self.best_exit = None
1118  */
1119   __pyx_v_self->fef = __pyx_v_fef;
1120
1121   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":44
1122  *         self.sf = ps_latnode_times(node, &fef, &lef)
1123  *         self.fef = fef
1124  *         self.lef = lef             # <<<<<<<<<<<<<<
1125  *         self.best_exit = None
1126  *         best_exit = NULL
1127  */
1128   __pyx_v_self->lef = __pyx_v_lef;
1129
1130   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":45
1131  *         self.fef = fef
1132  *         self.lef = lef
1133  *         self.best_exit = None             # <<<<<<<<<<<<<<
1134  *         best_exit = NULL
1135  *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
1136  */
1137   __Pyx_INCREF(Py_None);
1138   __Pyx_GIVEREF(Py_None);
1139   __Pyx_GOTREF(__pyx_v_self->best_exit);
1140   __Pyx_DECREF(((PyObject *)__pyx_v_self->best_exit));
1141   __pyx_v_self->best_exit = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None);
1142
1143   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":46
1144  *         self.lef = lef
1145  *         self.best_exit = None
1146  *         best_exit = NULL             # <<<<<<<<<<<<<<
1147  *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
1148  *                                          ps_latnode_prob(dag, node, &best_exit))
1149  */
1150   __pyx_v_best_exit = NULL;
1151
1152   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":47
1153  *         self.best_exit = None
1154  *         best_exit = NULL
1155  *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),             # <<<<<<<<<<<<<<
1156  *                                          ps_latnode_prob(dag, node, &best_exit))
1157  *         if best_exit != NULL:
1158  */
1159   __pyx_v_self->prob = logmath_log_to_ln(ps_lattice_get_logmath(__pyx_v_dag), ps_latnode_prob(__pyx_v_dag, __pyx_v_node, (&__pyx_v_best_exit)));
1160
1161   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":49
1162  *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
1163  *                                          ps_latnode_prob(dag, node, &best_exit))
1164  *         if best_exit != NULL:             # <<<<<<<<<<<<<<
1165  *             self.best_exit = LatLink()
1166  *             self.best_exit.set_link(dag, best_exit)
1167  */
1168   __pyx_t_1 = (__pyx_v_best_exit != NULL);
1169   if (__pyx_t_1) {
1170
1171     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":50
1172  *                                          ps_latnode_prob(dag, node, &best_exit))
1173  *         if best_exit != NULL:
1174  *             self.best_exit = LatLink()             # <<<<<<<<<<<<<<
1175  *             self.best_exit.set_link(dag, best_exit)
1176  * 
1177  */
1178     __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatLink)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1179     __Pyx_GOTREF(__pyx_t_2);
1180     __Pyx_GIVEREF(__pyx_t_2);
1181     __Pyx_GOTREF(__pyx_v_self->best_exit);
1182     __Pyx_DECREF(((PyObject *)__pyx_v_self->best_exit));
1183     __pyx_v_self->best_exit = ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_t_2);
1184     __pyx_t_2 = 0;
1185
1186     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":51
1187  *         if best_exit != NULL:
1188  *             self.best_exit = LatLink()
1189  *             self.best_exit.set_link(dag, best_exit)             # <<<<<<<<<<<<<<
1190  * 
1191  *     def exits(self):
1192  */
1193     __pyx_t_2 = ((struct __pyx_vtabstruct_12pocketsphinx_LatLink *)__pyx_v_self->best_exit->__pyx_vtab)->set_link(__pyx_v_self->best_exit, __pyx_v_dag, __pyx_v_best_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1194     __Pyx_GOTREF(__pyx_t_2);
1195     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1196     goto __pyx_L3;
1197   }
1198   __pyx_L3:;
1199
1200   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1201   goto __pyx_L0;
1202   __pyx_L1_error:;
1203   __Pyx_XDECREF(__pyx_t_2);
1204   __Pyx_AddTraceback("pocketsphinx.LatNode.set_node");
1205   __pyx_r = 0;
1206   __pyx_L0:;
1207   __Pyx_XGIVEREF(__pyx_r);
1208   __Pyx_RefNannyFinishContext();
1209   return __pyx_r;
1210 }
1211
1212 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":53
1213  *             self.best_exit.set_link(dag, best_exit)
1214  * 
1215  *     def exits(self):             # <<<<<<<<<<<<<<
1216  *         """
1217  *         Obtain an iterator over arcs exiting this node.
1218  */
1219
1220 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_exits(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1221 static char __pyx_doc_12pocketsphinx_7LatNode_exits[] = "\n        Obtain an iterator over arcs exiting this node.\n\n        @return: Iterator over arcs exiting this node\n        @rtype: LatLinkIterator\n        ";
1222 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_exits(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1223   struct __pyx_obj_12pocketsphinx_LatLinkIterator *__pyx_v_itor;
1224   ps_latlink_iter_t *__pyx_v_citor;
1225   PyObject *__pyx_r = NULL;
1226   PyObject *__pyx_t_1 = NULL;
1227   __Pyx_RefNannySetupContext("exits");
1228   __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)Py_None); __Pyx_INCREF(Py_None);
1229
1230   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":63
1231  *         cdef ps_latlink_iter_t *citor
1232  * 
1233  *         citor = ps_latnode_exits(self.node)             # <<<<<<<<<<<<<<
1234  *         itor = LatLinkIterator()
1235  *         itor.itor = citor
1236  */
1237   __pyx_v_citor = ps_latnode_exits(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->node);
1238
1239   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":64
1240  * 
1241  *         citor = ps_latnode_exits(self.node)
1242  *         itor = LatLinkIterator()             # <<<<<<<<<<<<<<
1243  *         itor.itor = citor
1244  *         itor.dag = self.dag
1245  */
1246   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatLinkIterator)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1247   __Pyx_GOTREF(__pyx_t_1);
1248   __Pyx_DECREF(((PyObject *)__pyx_v_itor));
1249   __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_t_1);
1250   __pyx_t_1 = 0;
1251
1252   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":65
1253  *         citor = ps_latnode_exits(self.node)
1254  *         itor = LatLinkIterator()
1255  *         itor.itor = citor             # <<<<<<<<<<<<<<
1256  *         itor.dag = self.dag
1257  *         return itor
1258  */
1259   __pyx_v_itor->itor = __pyx_v_citor;
1260
1261   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":66
1262  *         itor = LatLinkIterator()
1263  *         itor.itor = citor
1264  *         itor.dag = self.dag             # <<<<<<<<<<<<<<
1265  *         return itor
1266  * 
1267  */
1268   __pyx_v_itor->dag = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->dag;
1269
1270   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":67
1271  *         itor.itor = citor
1272  *         itor.dag = self.dag
1273  *         return itor             # <<<<<<<<<<<<<<
1274  * 
1275  *     def entries(self):
1276  */
1277   __Pyx_XDECREF(__pyx_r);
1278   __Pyx_INCREF(((PyObject *)__pyx_v_itor));
1279   __pyx_r = ((PyObject *)__pyx_v_itor);
1280   goto __pyx_L0;
1281
1282   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1283   goto __pyx_L0;
1284   __pyx_L1_error:;
1285   __Pyx_XDECREF(__pyx_t_1);
1286   __Pyx_AddTraceback("pocketsphinx.LatNode.exits");
1287   __pyx_r = NULL;
1288   __pyx_L0:;
1289   __Pyx_DECREF((PyObject *)__pyx_v_itor);
1290   __Pyx_XGIVEREF(__pyx_r);
1291   __Pyx_RefNannyFinishContext();
1292   return __pyx_r;
1293 }
1294
1295 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":69
1296  *         return itor
1297  * 
1298  *     def entries(self):             # <<<<<<<<<<<<<<
1299  *         """
1300  *         Obtain an iterator over arcs entering this node.
1301  */
1302
1303 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_entries(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1304 static char __pyx_doc_12pocketsphinx_7LatNode_entries[] = "\n        Obtain an iterator over arcs entering this node.\n\n        @return: Iterator over arcs entering this node\n        @rtype: LatLinkIterator\n        ";
1305 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_entries(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1306   struct __pyx_obj_12pocketsphinx_LatLinkIterator *__pyx_v_itor;
1307   ps_latlink_iter_t *__pyx_v_citor;
1308   PyObject *__pyx_r = NULL;
1309   PyObject *__pyx_t_1 = NULL;
1310   __Pyx_RefNannySetupContext("entries");
1311   __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)Py_None); __Pyx_INCREF(Py_None);
1312
1313   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":79
1314  *         cdef ps_latlink_iter_t *citor
1315  * 
1316  *         citor = ps_latnode_entries(self.node)             # <<<<<<<<<<<<<<
1317  *         itor = LatLinkIterator()
1318  *         itor.itor = citor
1319  */
1320   __pyx_v_citor = ps_latnode_entries(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->node);
1321
1322   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":80
1323  * 
1324  *         citor = ps_latnode_entries(self.node)
1325  *         itor = LatLinkIterator()             # <<<<<<<<<<<<<<
1326  *         itor.itor = citor
1327  *         itor.dag = self.dag
1328  */
1329   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatLinkIterator)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1330   __Pyx_GOTREF(__pyx_t_1);
1331   __Pyx_DECREF(((PyObject *)__pyx_v_itor));
1332   __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_t_1);
1333   __pyx_t_1 = 0;
1334
1335   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":81
1336  *         citor = ps_latnode_entries(self.node)
1337  *         itor = LatLinkIterator()
1338  *         itor.itor = citor             # <<<<<<<<<<<<<<
1339  *         itor.dag = self.dag
1340  *         return itor
1341  */
1342   __pyx_v_itor->itor = __pyx_v_citor;
1343
1344   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":82
1345  *         itor = LatLinkIterator()
1346  *         itor.itor = citor
1347  *         itor.dag = self.dag             # <<<<<<<<<<<<<<
1348  *         return itor
1349  * 
1350  */
1351   __pyx_v_itor->dag = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->dag;
1352
1353   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":83
1354  *         itor.itor = citor
1355  *         itor.dag = self.dag
1356  *         return itor             # <<<<<<<<<<<<<<
1357  * 
1358  * cdef class LatNodeIterator:
1359  */
1360   __Pyx_XDECREF(__pyx_r);
1361   __Pyx_INCREF(((PyObject *)__pyx_v_itor));
1362   __pyx_r = ((PyObject *)__pyx_v_itor);
1363   goto __pyx_L0;
1364
1365   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1366   goto __pyx_L0;
1367   __pyx_L1_error:;
1368   __Pyx_XDECREF(__pyx_t_1);
1369   __Pyx_AddTraceback("pocketsphinx.LatNode.entries");
1370   __pyx_r = NULL;
1371   __pyx_L0:;
1372   __Pyx_DECREF((PyObject *)__pyx_v_itor);
1373   __Pyx_XGIVEREF(__pyx_r);
1374   __Pyx_RefNannyFinishContext();
1375   return __pyx_r;
1376 }
1377
1378 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":89
1379  *     Iterator over word lattice nodes.
1380  *     """
1381  *     def __init__(self, start, end):             # <<<<<<<<<<<<<<
1382  *         self.itor = NULL
1383  *         self.first_node = True
1384  */
1385
1386 static int __pyx_pf_12pocketsphinx_15LatNodeIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1387 static int __pyx_pf_12pocketsphinx_15LatNodeIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1388   PyObject *__pyx_v_start = 0;
1389   PyObject *__pyx_v_end = 0;
1390   int __pyx_r;
1391   int __pyx_t_1;
1392   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0};
1393   __Pyx_RefNannySetupContext("__init__");
1394   if (unlikely(__pyx_kwds)) {
1395     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
1396     PyObject* values[2] = {0,0};
1397     switch (PyTuple_GET_SIZE(__pyx_args)) {
1398       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1399       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1400       case  0: break;
1401       default: goto __pyx_L5_argtuple_error;
1402     }
1403     switch (PyTuple_GET_SIZE(__pyx_args)) {
1404       case  0:
1405       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
1406       if (likely(values[0])) kw_args--;
1407       else goto __pyx_L5_argtuple_error;
1408       case  1:
1409       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
1410       if (likely(values[1])) kw_args--;
1411       else {
1412         __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1413       }
1414     }
1415     if (unlikely(kw_args > 0)) {
1416       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1417     }
1418     __pyx_v_start = values[0];
1419     __pyx_v_end = values[1];
1420   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
1421     goto __pyx_L5_argtuple_error;
1422   } else {
1423     __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0);
1424     __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 1);
1425   }
1426   goto __pyx_L4_argument_unpacking_done;
1427   __pyx_L5_argtuple_error:;
1428   __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1429   __pyx_L3_error:;
1430   __Pyx_AddTraceback("pocketsphinx.LatNodeIterator.__init__");
1431   __Pyx_RefNannyFinishContext();
1432   return -1;
1433   __pyx_L4_argument_unpacking_done:;
1434
1435   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":90
1436  *     """
1437  *     def __init__(self, start, end):
1438  *         self.itor = NULL             # <<<<<<<<<<<<<<
1439  *         self.first_node = True
1440  *         self.start = start
1441  */
1442   ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor = NULL;
1443
1444   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":91
1445  *     def __init__(self, start, end):
1446  *         self.itor = NULL
1447  *         self.first_node = True             # <<<<<<<<<<<<<<
1448  *         self.start = start
1449  *         self.end = end
1450  */
1451   ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->first_node = 1;
1452
1453   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":92
1454  *         self.itor = NULL
1455  *         self.first_node = True
1456  *         self.start = start             # <<<<<<<<<<<<<<
1457  *         self.end = end
1458  * 
1459  */
1460   __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_start); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1461   ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->start = __pyx_t_1;
1462
1463   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":93
1464  *         self.first_node = True
1465  *         self.start = start
1466  *         self.end = end             # <<<<<<<<<<<<<<
1467  * 
1468  *     def __iter__(self):
1469  */
1470   __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_end); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1471   ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->end = __pyx_t_1;
1472
1473   __pyx_r = 0;
1474   goto __pyx_L0;
1475   __pyx_L1_error:;
1476   __Pyx_AddTraceback("pocketsphinx.LatNodeIterator.__init__");
1477   __pyx_r = -1;
1478   __pyx_L0:;
1479   __Pyx_RefNannyFinishContext();
1480   return __pyx_r;
1481 }
1482
1483 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":95
1484  *         self.end = end
1485  * 
1486  *     def __iter__(self):             # <<<<<<<<<<<<<<
1487  *         return self
1488  * 
1489  */
1490
1491 static PyObject *__pyx_pf_12pocketsphinx_15LatNodeIterator___iter__(PyObject *__pyx_v_self); /*proto*/
1492 static PyObject *__pyx_pf_12pocketsphinx_15LatNodeIterator___iter__(PyObject *__pyx_v_self) {
1493   PyObject *__pyx_r = NULL;
1494   __Pyx_RefNannySetupContext("__iter__");
1495
1496   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":96
1497  * 
1498  *     def __iter__(self):
1499  *         return self             # <<<<<<<<<<<<<<
1500  * 
1501  *     def __next__(self):
1502  */
1503   __Pyx_XDECREF(__pyx_r);
1504   __Pyx_INCREF(__pyx_v_self);
1505   __pyx_r = __pyx_v_self;
1506   goto __pyx_L0;
1507
1508   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1509   __pyx_L0:;
1510   __Pyx_XGIVEREF(__pyx_r);
1511   __Pyx_RefNannyFinishContext();
1512   return __pyx_r;
1513 }
1514
1515 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":98
1516  *         return self
1517  * 
1518  *     def __next__(self):             # <<<<<<<<<<<<<<
1519  *         """
1520  *         Advance iterator and return the next node.
1521  */
1522
1523 static PyObject *__pyx_pf_12pocketsphinx_15LatNodeIterator___next__(PyObject *__pyx_v_self); /*proto*/
1524 static char __pyx_doc_12pocketsphinx_15LatNodeIterator___next__[] = "\n        Advance iterator and return the next node.\n\n        @return: Next lattice node in this iterator.\n        @rtype: LatNode\n        ";
1525 struct wrapperbase __pyx_wrapperbase_12pocketsphinx_15LatNodeIterator___next__;
1526 static PyObject *__pyx_pf_12pocketsphinx_15LatNodeIterator___next__(PyObject *__pyx_v_self) {
1527   struct __pyx_obj_12pocketsphinx_LatNode *__pyx_v_node;
1528   int __pyx_v_start;
1529   ps_latnode_t *__pyx_v_cnode;
1530   PyObject *__pyx_r = NULL;
1531   int __pyx_t_1;
1532   int __pyx_t_2;
1533   int __pyx_t_3;
1534   PyObject *__pyx_t_4 = NULL;
1535   __Pyx_RefNannySetupContext("__next__");
1536   __pyx_v_node = ((struct __pyx_obj_12pocketsphinx_LatNode *)Py_None); __Pyx_INCREF(Py_None);
1537
1538   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":110
1539  * 
1540  *         # Make sure we keep raising exceptions at the end
1541  *         if self.itor == NULL:             # <<<<<<<<<<<<<<
1542  *             raise StopIteration
1543  *         # Advance the iterator if this isn't the first item
1544  */
1545   __pyx_t_1 = (((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor == NULL);
1546   if (__pyx_t_1) {
1547
1548     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":111
1549  *         # Make sure we keep raising exceptions at the end
1550  *         if self.itor == NULL:
1551  *             raise StopIteration             # <<<<<<<<<<<<<<
1552  *         # Advance the iterator if this isn't the first item
1553  *         if self.first_node:
1554  */
1555     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
1556     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1557     goto __pyx_L5;
1558   }
1559   __pyx_L5:;
1560
1561   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":113
1562  *             raise StopIteration
1563  *         # Advance the iterator if this isn't the first item
1564  *         if self.first_node:             # <<<<<<<<<<<<<<
1565  *             self.first_node = False
1566  *         else:
1567  */
1568   if (((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->first_node) {
1569
1570     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":114
1571  *         # Advance the iterator if this isn't the first item
1572  *         if self.first_node:
1573  *             self.first_node = False             # <<<<<<<<<<<<<<
1574  *         else:
1575  *             self.itor = ps_latnode_iter_next(self.itor)
1576  */
1577     ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->first_node = 0;
1578     goto __pyx_L6;
1579   }
1580   /*else*/ {
1581
1582     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":116
1583  *             self.first_node = False
1584  *         else:
1585  *             self.itor = ps_latnode_iter_next(self.itor)             # <<<<<<<<<<<<<<
1586  *             if self.itor == NULL:
1587  *                 raise StopIteration
1588  */
1589     ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor = ps_latnode_iter_next(((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor);
1590
1591     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":117
1592  *         else:
1593  *             self.itor = ps_latnode_iter_next(self.itor)
1594  *             if self.itor == NULL:             # <<<<<<<<<<<<<<
1595  *                 raise StopIteration
1596  *         # Look for the next node within the given time range
1597  */
1598     __pyx_t_1 = (((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor == NULL);
1599     if (__pyx_t_1) {
1600
1601       /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":118
1602  *             self.itor = ps_latnode_iter_next(self.itor)
1603  *             if self.itor == NULL:
1604  *                 raise StopIteration             # <<<<<<<<<<<<<<
1605  *         # Look for the next node within the given time range
1606  *         cnode = ps_latnode_iter_node(self.itor)
1607  */
1608       __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
1609       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1610       goto __pyx_L7;
1611     }
1612     __pyx_L7:;
1613   }
1614   __pyx_L6:;
1615
1616   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":120
1617  *                 raise StopIteration
1618  *         # Look for the next node within the given time range
1619  *         cnode = ps_latnode_iter_node(self.itor)             # <<<<<<<<<<<<<<
1620  *         start = ps_latnode_times(cnode, NULL, NULL)
1621  *         while start < self.start or start >= self.end:
1622  */
1623   __pyx_v_cnode = ps_latnode_iter_node(((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor);
1624
1625   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":121
1626  *         # Look for the next node within the given time range
1627  *         cnode = ps_latnode_iter_node(self.itor)
1628  *         start = ps_latnode_times(cnode, NULL, NULL)             # <<<<<<<<<<<<<<
1629  *         while start < self.start or start >= self.end:
1630  *             self.itor = ps_latnode_iter_next(self.itor)
1631  */
1632   __pyx_v_start = ps_latnode_times(__pyx_v_cnode, NULL, NULL);
1633
1634   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":122
1635  *         cnode = ps_latnode_iter_node(self.itor)
1636  *         start = ps_latnode_times(cnode, NULL, NULL)
1637  *         while start < self.start or start >= self.end:             # <<<<<<<<<<<<<<
1638  *             self.itor = ps_latnode_iter_next(self.itor)
1639  *             if self.itor == NULL:
1640  */
1641   while (1) {
1642     __pyx_t_1 = (__pyx_v_start < ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->start);
1643     if (!__pyx_t_1) {
1644       __pyx_t_2 = (__pyx_v_start >= ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->end);
1645       __pyx_t_3 = __pyx_t_2;
1646     } else {
1647       __pyx_t_3 = __pyx_t_1;
1648     }
1649     if (!__pyx_t_3) break;
1650
1651     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":123
1652  *         start = ps_latnode_times(cnode, NULL, NULL)
1653  *         while start < self.start or start >= self.end:
1654  *             self.itor = ps_latnode_iter_next(self.itor)             # <<<<<<<<<<<<<<
1655  *             if self.itor == NULL:
1656  *                 raise StopIteration
1657  */
1658     ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor = ps_latnode_iter_next(((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor);
1659
1660     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":124
1661  *         while start < self.start or start >= self.end:
1662  *             self.itor = ps_latnode_iter_next(self.itor)
1663  *             if self.itor == NULL:             # <<<<<<<<<<<<<<
1664  *                 raise StopIteration
1665  *             cnode = ps_latnode_iter_node(self.itor)
1666  */
1667     __pyx_t_3 = (((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor == NULL);
1668     if (__pyx_t_3) {
1669
1670       /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":125
1671  *             self.itor = ps_latnode_iter_next(self.itor)
1672  *             if self.itor == NULL:
1673  *                 raise StopIteration             # <<<<<<<<<<<<<<
1674  *             cnode = ps_latnode_iter_node(self.itor)
1675  *             start = ps_latnode_times(cnode, NULL, NULL)
1676  */
1677       __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
1678       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1679       goto __pyx_L10;
1680     }
1681     __pyx_L10:;
1682
1683     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":126
1684  *             if self.itor == NULL:
1685  *                 raise StopIteration
1686  *             cnode = ps_latnode_iter_node(self.itor)             # <<<<<<<<<<<<<<
1687  *             start = ps_latnode_times(cnode, NULL, NULL)
1688  *         node = LatNode()
1689  */
1690     __pyx_v_cnode = ps_latnode_iter_node(((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor);
1691
1692     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":127
1693  *                 raise StopIteration
1694  *             cnode = ps_latnode_iter_node(self.itor)
1695  *             start = ps_latnode_times(cnode, NULL, NULL)             # <<<<<<<<<<<<<<
1696  *         node = LatNode()
1697  *         node.set_node(self.dag, cnode)
1698  */
1699     __pyx_v_start = ps_latnode_times(__pyx_v_cnode, NULL, NULL);
1700   }
1701
1702   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":128
1703  *             cnode = ps_latnode_iter_node(self.itor)
1704  *             start = ps_latnode_times(cnode, NULL, NULL)
1705  *         node = LatNode()             # <<<<<<<<<<<<<<
1706  *         node.set_node(self.dag, cnode)
1707  *         return node
1708  */
1709   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1710   __Pyx_GOTREF(__pyx_t_4);
1711   __Pyx_DECREF(((PyObject *)__pyx_v_node));
1712   __pyx_v_node = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_t_4);
1713   __pyx_t_4 = 0;
1714
1715   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":129
1716  *             start = ps_latnode_times(cnode, NULL, NULL)
1717  *         node = LatNode()
1718  *         node.set_node(self.dag, cnode)             # <<<<<<<<<<<<<<
1719  *         return node
1720  * 
1721  */
1722   __pyx_t_4 = ((struct __pyx_vtabstruct_12pocketsphinx_LatNode *)__pyx_v_node->__pyx_vtab)->set_node(__pyx_v_node, ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->dag, __pyx_v_cnode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1723   __Pyx_GOTREF(__pyx_t_4);
1724   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1725
1726   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":130
1727  *         node = LatNode()
1728  *         node.set_node(self.dag, cnode)
1729  *         return node             # <<<<<<<<<<<<<<
1730  * 
1731  * cdef class LatLink:
1732  */
1733   __Pyx_XDECREF(__pyx_r);
1734   __Pyx_INCREF(((PyObject *)__pyx_v_node));
1735   __pyx_r = ((PyObject *)__pyx_v_node);
1736   goto __pyx_L0;
1737
1738   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1739   goto __pyx_L0;
1740   __pyx_L1_error:;
1741   __Pyx_XDECREF(__pyx_t_4);
1742   __Pyx_AddTraceback("pocketsphinx.LatNodeIterator.__next__");
1743   __pyx_r = NULL;
1744   __pyx_L0:;
1745   __Pyx_DECREF((PyObject *)__pyx_v_node);
1746   __Pyx_XGIVEREF(__pyx_r);
1747   __Pyx_RefNannyFinishContext();
1748   return __pyx_r;
1749 }
1750
1751 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":147
1752  *     @type prob: float
1753  *     """
1754  *     def __cinit__(self):             # <<<<<<<<<<<<<<
1755  *         self.link = NULL
1756  * 
1757  */
1758
1759 static int __pyx_pf_12pocketsphinx_7LatLink___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1760 static int __pyx_pf_12pocketsphinx_7LatLink___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1761   int __pyx_r;
1762   __Pyx_RefNannySetupContext("__cinit__");
1763   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
1764     __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
1765   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
1766
1767   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":148
1768  *     """
1769  *     def __cinit__(self):
1770  *         self.link = NULL             # <<<<<<<<<<<<<<
1771  * 
1772  *     cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link):
1773  */
1774   ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->link = NULL;
1775
1776   __pyx_r = 0;
1777   __Pyx_RefNannyFinishContext();
1778   return __pyx_r;
1779 }
1780
1781 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":150
1782  *         self.link = NULL
1783  * 
1784  *     cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link):             # <<<<<<<<<<<<<<
1785  *         """
1786  *         Internal function - binds this to a PocketSphinx lattice link.
1787  */
1788
1789 static  PyObject *__pyx_f_12pocketsphinx_7LatLink_set_link(struct __pyx_obj_12pocketsphinx_LatLink *__pyx_v_self, ps_lattice_t *__pyx_v_dag, ps_latlink_t *__pyx_v_link) {
1790   short __pyx_v_sf;
1791   PyObject *__pyx_r = NULL;
1792   __Pyx_RefNannySetupContext("set_link");
1793
1794   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":155
1795  *         """
1796  *         cdef short sf
1797  *         self.dag = dag             # <<<<<<<<<<<<<<
1798  *         self.link = link
1799  *         self.word = ps_latlink_word(dag, link)
1800  */
1801   __pyx_v_self->dag = __pyx_v_dag;
1802
1803   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":156
1804  *         cdef short sf
1805  *         self.dag = dag
1806  *         self.link = link             # <<<<<<<<<<<<<<
1807  *         self.word = ps_latlink_word(dag, link)
1808  *         self.baseword = ps_latlink_baseword(dag, link)
1809  */
1810   __pyx_v_self->link = __pyx_v_link;
1811
1812   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":157
1813  *         self.dag = dag
1814  *         self.link = link
1815  *         self.word = ps_latlink_word(dag, link)             # <<<<<<<<<<<<<<
1816  *         self.baseword = ps_latlink_baseword(dag, link)
1817  *         self.ef = ps_latlink_times(link, &sf)
1818  */
1819   __pyx_v_self->word = ps_latlink_word(__pyx_v_dag, __pyx_v_link);
1820
1821   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":158
1822  *         self.link = link
1823  *         self.word = ps_latlink_word(dag, link)
1824  *         self.baseword = ps_latlink_baseword(dag, link)             # <<<<<<<<<<<<<<
1825  *         self.ef = ps_latlink_times(link, &sf)
1826  *         self.sf = sf
1827  */
1828   __pyx_v_self->baseword = ps_latlink_baseword(__pyx_v_dag, __pyx_v_link);
1829
1830   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":159
1831  *         self.word = ps_latlink_word(dag, link)
1832  *         self.baseword = ps_latlink_baseword(dag, link)
1833  *         self.ef = ps_latlink_times(link, &sf)             # <<<<<<<<<<<<<<
1834  *         self.sf = sf
1835  *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
1836  */
1837   __pyx_v_self->ef = ps_latlink_times(__pyx_v_link, (&__pyx_v_sf));
1838
1839   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":160
1840  *         self.baseword = ps_latlink_baseword(dag, link)
1841  *         self.ef = ps_latlink_times(link, &sf)
1842  *         self.sf = sf             # <<<<<<<<<<<<<<
1843  *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
1844  *                                          ps_latlink_prob(dag, link, NULL))
1845  */
1846   __pyx_v_self->sf = __pyx_v_sf;
1847
1848   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":161
1849  *         self.ef = ps_latlink_times(link, &sf)
1850  *         self.sf = sf
1851  *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),             # <<<<<<<<<<<<<<
1852  *                                          ps_latlink_prob(dag, link, NULL))
1853  * 
1854  */
1855   __pyx_v_self->prob = logmath_log_to_ln(ps_lattice_get_logmath(__pyx_v_dag), ps_latlink_prob(__pyx_v_dag, __pyx_v_link, NULL));
1856
1857   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1858   __Pyx_XGIVEREF(__pyx_r);
1859   __Pyx_RefNannyFinishContext();
1860   return __pyx_r;
1861 }
1862
1863 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":164
1864  *                                          ps_latlink_prob(dag, link, NULL))
1865  * 
1866  *     def nodes(self):             # <<<<<<<<<<<<<<
1867  *         """
1868  *         Get source and destination nodes for this link.
1869  */
1870
1871 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1872 static char __pyx_doc_12pocketsphinx_7LatLink_nodes[] = "\n        Get source and destination nodes for this link.\n\n        @return: Source and destination nodes for this link\n        @rtype: (LatNode, LatNode)\n        ";
1873 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1874   struct __pyx_obj_12pocketsphinx_LatNode *__pyx_v_src;
1875   struct __pyx_obj_12pocketsphinx_LatNode *__pyx_v_dest;
1876   ps_latnode_t *__pyx_v_csrc;
1877   ps_latnode_t *__pyx_v_cdest;
1878   PyObject *__pyx_r = NULL;
1879   PyObject *__pyx_t_1 = NULL;
1880   __Pyx_RefNannySetupContext("nodes");
1881   __pyx_v_src = ((struct __pyx_obj_12pocketsphinx_LatNode *)Py_None); __Pyx_INCREF(Py_None);
1882   __pyx_v_dest = ((struct __pyx_obj_12pocketsphinx_LatNode *)Py_None); __Pyx_INCREF(Py_None);
1883
1884   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":174
1885  *         cdef ps_latnode_t *csrc, *cdest
1886  * 
1887  *         cdest = ps_latlink_nodes(self.link, &csrc)             # <<<<<<<<<<<<<<
1888  *         src = LatNode()
1889  *         src.set_node(self.dag, csrc)
1890  */
1891   __pyx_v_cdest = ps_latlink_nodes(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->link, (&__pyx_v_csrc));
1892
1893   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":175
1894  * 
1895  *         cdest = ps_latlink_nodes(self.link, &csrc)
1896  *         src = LatNode()             # <<<<<<<<<<<<<<
1897  *         src.set_node(self.dag, csrc)
1898  *         dest = LatNode()
1899  */
1900   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1901   __Pyx_GOTREF(__pyx_t_1);
1902   __Pyx_DECREF(((PyObject *)__pyx_v_src));
1903   __pyx_v_src = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_t_1);
1904   __pyx_t_1 = 0;
1905
1906   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":176
1907  *         cdest = ps_latlink_nodes(self.link, &csrc)
1908  *         src = LatNode()
1909  *         src.set_node(self.dag, csrc)             # <<<<<<<<<<<<<<
1910  *         dest = LatNode()
1911  *         dest.set_node(self.dag, cdest)
1912  */
1913   __pyx_t_1 = ((struct __pyx_vtabstruct_12pocketsphinx_LatNode *)__pyx_v_src->__pyx_vtab)->set_node(__pyx_v_src, ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->dag, __pyx_v_csrc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1914   __Pyx_GOTREF(__pyx_t_1);
1915   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1916
1917   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":177
1918  *         src = LatNode()
1919  *         src.set_node(self.dag, csrc)
1920  *         dest = LatNode()             # <<<<<<<<<<<<<<
1921  *         dest.set_node(self.dag, cdest)
1922  *         return src, dest
1923  */
1924   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1925   __Pyx_GOTREF(__pyx_t_1);
1926   __Pyx_DECREF(((PyObject *)__pyx_v_dest));
1927   __pyx_v_dest = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_t_1);
1928   __pyx_t_1 = 0;
1929
1930   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":178
1931  *         src.set_node(self.dag, csrc)
1932  *         dest = LatNode()
1933  *         dest.set_node(self.dag, cdest)             # <<<<<<<<<<<<<<
1934  *         return src, dest
1935  * 
1936  */
1937   __pyx_t_1 = ((struct __pyx_vtabstruct_12pocketsphinx_LatNode *)__pyx_v_dest->__pyx_vtab)->set_node(__pyx_v_dest, ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->dag, __pyx_v_cdest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1938   __Pyx_GOTREF(__pyx_t_1);
1939   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1940
1941   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":179
1942  *         dest = LatNode()
1943  *         dest.set_node(self.dag, cdest)
1944  *         return src, dest             # <<<<<<<<<<<<<<
1945  * 
1946  *     def pred(self):
1947  */
1948   __Pyx_XDECREF(__pyx_r);
1949   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1950   __Pyx_GOTREF(__pyx_t_1);
1951   __Pyx_INCREF(((PyObject *)__pyx_v_src));
1952   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_src));
1953   __Pyx_GIVEREF(((PyObject *)__pyx_v_src));
1954   __Pyx_INCREF(((PyObject *)__pyx_v_dest));
1955   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_dest));
1956   __Pyx_GIVEREF(((PyObject *)__pyx_v_dest));
1957   __pyx_r = __pyx_t_1;
1958   __pyx_t_1 = 0;
1959   goto __pyx_L0;
1960
1961   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1962   goto __pyx_L0;
1963   __pyx_L1_error:;
1964   __Pyx_XDECREF(__pyx_t_1);
1965   __Pyx_AddTraceback("pocketsphinx.LatLink.nodes");
1966   __pyx_r = NULL;
1967   __pyx_L0:;
1968   __Pyx_DECREF((PyObject *)__pyx_v_src);
1969   __Pyx_DECREF((PyObject *)__pyx_v_dest);
1970   __Pyx_XGIVEREF(__pyx_r);
1971   __Pyx_RefNannyFinishContext();
1972   return __pyx_r;
1973 }
1974
1975 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":181
1976  *         return src, dest
1977  * 
1978  *     def pred(self):             # <<<<<<<<<<<<<<
1979  *         """
1980  *         Get backpointer from this link.
1981  */
1982
1983 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_pred(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1984 static char __pyx_doc_12pocketsphinx_7LatLink_pred[] = "\n        Get backpointer from this link.\n\n        @return: Backpointer from this link, set by bestpath search.\n        @rtype: LatLink\n        ";
1985 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_pred(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1986   struct __pyx_obj_12pocketsphinx_LatLink *__pyx_v_pred;
1987   ps_latlink_t *__pyx_v_cpred;
1988   PyObject *__pyx_r = NULL;
1989   int __pyx_t_1;
1990   PyObject *__pyx_t_2 = NULL;
1991   __Pyx_RefNannySetupContext("pred");
1992   __pyx_v_pred = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); __Pyx_INCREF(Py_None);
1993
1994   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":191
1995  *         cdef ps_latlink_t *cpred
1996  * 
1997  *         cpred = ps_latlink_pred(self.link)             # <<<<<<<<<<<<<<
1998  *         if cpred == NULL:
1999  *             return None
2000  */
2001   __pyx_v_cpred = ps_latlink_pred(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->link);
2002
2003   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":192
2004  * 
2005  *         cpred = ps_latlink_pred(self.link)
2006  *         if cpred == NULL:             # <<<<<<<<<<<<<<
2007  *             return None
2008  *         pred = LatLink()
2009  */
2010   __pyx_t_1 = (__pyx_v_cpred == NULL);
2011   if (__pyx_t_1) {
2012
2013     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":193
2014  *         cpred = ps_latlink_pred(self.link)
2015  *         if cpred == NULL:
2016  *             return None             # <<<<<<<<<<<<<<
2017  *         pred = LatLink()
2018  *         pred.set_link(self.dag, cpred)
2019  */
2020     __Pyx_XDECREF(__pyx_r);
2021     __Pyx_INCREF(Py_None);
2022     __pyx_r = Py_None;
2023     goto __pyx_L0;
2024     goto __pyx_L5;
2025   }
2026   __pyx_L5:;
2027
2028   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":194
2029  *         if cpred == NULL:
2030  *             return None
2031  *         pred = LatLink()             # <<<<<<<<<<<<<<
2032  *         pred.set_link(self.dag, cpred)
2033  *         return pred
2034  */
2035   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatLink)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2036   __Pyx_GOTREF(__pyx_t_2);
2037   __Pyx_DECREF(((PyObject *)__pyx_v_pred));
2038   __pyx_v_pred = ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_t_2);
2039   __pyx_t_2 = 0;
2040
2041   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":195
2042  *             return None
2043  *         pred = LatLink()
2044  *         pred.set_link(self.dag, cpred)             # <<<<<<<<<<<<<<
2045  *         return pred
2046  * 
2047  */
2048   __pyx_t_2 = ((struct __pyx_vtabstruct_12pocketsphinx_LatLink *)__pyx_v_pred->__pyx_vtab)->set_link(__pyx_v_pred, ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->dag, __pyx_v_cpred); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2049   __Pyx_GOTREF(__pyx_t_2);
2050   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2051
2052   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":196
2053  *         pred = LatLink()
2054  *         pred.set_link(self.dag, cpred)
2055  *         return pred             # <<<<<<<<<<<<<<
2056  * 
2057  * cdef class LatLinkIterator:
2058  */
2059   __Pyx_XDECREF(__pyx_r);
2060   __Pyx_INCREF(((PyObject *)__pyx_v_pred));
2061   __pyx_r = ((PyObject *)__pyx_v_pred);
2062   goto __pyx_L0;
2063
2064   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2065   goto __pyx_L0;
2066   __pyx_L1_error:;
2067   __Pyx_XDECREF(__pyx_t_2);
2068   __Pyx_AddTraceback("pocketsphinx.LatLink.pred");
2069   __pyx_r = NULL;
2070   __pyx_L0:;
2071   __Pyx_DECREF((PyObject *)__pyx_v_pred);
2072   __Pyx_XGIVEREF(__pyx_r);
2073   __Pyx_RefNannyFinishContext();
2074   return __pyx_r;
2075 }
2076
2077 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":202
2078  *     Iterator over word lattice links.
2079  *     """
2080  *     def __cinit__(self):             # <<<<<<<<<<<<<<
2081  *         self.itor = NULL
2082  *         self.first_link = True
2083  */
2084
2085 static int __pyx_pf_12pocketsphinx_15LatLinkIterator___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2086 static int __pyx_pf_12pocketsphinx_15LatLinkIterator___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2087   int __pyx_r;
2088   __Pyx_RefNannySetupContext("__cinit__");
2089   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
2090     __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
2091   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
2092
2093   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":203
2094  *     """
2095  *     def __cinit__(self):
2096  *         self.itor = NULL             # <<<<<<<<<<<<<<
2097  *         self.first_link = True
2098  * 
2099  */
2100   ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor = NULL;
2101
2102   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":204
2103  *     def __cinit__(self):
2104  *         self.itor = NULL
2105  *         self.first_link = True             # <<<<<<<<<<<<<<
2106  * 
2107  *     def __iter__(self):
2108  */
2109   ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->first_link = 1;
2110
2111   __pyx_r = 0;
2112   __Pyx_RefNannyFinishContext();
2113   return __pyx_r;
2114 }
2115
2116 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":206
2117  *         self.first_link = True
2118  * 
2119  *     def __iter__(self):             # <<<<<<<<<<<<<<
2120  *         return self
2121  * 
2122  */
2123
2124 static PyObject *__pyx_pf_12pocketsphinx_15LatLinkIterator___iter__(PyObject *__pyx_v_self); /*proto*/
2125 static PyObject *__pyx_pf_12pocketsphinx_15LatLinkIterator___iter__(PyObject *__pyx_v_self) {
2126   PyObject *__pyx_r = NULL;
2127   __Pyx_RefNannySetupContext("__iter__");
2128
2129   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":207
2130  * 
2131  *     def __iter__(self):
2132  *         return self             # <<<<<<<<<<<<<<
2133  * 
2134  *     def __next__(self):
2135  */
2136   __Pyx_XDECREF(__pyx_r);
2137   __Pyx_INCREF(__pyx_v_self);
2138   __pyx_r = __pyx_v_self;
2139   goto __pyx_L0;
2140
2141   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2142   __pyx_L0:;
2143   __Pyx_XGIVEREF(__pyx_r);
2144   __Pyx_RefNannyFinishContext();
2145   return __pyx_r;
2146 }
2147
2148 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":209
2149  *         return self
2150  * 
2151  *     def __next__(self):             # <<<<<<<<<<<<<<
2152  *         """
2153  *         Advance iterator and return the next link.
2154  */
2155
2156 static PyObject *__pyx_pf_12pocketsphinx_15LatLinkIterator___next__(PyObject *__pyx_v_self); /*proto*/
2157 static char __pyx_doc_12pocketsphinx_15LatLinkIterator___next__[] = "\n        Advance iterator and return the next link.\n\n        @return: Next lattice link in this iterator.\n        @rtype: LatLink\n        ";
2158 struct wrapperbase __pyx_wrapperbase_12pocketsphinx_15LatLinkIterator___next__;
2159 static PyObject *__pyx_pf_12pocketsphinx_15LatLinkIterator___next__(PyObject *__pyx_v_self) {
2160   struct __pyx_obj_12pocketsphinx_LatLink *__pyx_v_link;
2161   PyObject *__pyx_r = NULL;
2162   int __pyx_t_1;
2163   PyObject *__pyx_t_2 = NULL;
2164   __Pyx_RefNannySetupContext("__next__");
2165   __pyx_v_link = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); __Pyx_INCREF(Py_None);
2166
2167   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":217
2168  *         """
2169  *         cdef LatLink link
2170  *         if self.first_link:             # <<<<<<<<<<<<<<
2171  *             self.first_link = False
2172  *         else:
2173  */
2174   if (((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->first_link) {
2175
2176     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":218
2177  *         cdef LatLink link
2178  *         if self.first_link:
2179  *             self.first_link = False             # <<<<<<<<<<<<<<
2180  *         else:
2181  *             self.itor = ps_latlink_iter_next(self.itor)
2182  */
2183     ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->first_link = 0;
2184     goto __pyx_L5;
2185   }
2186   /*else*/ {
2187
2188     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":220
2189  *             self.first_link = False
2190  *         else:
2191  *             self.itor = ps_latlink_iter_next(self.itor)             # <<<<<<<<<<<<<<
2192  *         if self.itor == NULL:
2193  *             raise StopIteration
2194  */
2195     ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor = ps_latlink_iter_next(((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor);
2196   }
2197   __pyx_L5:;
2198
2199   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":221
2200  *         else:
2201  *             self.itor = ps_latlink_iter_next(self.itor)
2202  *         if self.itor == NULL:             # <<<<<<<<<<<<<<
2203  *             raise StopIteration
2204  *         link = LatLink()
2205  */
2206   __pyx_t_1 = (((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor == NULL);
2207   if (__pyx_t_1) {
2208
2209     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":222
2210  *             self.itor = ps_latlink_iter_next(self.itor)
2211  *         if self.itor == NULL:
2212  *             raise StopIteration             # <<<<<<<<<<<<<<
2213  *         link = LatLink()
2214  *         link.set_link(self.dag, ps_latlink_iter_link(self.itor))
2215  */
2216     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
2217     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2218     goto __pyx_L6;
2219   }
2220   __pyx_L6:;
2221
2222   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":223
2223  *         if self.itor == NULL:
2224  *             raise StopIteration
2225  *         link = LatLink()             # <<<<<<<<<<<<<<
2226  *         link.set_link(self.dag, ps_latlink_iter_link(self.itor))
2227  *         return link
2228  */
2229   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatLink)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2230   __Pyx_GOTREF(__pyx_t_2);
2231   __Pyx_DECREF(((PyObject *)__pyx_v_link));
2232   __pyx_v_link = ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_t_2);
2233   __pyx_t_2 = 0;
2234
2235   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":224
2236  *             raise StopIteration
2237  *         link = LatLink()
2238  *         link.set_link(self.dag, ps_latlink_iter_link(self.itor))             # <<<<<<<<<<<<<<
2239  *         return link
2240  * 
2241  */
2242   __pyx_t_2 = ((struct __pyx_vtabstruct_12pocketsphinx_LatLink *)__pyx_v_link->__pyx_vtab)->set_link(__pyx_v_link, ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->dag, ps_latlink_iter_link(((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2243   __Pyx_GOTREF(__pyx_t_2);
2244   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2245
2246   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":225
2247  *         link = LatLink()
2248  *         link.set_link(self.dag, ps_latlink_iter_link(self.itor))
2249  *         return link             # <<<<<<<<<<<<<<
2250  * 
2251  * cdef class Lattice:
2252  */
2253   __Pyx_XDECREF(__pyx_r);
2254   __Pyx_INCREF(((PyObject *)__pyx_v_link));
2255   __pyx_r = ((PyObject *)__pyx_v_link);
2256   goto __pyx_L0;
2257
2258   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2259   goto __pyx_L0;
2260   __pyx_L1_error:;
2261   __Pyx_XDECREF(__pyx_t_2);
2262   __Pyx_AddTraceback("pocketsphinx.LatLinkIterator.__next__");
2263   __pyx_r = NULL;
2264   __pyx_L0:;
2265   __Pyx_DECREF((PyObject *)__pyx_v_link);
2266   __Pyx_XGIVEREF(__pyx_r);
2267   __Pyx_RefNannyFinishContext();
2268   return __pyx_r;
2269 }
2270
2271 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":254
2272  *     @type end: LatNode
2273  *     """
2274  *     def __init__(self, ps=None, latfile=None, boxed=None):             # <<<<<<<<<<<<<<
2275  *         self.dag = NULL
2276  *         if latfile:
2277  */
2278
2279 static int __pyx_pf_12pocketsphinx_7Lattice___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2280 static int __pyx_pf_12pocketsphinx_7Lattice___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2281   PyObject *__pyx_v_ps = 0;
2282   PyObject *__pyx_v_latfile = 0;
2283   PyObject *__pyx_v_boxed = 0;
2284   int __pyx_r;
2285   int __pyx_t_1;
2286   PyObject *__pyx_t_2 = NULL;
2287   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ps,&__pyx_n_s__latfile,&__pyx_n_s__boxed,0};
2288   __Pyx_RefNannySetupContext("__init__");
2289   if (unlikely(__pyx_kwds)) {
2290     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2291     PyObject* values[3] = {0,0,0};
2292     values[0] = ((PyObject *)Py_None);
2293     values[1] = ((PyObject *)Py_None);
2294     values[2] = ((PyObject *)Py_None);
2295     switch (PyTuple_GET_SIZE(__pyx_args)) {
2296       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2297       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2298       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2299       case  0: break;
2300       default: goto __pyx_L5_argtuple_error;
2301     }
2302     switch (PyTuple_GET_SIZE(__pyx_args)) {
2303       case  0:
2304       if (kw_args > 0) {
2305         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ps);
2306         if (value) { values[0] = value; kw_args--; }
2307       }
2308       case  1:
2309       if (kw_args > 0) {
2310         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__latfile);
2311         if (value) { values[1] = value; kw_args--; }
2312       }
2313       case  2:
2314       if (kw_args > 0) {
2315         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__boxed);
2316         if (value) { values[2] = value; kw_args--; }
2317       }
2318     }
2319     if (unlikely(kw_args > 0)) {
2320       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2321     }
2322     __pyx_v_ps = values[0];
2323     __pyx_v_latfile = values[1];
2324     __pyx_v_boxed = values[2];
2325   } else {
2326     __pyx_v_ps = ((PyObject *)Py_None);
2327     __pyx_v_latfile = ((PyObject *)Py_None);
2328     __pyx_v_boxed = ((PyObject *)Py_None);
2329     switch (PyTuple_GET_SIZE(__pyx_args)) {
2330       case  3: __pyx_v_boxed = PyTuple_GET_ITEM(__pyx_args, 2);
2331       case  2: __pyx_v_latfile = PyTuple_GET_ITEM(__pyx_args, 1);
2332       case  1: __pyx_v_ps = PyTuple_GET_ITEM(__pyx_args, 0);
2333       case  0: break;
2334       default: goto __pyx_L5_argtuple_error;
2335     }
2336   }
2337   goto __pyx_L4_argument_unpacking_done;
2338   __pyx_L5_argtuple_error:;
2339   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2340   __pyx_L3_error:;
2341   __Pyx_AddTraceback("pocketsphinx.Lattice.__init__");
2342   __Pyx_RefNannyFinishContext();
2343   return -1;
2344   __pyx_L4_argument_unpacking_done:;
2345
2346   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":255
2347  *     """
2348  *     def __init__(self, ps=None, latfile=None, boxed=None):
2349  *         self.dag = NULL             # <<<<<<<<<<<<<<
2350  *         if latfile:
2351  *             self.read_dag(ps, latfile)
2352  */
2353   ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag = NULL;
2354
2355   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":256
2356  *     def __init__(self, ps=None, latfile=None, boxed=None):
2357  *         self.dag = NULL
2358  *         if latfile:             # <<<<<<<<<<<<<<
2359  *             self.read_dag(ps, latfile)
2360  *         if boxed:
2361  */
2362   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_latfile); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2363   if (__pyx_t_1) {
2364
2365     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":257
2366  *         self.dag = NULL
2367  *         if latfile:
2368  *             self.read_dag(ps, latfile)             # <<<<<<<<<<<<<<
2369  *         if boxed:
2370  *             self.set_boxed(boxed)
2371  */
2372     if (!(likely(((__pyx_v_ps) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ps, __pyx_ptype_12pocketsphinx_Decoder))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2373     __pyx_t_2 = ((struct __pyx_vtabstruct_12pocketsphinx_Lattice *)((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->__pyx_vtab)->read_dag(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self), ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_ps), __pyx_v_latfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2374     __Pyx_GOTREF(__pyx_t_2);
2375     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2376     goto __pyx_L6;
2377   }
2378   __pyx_L6:;
2379
2380   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":258
2381  *         if latfile:
2382  *             self.read_dag(ps, latfile)
2383  *         if boxed:             # <<<<<<<<<<<<<<
2384  *             self.set_boxed(boxed)
2385  * 
2386  */
2387   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_boxed); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2388   if (__pyx_t_1) {
2389
2390     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":259
2391  *             self.read_dag(ps, latfile)
2392  *         if boxed:
2393  *             self.set_boxed(boxed)             # <<<<<<<<<<<<<<
2394  * 
2395  *     cdef read_dag(Lattice self, Decoder ps, latfile):
2396  */
2397     __pyx_t_2 = ((struct __pyx_vtabstruct_12pocketsphinx_Lattice *)((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->__pyx_vtab)->set_boxed(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self), __pyx_v_boxed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2398     __Pyx_GOTREF(__pyx_t_2);
2399     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2400     goto __pyx_L7;
2401   }
2402   __pyx_L7:;
2403
2404   __pyx_r = 0;
2405   goto __pyx_L0;
2406   __pyx_L1_error:;
2407   __Pyx_XDECREF(__pyx_t_2);
2408   __Pyx_AddTraceback("pocketsphinx.Lattice.__init__");
2409   __pyx_r = -1;
2410   __pyx_L0:;
2411   __Pyx_RefNannyFinishContext();
2412   return __pyx_r;
2413 }
2414
2415 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":261
2416  *             self.set_boxed(boxed)
2417  * 
2418  *     cdef read_dag(Lattice self, Decoder ps, latfile):             # <<<<<<<<<<<<<<
2419  *         if ps:
2420  *             self.dag = ps_lattice_read(ps.ps, latfile)
2421  */
2422
2423 static  PyObject *__pyx_f_12pocketsphinx_7Lattice_read_dag(struct __pyx_obj_12pocketsphinx_Lattice *__pyx_v_self, struct __pyx_obj_12pocketsphinx_Decoder *__pyx_v_ps, PyObject *__pyx_v_latfile) {
2424   PyObject *__pyx_r = NULL;
2425   int __pyx_t_1;
2426   char *__pyx_t_2;
2427   PyObject *__pyx_t_3 = NULL;
2428   __Pyx_RefNannySetupContext("read_dag");
2429
2430   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":262
2431  * 
2432  *     cdef read_dag(Lattice self, Decoder ps, latfile):
2433  *         if ps:             # <<<<<<<<<<<<<<
2434  *             self.dag = ps_lattice_read(ps.ps, latfile)
2435  *         else:
2436  */
2437   __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ps)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2438   if (__pyx_t_1) {
2439
2440     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":263
2441  *     cdef read_dag(Lattice self, Decoder ps, latfile):
2442  *         if ps:
2443  *             self.dag = ps_lattice_read(ps.ps, latfile)             # <<<<<<<<<<<<<<
2444  *         else:
2445  *             self.dag = ps_lattice_read(NULL, latfile)
2446  */
2447     __pyx_t_2 = PyBytes_AsString(__pyx_v_latfile); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2448     __pyx_v_self->dag = ps_lattice_read(__pyx_v_ps->ps, __pyx_t_2);
2449     goto __pyx_L3;
2450   }
2451   /*else*/ {
2452
2453     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":265
2454  *             self.dag = ps_lattice_read(ps.ps, latfile)
2455  *         else:
2456  *             self.dag = ps_lattice_read(NULL, latfile)             # <<<<<<<<<<<<<<
2457  *         self.n_frames = ps_lattice_n_frames(self.dag)
2458  *         if self.dag == NULL:
2459  */
2460     __pyx_t_2 = PyBytes_AsString(__pyx_v_latfile); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2461     __pyx_v_self->dag = ps_lattice_read(NULL, __pyx_t_2);
2462   }
2463   __pyx_L3:;
2464
2465   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":266
2466  *         else:
2467  *             self.dag = ps_lattice_read(NULL, latfile)
2468  *         self.n_frames = ps_lattice_n_frames(self.dag)             # <<<<<<<<<<<<<<
2469  *         if self.dag == NULL:
2470  *             raise RuntimeError, "Failed to read lattice from %s" % latfile
2471  */
2472   __pyx_t_3 = PyInt_FromLong(ps_lattice_n_frames(__pyx_v_self->dag)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2473   __Pyx_GOTREF(__pyx_t_3);
2474   __Pyx_GIVEREF(__pyx_t_3);
2475   __Pyx_GOTREF(__pyx_v_self->n_frames);
2476   __Pyx_DECREF(__pyx_v_self->n_frames);
2477   __pyx_v_self->n_frames = __pyx_t_3;
2478   __pyx_t_3 = 0;
2479
2480   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":267
2481  *             self.dag = ps_lattice_read(NULL, latfile)
2482  *         self.n_frames = ps_lattice_n_frames(self.dag)
2483  *         if self.dag == NULL:             # <<<<<<<<<<<<<<
2484  *             raise RuntimeError, "Failed to read lattice from %s" % latfile
2485  * 
2486  */
2487   __pyx_t_1 = (__pyx_v_self->dag == NULL);
2488   if (__pyx_t_1) {
2489
2490     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":268
2491  *         self.n_frames = ps_lattice_n_frames(self.dag)
2492  *         if self.dag == NULL:
2493  *             raise RuntimeError, "Failed to read lattice from %s" % latfile             # <<<<<<<<<<<<<<
2494  * 
2495  *     cdef set_dag(Lattice self, ps_lattice_t *dag):
2496  */
2497     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_v_latfile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2498     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
2499     __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), 0);
2500     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
2501     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2502     goto __pyx_L4;
2503   }
2504   __pyx_L4:;
2505
2506   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2507   goto __pyx_L0;
2508   __pyx_L1_error:;
2509   __Pyx_XDECREF(__pyx_t_3);
2510   __Pyx_AddTraceback("pocketsphinx.Lattice.read_dag");
2511   __pyx_r = 0;
2512   __pyx_L0:;
2513   __Pyx_XGIVEREF(__pyx_r);
2514   __Pyx_RefNannyFinishContext();
2515   return __pyx_r;
2516 }
2517
2518 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":270
2519  *             raise RuntimeError, "Failed to read lattice from %s" % latfile
2520  * 
2521  *     cdef set_dag(Lattice self, ps_lattice_t *dag):             # <<<<<<<<<<<<<<
2522  *         ps_lattice_retain(dag)
2523  *         ps_lattice_free(self.dag)
2524  */
2525
2526 static  PyObject *__pyx_f_12pocketsphinx_7Lattice_set_dag(struct __pyx_obj_12pocketsphinx_Lattice *__pyx_v_self, ps_lattice_t *__pyx_v_dag) {
2527   PyObject *__pyx_r = NULL;
2528   PyObject *__pyx_t_1 = NULL;
2529   __Pyx_RefNannySetupContext("set_dag");
2530
2531   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":271
2532  * 
2533  *     cdef set_dag(Lattice self, ps_lattice_t *dag):
2534  *         ps_lattice_retain(dag)             # <<<<<<<<<<<<<<
2535  *         ps_lattice_free(self.dag)
2536  *         self.dag = dag
2537  */
2538   ps_lattice_retain(__pyx_v_dag);
2539
2540   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":272
2541  *     cdef set_dag(Lattice self, ps_lattice_t *dag):
2542  *         ps_lattice_retain(dag)
2543  *         ps_lattice_free(self.dag)             # <<<<<<<<<<<<<<
2544  *         self.dag = dag
2545  *         self.n_frames = ps_lattice_n_frames(dag)
2546  */
2547   ps_lattice_free(__pyx_v_self->dag);
2548
2549   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":273
2550  *         ps_lattice_retain(dag)
2551  *         ps_lattice_free(self.dag)
2552  *         self.dag = dag             # <<<<<<<<<<<<<<
2553  *         self.n_frames = ps_lattice_n_frames(dag)
2554  * 
2555  */
2556   __pyx_v_self->dag = __pyx_v_dag;
2557
2558   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":274
2559  *         ps_lattice_free(self.dag)
2560  *         self.dag = dag
2561  *         self.n_frames = ps_lattice_n_frames(dag)             # <<<<<<<<<<<<<<
2562  * 
2563  *     cdef set_boxed(Lattice self, box):
2564  */
2565   __pyx_t_1 = PyInt_FromLong(ps_lattice_n_frames(__pyx_v_dag)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2566   __Pyx_GOTREF(__pyx_t_1);
2567   __Pyx_GIVEREF(__pyx_t_1);
2568   __Pyx_GOTREF(__pyx_v_self->n_frames);
2569   __Pyx_DECREF(__pyx_v_self->n_frames);
2570   __pyx_v_self->n_frames = __pyx_t_1;
2571   __pyx_t_1 = 0;
2572
2573   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2574   goto __pyx_L0;
2575   __pyx_L1_error:;
2576   __Pyx_XDECREF(__pyx_t_1);
2577   __Pyx_AddTraceback("pocketsphinx.Lattice.set_dag");
2578   __pyx_r = 0;
2579   __pyx_L0:;
2580   __Pyx_XGIVEREF(__pyx_r);
2581   __Pyx_RefNannyFinishContext();
2582   return __pyx_r;
2583 }
2584
2585 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":276
2586  *         self.n_frames = ps_lattice_n_frames(dag)
2587  * 
2588  *     cdef set_boxed(Lattice self, box):             # <<<<<<<<<<<<<<
2589  *         cdef ps_lattice_t *dag
2590  *         dag = <ps_lattice_t *>(<PyGBoxed *>box).boxed
2591  */
2592
2593 static  PyObject *__pyx_f_12pocketsphinx_7Lattice_set_boxed(struct __pyx_obj_12pocketsphinx_Lattice *__pyx_v_self, PyObject *__pyx_v_box) {
2594   ps_lattice_t *__pyx_v_dag;
2595   PyObject *__pyx_r = NULL;
2596   PyObject *__pyx_t_1 = NULL;
2597   __Pyx_RefNannySetupContext("set_boxed");
2598
2599   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":278
2600  *     cdef set_boxed(Lattice self, box):
2601  *         cdef ps_lattice_t *dag
2602  *         dag = <ps_lattice_t *>(<PyGBoxed *>box).boxed             # <<<<<<<<<<<<<<
2603  *         ps_lattice_retain(dag)
2604  *         ps_lattice_free(self.dag)
2605  */
2606   __pyx_v_dag = ((ps_lattice_t *)((PyGBoxed *)__pyx_v_box)->boxed);
2607
2608   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":279
2609  *         cdef ps_lattice_t *dag
2610  *         dag = <ps_lattice_t *>(<PyGBoxed *>box).boxed
2611  *         ps_lattice_retain(dag)             # <<<<<<<<<<<<<<
2612  *         ps_lattice_free(self.dag)
2613  *         self.dag = dag
2614  */
2615   ps_lattice_retain(__pyx_v_dag);
2616
2617   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":280
2618  *         dag = <ps_lattice_t *>(<PyGBoxed *>box).boxed
2619  *         ps_lattice_retain(dag)
2620  *         ps_lattice_free(self.dag)             # <<<<<<<<<<<<<<
2621  *         self.dag = dag
2622  *         self.n_frames = ps_lattice_n_frames(self.dag)
2623  */
2624   ps_lattice_free(__pyx_v_self->dag);
2625
2626   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":281
2627  *         ps_lattice_retain(dag)
2628  *         ps_lattice_free(self.dag)
2629  *         self.dag = dag             # <<<<<<<<<<<<<<
2630  *         self.n_frames = ps_lattice_n_frames(self.dag)
2631  * 
2632  */
2633   __pyx_v_self->dag = __pyx_v_dag;
2634
2635   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":282
2636  *         ps_lattice_free(self.dag)
2637  *         self.dag = dag
2638  *         self.n_frames = ps_lattice_n_frames(self.dag)             # <<<<<<<<<<<<<<
2639  * 
2640  *     def __dealloc__(self):
2641  */
2642   __pyx_t_1 = PyInt_FromLong(ps_lattice_n_frames(__pyx_v_self->dag)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2643   __Pyx_GOTREF(__pyx_t_1);
2644   __Pyx_GIVEREF(__pyx_t_1);
2645   __Pyx_GOTREF(__pyx_v_self->n_frames);
2646   __Pyx_DECREF(__pyx_v_self->n_frames);
2647   __pyx_v_self->n_frames = __pyx_t_1;
2648   __pyx_t_1 = 0;
2649
2650   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2651   goto __pyx_L0;
2652   __pyx_L1_error:;
2653   __Pyx_XDECREF(__pyx_t_1);
2654   __Pyx_AddTraceback("pocketsphinx.Lattice.set_boxed");
2655   __pyx_r = 0;
2656   __pyx_L0:;
2657   __Pyx_XGIVEREF(__pyx_r);
2658   __Pyx_RefNannyFinishContext();
2659   return __pyx_r;
2660 }
2661
2662 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":284
2663  *         self.n_frames = ps_lattice_n_frames(self.dag)
2664  * 
2665  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
2666  *         ps_lattice_free(self.dag)
2667  * 
2668  */
2669
2670 static void __pyx_pf_12pocketsphinx_7Lattice___dealloc__(PyObject *__pyx_v_self); /*proto*/
2671 static void __pyx_pf_12pocketsphinx_7Lattice___dealloc__(PyObject *__pyx_v_self) {
2672   __Pyx_RefNannySetupContext("__dealloc__");
2673
2674   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":285
2675  * 
2676  *     def __dealloc__(self):
2677  *         ps_lattice_free(self.dag)             # <<<<<<<<<<<<<<
2678  * 
2679  *     def bestpath(self, NGramModel lmset, float lwf, float ascale):
2680  */
2681   ps_lattice_free(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag);
2682
2683   __Pyx_RefNannyFinishContext();
2684 }
2685
2686 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":287
2687  *         ps_lattice_free(self.dag)
2688  * 
2689  *     def bestpath(self, NGramModel lmset, float lwf, float ascale):             # <<<<<<<<<<<<<<
2690  *         """
2691  *         Find the best path through the lattice, optionally using a
2692  */
2693
2694 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_bestpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2695 static char __pyx_doc_12pocketsphinx_7Lattice_bestpath[] = "\n        Find the best path through the lattice, optionally using a\n        language model.\n\n        This function performs best-path search on the lattice, and\n        returns the final link in the best path found.  The existing\n        acoustic scores on the lattice links are used in conjunction\n        with an optional language model.  A scaling factor can be\n        applied to the acoustic scores to produce more useful\n        posterior probabilities (in conjunction with C{posterior()},\n        below).\n\n        @param lmset: Language model (set) to use for rescoring\n        @type lmset: sphinxbase.NGramModel\n        @param lwf: Weight to apply to language model scores (on top\n        of any existing language model weight set in C{lmset}).\n        @type lwf: float\n        @param ascale: Weight to apply to acoustic model scores.\n        @type ascale: float\n        @return: Final link in best path.\n        @rtype: LatLink\n        ";
2696 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_bestpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2697   struct __pyx_obj_10sphinxbase_NGramModel *__pyx_v_lmset = 0;
2698   float __pyx_v_lwf;
2699   float __pyx_v_ascale;
2700   ps_latlink_t *__pyx_v_end;
2701   struct __pyx_obj_12pocketsphinx_LatLink *__pyx_v_link;
2702   PyObject *__pyx_r = NULL;
2703   PyObject *__pyx_t_1 = NULL;
2704   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lmset,&__pyx_n_s__lwf,&__pyx_n_s__ascale,0};
2705   __Pyx_RefNannySetupContext("bestpath");
2706   if (unlikely(__pyx_kwds)) {
2707     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2708     PyObject* values[3] = {0,0,0};
2709     switch (PyTuple_GET_SIZE(__pyx_args)) {
2710       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2711       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2712       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2713       case  0: break;
2714       default: goto __pyx_L5_argtuple_error;
2715     }
2716     switch (PyTuple_GET_SIZE(__pyx_args)) {
2717       case  0:
2718       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lmset);
2719       if (likely(values[0])) kw_args--;
2720       else goto __pyx_L5_argtuple_error;
2721       case  1:
2722       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lwf);
2723       if (likely(values[1])) kw_args--;
2724       else {
2725         __Pyx_RaiseArgtupleInvalid("bestpath", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2726       }
2727       case  2:
2728       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ascale);
2729       if (likely(values[2])) kw_args--;
2730       else {
2731         __Pyx_RaiseArgtupleInvalid("bestpath", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2732       }
2733     }
2734     if (unlikely(kw_args > 0)) {
2735       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "bestpath") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2736     }
2737     __pyx_v_lmset = ((struct __pyx_obj_10sphinxbase_NGramModel *)values[0]);
2738     __pyx_v_lwf = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_lwf == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2739     __pyx_v_ascale = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_ascale == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2740   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2741     goto __pyx_L5_argtuple_error;
2742   } else {
2743     __pyx_v_lmset = ((struct __pyx_obj_10sphinxbase_NGramModel *)PyTuple_GET_ITEM(__pyx_args, 0));
2744     __pyx_v_lwf = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_lwf == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2745     __pyx_v_ascale = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_ascale == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2746   }
2747   goto __pyx_L4_argument_unpacking_done;
2748   __pyx_L5_argtuple_error:;
2749   __Pyx_RaiseArgtupleInvalid("bestpath", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2750   __pyx_L3_error:;
2751   __Pyx_AddTraceback("pocketsphinx.Lattice.bestpath");
2752   __Pyx_RefNannyFinishContext();
2753   return NULL;
2754   __pyx_L4_argument_unpacking_done:;
2755   __pyx_v_link = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); __Pyx_INCREF(Py_None);
2756   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lmset), __pyx_ptype_10sphinxbase_NGramModel, 1, "lmset", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2757
2758   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":312
2759  *         cdef ps_latlink_t *end
2760  *         cdef LatLink link
2761  *         end = ps_lattice_bestpath(self.dag, lmset.lm, lwf, ascale)             # <<<<<<<<<<<<<<
2762  *         link = LatLink()
2763  *         link.set_link(self.dag, end)
2764  */
2765   __pyx_v_end = ps_lattice_bestpath(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag, __pyx_v_lmset->lm, __pyx_v_lwf, __pyx_v_ascale);
2766
2767   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":313
2768  *         cdef LatLink link
2769  *         end = ps_lattice_bestpath(self.dag, lmset.lm, lwf, ascale)
2770  *         link = LatLink()             # <<<<<<<<<<<<<<
2771  *         link.set_link(self.dag, end)
2772  *         return link
2773  */
2774   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatLink)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2775   __Pyx_GOTREF(__pyx_t_1);
2776   __Pyx_DECREF(((PyObject *)__pyx_v_link));
2777   __pyx_v_link = ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_t_1);
2778   __pyx_t_1 = 0;
2779
2780   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":314
2781  *         end = ps_lattice_bestpath(self.dag, lmset.lm, lwf, ascale)
2782  *         link = LatLink()
2783  *         link.set_link(self.dag, end)             # <<<<<<<<<<<<<<
2784  *         return link
2785  * 
2786  */
2787   __pyx_t_1 = ((struct __pyx_vtabstruct_12pocketsphinx_LatLink *)__pyx_v_link->__pyx_vtab)->set_link(__pyx_v_link, ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag, __pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2788   __Pyx_GOTREF(__pyx_t_1);
2789   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2790
2791   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":315
2792  *         link = LatLink()
2793  *         link.set_link(self.dag, end)
2794  *         return link             # <<<<<<<<<<<<<<
2795  * 
2796  *     def posterior(self, NGramModel lmset, float ascale):
2797  */
2798   __Pyx_XDECREF(__pyx_r);
2799   __Pyx_INCREF(((PyObject *)__pyx_v_link));
2800   __pyx_r = ((PyObject *)__pyx_v_link);
2801   goto __pyx_L0;
2802
2803   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2804   goto __pyx_L0;
2805   __pyx_L1_error:;
2806   __Pyx_XDECREF(__pyx_t_1);
2807   __Pyx_AddTraceback("pocketsphinx.Lattice.bestpath");
2808   __pyx_r = NULL;
2809   __pyx_L0:;
2810   __Pyx_DECREF((PyObject *)__pyx_v_link);
2811   __Pyx_XGIVEREF(__pyx_r);
2812   __Pyx_RefNannyFinishContext();
2813   return __pyx_r;
2814 }
2815
2816 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":317
2817  *         return link
2818  * 
2819  *     def posterior(self, NGramModel lmset, float ascale):             # <<<<<<<<<<<<<<
2820  *         """
2821  *         Calculate posterior probabilities of all links in a lattice.
2822  */
2823
2824 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_posterior(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2825 static char __pyx_doc_12pocketsphinx_7Lattice_posterior[] = "\n        Calculate posterior probabilities of all links in a lattice.\n\n        This function performs the backward part of forward-backward\n        calculation of posterior probabilities for all links in the\n        lattice.  It assumes that C{bestpath()} has already been\n        called on the lattice.\n\n        @param lmset: Language model (set) to use for rescoring\n        @type lmset: sphinxbase.NGramModel\n        @param ascale: Weight to apply to acoustic model scores.\n        @type ascale: float\n        @return: Log-probability of the lattice as a whole.\n        @rtype: float\n        ";
2826 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_posterior(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2827   struct __pyx_obj_10sphinxbase_NGramModel *__pyx_v_lmset = 0;
2828   float __pyx_v_ascale;
2829   logmath_t *__pyx_v_lmath;
2830   PyObject *__pyx_r = NULL;
2831   PyObject *__pyx_t_1 = NULL;
2832   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lmset,&__pyx_n_s__ascale,0};
2833   __Pyx_RefNannySetupContext("posterior");
2834   if (unlikely(__pyx_kwds)) {
2835     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2836     PyObject* values[2] = {0,0};
2837     switch (PyTuple_GET_SIZE(__pyx_args)) {
2838       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2839       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2840       case  0: break;
2841       default: goto __pyx_L5_argtuple_error;
2842     }
2843     switch (PyTuple_GET_SIZE(__pyx_args)) {
2844       case  0:
2845       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lmset);
2846       if (likely(values[0])) kw_args--;
2847       else goto __pyx_L5_argtuple_error;
2848       case  1:
2849       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ascale);
2850       if (likely(values[1])) kw_args--;
2851       else {
2852         __Pyx_RaiseArgtupleInvalid("posterior", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2853       }
2854     }
2855     if (unlikely(kw_args > 0)) {
2856       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "posterior") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2857     }
2858     __pyx_v_lmset = ((struct __pyx_obj_10sphinxbase_NGramModel *)values[0]);
2859     __pyx_v_ascale = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_ascale == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2860   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2861     goto __pyx_L5_argtuple_error;
2862   } else {
2863     __pyx_v_lmset = ((struct __pyx_obj_10sphinxbase_NGramModel *)PyTuple_GET_ITEM(__pyx_args, 0));
2864     __pyx_v_ascale = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_ascale == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2865   }
2866   goto __pyx_L4_argument_unpacking_done;
2867   __pyx_L5_argtuple_error:;
2868   __Pyx_RaiseArgtupleInvalid("posterior", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2869   __pyx_L3_error:;
2870   __Pyx_AddTraceback("pocketsphinx.Lattice.posterior");
2871   __Pyx_RefNannyFinishContext();
2872   return NULL;
2873   __pyx_L4_argument_unpacking_done:;
2874   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lmset), __pyx_ptype_10sphinxbase_NGramModel, 1, "lmset", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2875
2876   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":334
2877  *         """
2878  *         cdef logmath_t *lmath
2879  *         lmath = ps_lattice_get_logmath(self.dag)             # <<<<<<<<<<<<<<
2880  *         return sb.logmath_log_to_ln(lmath,
2881  *                                     ps_lattice_posterior(self.dag, lmset.lm, ascale))
2882  */
2883   __pyx_v_lmath = ps_lattice_get_logmath(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag);
2884
2885   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":335
2886  *         cdef logmath_t *lmath
2887  *         lmath = ps_lattice_get_logmath(self.dag)
2888  *         return sb.logmath_log_to_ln(lmath,             # <<<<<<<<<<<<<<
2889  *                                     ps_lattice_posterior(self.dag, lmset.lm, ascale))
2890  * 
2891  */
2892   __Pyx_XDECREF(__pyx_r);
2893
2894   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":336
2895  *         lmath = ps_lattice_get_logmath(self.dag)
2896  *         return sb.logmath_log_to_ln(lmath,
2897  *                                     ps_lattice_posterior(self.dag, lmset.lm, ascale))             # <<<<<<<<<<<<<<
2898  * 
2899  *     def nodes(self, start=0, end=-1):
2900  */
2901   __pyx_t_1 = PyFloat_FromDouble(logmath_log_to_ln(__pyx_v_lmath, ps_lattice_posterior(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag, __pyx_v_lmset->lm, __pyx_v_ascale))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2902   __Pyx_GOTREF(__pyx_t_1);
2903   __pyx_r = __pyx_t_1;
2904   __pyx_t_1 = 0;
2905   goto __pyx_L0;
2906
2907   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2908   goto __pyx_L0;
2909   __pyx_L1_error:;
2910   __Pyx_XDECREF(__pyx_t_1);
2911   __Pyx_AddTraceback("pocketsphinx.Lattice.posterior");
2912   __pyx_r = NULL;
2913   __pyx_L0:;
2914   __Pyx_XGIVEREF(__pyx_r);
2915   __Pyx_RefNannyFinishContext();
2916   return __pyx_r;
2917 }
2918
2919 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":338
2920  *                                     ps_lattice_posterior(self.dag, lmset.lm, ascale))
2921  * 
2922  *     def nodes(self, start=0, end=-1):             # <<<<<<<<<<<<<<
2923  *         """
2924  *         Get an iterator over all nodes in the lattice.
2925  */
2926
2927 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_nodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2928 static char __pyx_doc_12pocketsphinx_7Lattice_nodes[] = "\n        Get an iterator over all nodes in the lattice.\n\n        @param start: First frame to iterate over.\n        @type start: int\n        @param end: Last frame to iterate over, or -1 for all remaining\n        @type end: int\n        @return: Iterator over nodes.\n        @rtype: LatNodeIterator\n        ";
2929 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_nodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2930   PyObject *__pyx_v_start = 0;
2931   PyObject *__pyx_v_end = 0;
2932   struct __pyx_obj_12pocketsphinx_LatNodeIterator *__pyx_v_itor;
2933   PyObject *__pyx_r = NULL;
2934   PyObject *__pyx_t_1 = NULL;
2935   int __pyx_t_2;
2936   PyObject *__pyx_t_3 = NULL;
2937   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0};
2938   __Pyx_RefNannySetupContext("nodes");
2939   if (unlikely(__pyx_kwds)) {
2940     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2941     PyObject* values[2] = {0,0};
2942     values[0] = ((PyObject *)__pyx_int_0);
2943     values[1] = ((PyObject *)__pyx_int_neg_1);
2944     switch (PyTuple_GET_SIZE(__pyx_args)) {
2945       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2946       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2947       case  0: break;
2948       default: goto __pyx_L5_argtuple_error;
2949     }
2950     switch (PyTuple_GET_SIZE(__pyx_args)) {
2951       case  0:
2952       if (kw_args > 0) {
2953         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
2954         if (value) { values[0] = value; kw_args--; }
2955       }
2956       case  1:
2957       if (kw_args > 0) {
2958         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
2959         if (value) { values[1] = value; kw_args--; }
2960       }
2961     }
2962     if (unlikely(kw_args > 0)) {
2963       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "nodes") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2964     }
2965     __pyx_v_start = values[0];
2966     __pyx_v_end = values[1];
2967   } else {
2968     __pyx_v_start = ((PyObject *)__pyx_int_0);
2969     __pyx_v_end = ((PyObject *)__pyx_int_neg_1);
2970     switch (PyTuple_GET_SIZE(__pyx_args)) {
2971       case  2: __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 1);
2972       case  1: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0);
2973       case  0: break;
2974       default: goto __pyx_L5_argtuple_error;
2975     }
2976   }
2977   goto __pyx_L4_argument_unpacking_done;
2978   __pyx_L5_argtuple_error:;
2979   __Pyx_RaiseArgtupleInvalid("nodes", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2980   __pyx_L3_error:;
2981   __Pyx_AddTraceback("pocketsphinx.Lattice.nodes");
2982   __Pyx_RefNannyFinishContext();
2983   return NULL;
2984   __pyx_L4_argument_unpacking_done:;
2985   __Pyx_INCREF(__pyx_v_end);
2986   __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)Py_None); __Pyx_INCREF(Py_None);
2987
2988   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":351
2989  *         cdef LatNodeIterator itor
2990  * 
2991  *         if end == -1:             # <<<<<<<<<<<<<<
2992  *             end = ps_lattice_n_frames(self.dag)
2993  *         itor = LatNodeIterator(start, end)
2994  */
2995   __pyx_t_1 = PyObject_RichCompare(__pyx_v_end, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2996   __Pyx_GOTREF(__pyx_t_1);
2997   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2998   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2999   if (__pyx_t_2) {
3000
3001     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":352
3002  * 
3003  *         if end == -1:
3004  *             end = ps_lattice_n_frames(self.dag)             # <<<<<<<<<<<<<<
3005  *         itor = LatNodeIterator(start, end)
3006  *         itor.dag = self.dag
3007  */
3008     __pyx_t_1 = PyInt_FromLong(ps_lattice_n_frames(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3009     __Pyx_GOTREF(__pyx_t_1);
3010     __Pyx_DECREF(__pyx_v_end);
3011     __pyx_v_end = __pyx_t_1;
3012     __pyx_t_1 = 0;
3013     goto __pyx_L6;
3014   }
3015   __pyx_L6:;
3016
3017   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":353
3018  *         if end == -1:
3019  *             end = ps_lattice_n_frames(self.dag)
3020  *         itor = LatNodeIterator(start, end)             # <<<<<<<<<<<<<<
3021  *         itor.dag = self.dag
3022  *         itor.itor = ps_latnode_iter(self.dag)
3023  */
3024   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3025   __Pyx_GOTREF(__pyx_t_1);
3026   __Pyx_INCREF(__pyx_v_start);
3027   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_start);
3028   __Pyx_GIVEREF(__pyx_v_start);
3029   __Pyx_INCREF(__pyx_v_end);
3030   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end);
3031   __Pyx_GIVEREF(__pyx_v_end);
3032   __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatNodeIterator)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3033   __Pyx_GOTREF(__pyx_t_3);
3034   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3035   __Pyx_DECREF(((PyObject *)__pyx_v_itor));
3036   __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_t_3);
3037   __pyx_t_3 = 0;
3038
3039   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":354
3040  *             end = ps_lattice_n_frames(self.dag)
3041  *         itor = LatNodeIterator(start, end)
3042  *         itor.dag = self.dag             # <<<<<<<<<<<<<<
3043  *         itor.itor = ps_latnode_iter(self.dag)
3044  *         return itor
3045  */
3046   __pyx_v_itor->dag = ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag;
3047
3048   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":355
3049  *         itor = LatNodeIterator(start, end)
3050  *         itor.dag = self.dag
3051  *         itor.itor = ps_latnode_iter(self.dag)             # <<<<<<<<<<<<<<
3052  *         return itor
3053  * 
3054  */
3055   __pyx_v_itor->itor = ps_latnode_iter(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag);
3056
3057   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":356
3058  *         itor.dag = self.dag
3059  *         itor.itor = ps_latnode_iter(self.dag)
3060  *         return itor             # <<<<<<<<<<<<<<
3061  * 
3062  *     def write(self, outfile):
3063  */
3064   __Pyx_XDECREF(__pyx_r);
3065   __Pyx_INCREF(((PyObject *)__pyx_v_itor));
3066   __pyx_r = ((PyObject *)__pyx_v_itor);
3067   goto __pyx_L0;
3068
3069   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3070   goto __pyx_L0;
3071   __pyx_L1_error:;
3072   __Pyx_XDECREF(__pyx_t_1);
3073   __Pyx_XDECREF(__pyx_t_3);
3074   __Pyx_AddTraceback("pocketsphinx.Lattice.nodes");
3075   __pyx_r = NULL;
3076   __pyx_L0:;
3077   __Pyx_DECREF((PyObject *)__pyx_v_itor);
3078   __Pyx_DECREF(__pyx_v_end);
3079   __Pyx_XGIVEREF(__pyx_r);
3080   __Pyx_RefNannyFinishContext();
3081   return __pyx_r;
3082 }
3083
3084 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":358
3085  *         return itor
3086  * 
3087  *     def write(self, outfile):             # <<<<<<<<<<<<<<
3088  *         """
3089  *         Write the lattice to an output file.
3090  */
3091
3092 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_write(PyObject *__pyx_v_self, PyObject *__pyx_v_outfile); /*proto*/
3093 static char __pyx_doc_12pocketsphinx_7Lattice_write[] = "\n        Write the lattice to an output file.\n\n        @param outfile: Name of file to write to.\n        @type outfile: str        \n        ";
3094 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_write(PyObject *__pyx_v_self, PyObject *__pyx_v_outfile) {
3095   int __pyx_v_rv;
3096   PyObject *__pyx_r = NULL;
3097   char *__pyx_t_1;
3098   int __pyx_t_2;
3099   PyObject *__pyx_t_3 = NULL;
3100   __Pyx_RefNannySetupContext("write");
3101
3102   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":367
3103  *         cdef int rv
3104  * 
3105  *         rv = ps_lattice_write(self.dag, outfile)             # <<<<<<<<<<<<<<
3106  *         if rv < 0:
3107  *             raise RuntimeError, "Failed to write lattice to %s" % outfile
3108  */
3109   __pyx_t_1 = PyBytes_AsString(__pyx_v_outfile); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3110   __pyx_v_rv = ps_lattice_write(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag, __pyx_t_1);
3111
3112   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":368
3113  * 
3114  *         rv = ps_lattice_write(self.dag, outfile)
3115  *         if rv < 0:             # <<<<<<<<<<<<<<
3116  *             raise RuntimeError, "Failed to write lattice to %s" % outfile
3117  * 
3118  */
3119   __pyx_t_2 = (__pyx_v_rv < 0);
3120   if (__pyx_t_2) {
3121
3122     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":369
3123  *         rv = ps_lattice_write(self.dag, outfile)
3124  *         if rv < 0:
3125  *             raise RuntimeError, "Failed to write lattice to %s" % outfile             # <<<<<<<<<<<<<<
3126  * 
3127  * cdef class Decoder:
3128  */
3129     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_v_outfile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3130     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
3131     __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), 0);
3132     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
3133     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3134     goto __pyx_L5;
3135   }
3136   __pyx_L5:;
3137
3138   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3139   goto __pyx_L0;
3140   __pyx_L1_error:;
3141   __Pyx_XDECREF(__pyx_t_3);
3142   __Pyx_AddTraceback("pocketsphinx.Lattice.write");
3143   __pyx_r = NULL;
3144   __pyx_L0:;
3145   __Pyx_XGIVEREF(__pyx_r);
3146   __Pyx_RefNannyFinishContext();
3147   return __pyx_r;
3148 }
3149
3150 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":399
3151  *     @type jsgf str
3152  *     """
3153  *     def __init__(self, **kwargs):             # <<<<<<<<<<<<<<
3154  *         cdef cmd_ln_t *config
3155  *         cdef int i
3156  */
3157
3158 static int __pyx_pf_12pocketsphinx_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3159 static int __pyx_pf_12pocketsphinx_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3160   PyObject *__pyx_v_kwargs = 0;
3161   cmd_ln_t *__pyx_v_config;
3162   int __pyx_v_i;
3163   PyObject *__pyx_v_k;
3164   PyObject *__pyx_v_v;
3165   int __pyx_r;
3166   int __pyx_t_1;
3167   PyObject *__pyx_t_2 = NULL;
3168   PyObject *__pyx_t_3 = NULL;
3169   Py_ssize_t __pyx_t_4;
3170   void *__pyx_t_5;
3171   void *__pyx_t_6;
3172   PyObject *__pyx_t_7 = NULL;
3173   char *__pyx_t_8;
3174   __Pyx_RefNannySetupContext("__init__");
3175   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
3176     __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
3177   if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
3178   __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
3179   if (unlikely(!__pyx_v_kwargs)) return -1;
3180   __Pyx_GOTREF(__pyx_v_kwargs);
3181   __pyx_v_k = Py_None; __Pyx_INCREF(Py_None);
3182   __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
3183
3184   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":404
3185  * 
3186  *         # Construct from an existing GObject pointer if given
3187  *         if 'boxed' in kwargs:             # <<<<<<<<<<<<<<
3188  *             self.argc = 0
3189  *             self.set_boxed(kwargs['boxed'])
3190  */
3191   if (unlikely(((PyObject *)__pyx_v_kwargs) == Py_None)) {
3192     __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3193   } else {
3194     __pyx_t_1 = ((PyDict_Contains(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__boxed)))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3195   }
3196   if (__pyx_t_1) {
3197
3198     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":405
3199  *         # Construct from an existing GObject pointer if given
3200  *         if 'boxed' in kwargs:
3201  *             self.argc = 0             # <<<<<<<<<<<<<<
3202  *             self.set_boxed(kwargs['boxed'])
3203  *             return
3204  */
3205     ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc = 0;
3206
3207     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":406
3208  *         if 'boxed' in kwargs:
3209  *             self.argc = 0
3210  *             self.set_boxed(kwargs['boxed'])             # <<<<<<<<<<<<<<
3211  *             return
3212  * 
3213  */
3214     __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__boxed)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3215     __Pyx_GOTREF(__pyx_t_2);
3216     __pyx_t_3 = ((struct __pyx_vtabstruct_12pocketsphinx_Decoder *)((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->__pyx_vtab)->set_boxed(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3217     __Pyx_GOTREF(__pyx_t_3);
3218     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3219     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3220
3221     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":407
3222  *             self.argc = 0
3223  *             self.set_boxed(kwargs['boxed'])
3224  *             return             # <<<<<<<<<<<<<<
3225  * 
3226  *         # A much more concise version of what pocketsphinx_parse_argdict used to do
3227  */
3228     __pyx_r = 0;
3229     goto __pyx_L0;
3230     goto __pyx_L5;
3231   }
3232   __pyx_L5:;
3233
3234   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":410
3235  * 
3236  *         # A much more concise version of what pocketsphinx_parse_argdict used to do
3237  *         self.argc = len(kwargs) * 2             # <<<<<<<<<<<<<<
3238  *         self.argv = <char **>sb.ckd_calloc(self.argc, sizeof(char *))
3239  *         i = 0
3240  */
3241   if (unlikely(__pyx_v_kwargs == Py_None)) {
3242     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
3243   }
3244   __pyx_t_4 = PyDict_Size(((PyObject *)__pyx_v_kwargs)); 
3245   ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc = (__pyx_t_4 * 2);
3246
3247   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":411
3248  *         # A much more concise version of what pocketsphinx_parse_argdict used to do
3249  *         self.argc = len(kwargs) * 2
3250  *         self.argv = <char **>sb.ckd_calloc(self.argc, sizeof(char *))             # <<<<<<<<<<<<<<
3251  *         i = 0
3252  *         for k, v in kwargs.iteritems():
3253  */
3254   ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv = ((char **)ckd_calloc(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc, (sizeof(char *))));
3255
3256   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":412
3257  *         self.argc = len(kwargs) * 2
3258  *         self.argv = <char **>sb.ckd_calloc(self.argc, sizeof(char *))
3259  *         i = 0             # <<<<<<<<<<<<<<
3260  *         for k, v in kwargs.iteritems():
3261  *             if k[0] != '-':
3262  */
3263   __pyx_v_i = 0;
3264
3265   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":413
3266  *         self.argv = <char **>sb.ckd_calloc(self.argc, sizeof(char *))
3267  *         i = 0
3268  *         for k, v in kwargs.iteritems():             # <<<<<<<<<<<<<<
3269  *             if k[0] != '-':
3270  *                 k = '-' + k
3271  */
3272   __Pyx_INCREF(((PyObject *)__pyx_v_kwargs));
3273   __Pyx_XDECREF(__pyx_t_3);
3274   __pyx_t_3 = ((PyObject *)__pyx_v_kwargs);
3275   __pyx_t_4 = 0;
3276   while (1) {
3277     if (!PyDict_Next(__pyx_t_3, (&__pyx_t_4), ((PyObject **)(&__pyx_t_5)), ((PyObject **)(&__pyx_t_6)))) break;
3278     __Pyx_INCREF(((PyObject *)__pyx_t_5));
3279     __Pyx_DECREF(__pyx_v_k);
3280     __pyx_v_k = ((PyObject *)__pyx_t_5);
3281     __Pyx_INCREF(((PyObject *)__pyx_t_6));
3282     __Pyx_DECREF(__pyx_v_v);
3283     __pyx_v_v = ((PyObject *)__pyx_t_6);
3284
3285     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":414
3286  *         i = 0
3287  *         for k, v in kwargs.iteritems():
3288  *             if k[0] != '-':             # <<<<<<<<<<<<<<
3289  *                 k = '-' + k
3290  *             self.argv[i] = sb.ckd_salloc(k)
3291  */
3292     __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_k, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3293     __Pyx_GOTREF(__pyx_t_2);
3294     __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_s_3), Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3295     __Pyx_GOTREF(__pyx_t_7);
3296     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3297     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3298     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3299     if (__pyx_t_1) {
3300
3301       /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":415
3302  *         for k, v in kwargs.iteritems():
3303  *             if k[0] != '-':
3304  *                 k = '-' + k             # <<<<<<<<<<<<<<
3305  *             self.argv[i] = sb.ckd_salloc(k)
3306  *             self.argv[i+1] = sb.ckd_salloc(v)
3307  */
3308       __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_3), __pyx_v_k); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3309       __Pyx_GOTREF(__pyx_t_7);
3310       __Pyx_DECREF(__pyx_v_k);
3311       __pyx_v_k = __pyx_t_7;
3312       __pyx_t_7 = 0;
3313       goto __pyx_L8;
3314     }
3315     __pyx_L8:;
3316
3317     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":416
3318  *             if k[0] != '-':
3319  *                 k = '-' + k
3320  *             self.argv[i] = sb.ckd_salloc(k)             # <<<<<<<<<<<<<<
3321  *             self.argv[i+1] = sb.ckd_salloc(v)
3322  *             i = i + 2
3323  */
3324     __pyx_t_8 = PyBytes_AsString(__pyx_v_k); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3325     (((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv[__pyx_v_i]) = ckd_salloc(__pyx_t_8);
3326
3327     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":417
3328  *                 k = '-' + k
3329  *             self.argv[i] = sb.ckd_salloc(k)
3330  *             self.argv[i+1] = sb.ckd_salloc(v)             # <<<<<<<<<<<<<<
3331  *             i = i + 2
3332  *         config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)
3333  */
3334     __pyx_t_8 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3335     (((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv[(__pyx_v_i + 1)]) = ckd_salloc(__pyx_t_8);
3336
3337     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":418
3338  *             self.argv[i] = sb.ckd_salloc(k)
3339  *             self.argv[i+1] = sb.ckd_salloc(v)
3340  *             i = i + 2             # <<<<<<<<<<<<<<
3341  *         config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)
3342  *         if config == NULL:
3343  */
3344     __pyx_v_i = (__pyx_v_i + 2);
3345   }
3346   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3347
3348   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":419
3349  *             self.argv[i+1] = sb.ckd_salloc(v)
3350  *             i = i + 2
3351  *         config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)             # <<<<<<<<<<<<<<
3352  *         if config == NULL:
3353  *             raise RuntimeError, "Failed to parse argument list"
3354  */
3355   __pyx_v_config = cmd_ln_parse_r(NULL, ps_args(), ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc, ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv, 0);
3356
3357   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":420
3358  *             i = i + 2
3359  *         config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)
3360  *         if config == NULL:             # <<<<<<<<<<<<<<
3361  *             raise RuntimeError, "Failed to parse argument list"
3362  *         self.ps = ps_init(config)
3363  */
3364   __pyx_t_1 = (__pyx_v_config == NULL);
3365   if (__pyx_t_1) {
3366
3367     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":421
3368  *         config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)
3369  *         if config == NULL:
3370  *             raise RuntimeError, "Failed to parse argument list"             # <<<<<<<<<<<<<<
3371  *         self.ps = ps_init(config)
3372  *         if self.ps == NULL:
3373  */
3374     __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_4), 0);
3375     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3376     goto __pyx_L9;
3377   }
3378   __pyx_L9:;
3379
3380   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":422
3381  *         if config == NULL:
3382  *             raise RuntimeError, "Failed to parse argument list"
3383  *         self.ps = ps_init(config)             # <<<<<<<<<<<<<<
3384  *         if self.ps == NULL:
3385  *             raise RuntimeError, "Failed to initialize PocketSphinx"
3386  */
3387   ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps = ps_init(__pyx_v_config);
3388
3389   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":423
3390  *             raise RuntimeError, "Failed to parse argument list"
3391  *         self.ps = ps_init(config)
3392  *         if self.ps == NULL:             # <<<<<<<<<<<<<<
3393  *             raise RuntimeError, "Failed to initialize PocketSphinx"
3394  * 
3395  */
3396   __pyx_t_1 = (((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps == NULL);
3397   if (__pyx_t_1) {
3398
3399     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":424
3400  *         self.ps = ps_init(config)
3401  *         if self.ps == NULL:
3402  *             raise RuntimeError, "Failed to initialize PocketSphinx"             # <<<<<<<<<<<<<<
3403  * 
3404  *     cdef set_boxed(Decoder self, box):
3405  */
3406     __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_5), 0);
3407     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3408     goto __pyx_L10;
3409   }
3410   __pyx_L10:;
3411
3412   __pyx_r = 0;
3413   goto __pyx_L0;
3414   __pyx_L1_error:;
3415   __Pyx_XDECREF(__pyx_t_2);
3416   __Pyx_XDECREF(__pyx_t_3);
3417   __Pyx_XDECREF(__pyx_t_7);
3418   __Pyx_AddTraceback("pocketsphinx.Decoder.__init__");
3419   __pyx_r = -1;
3420   __pyx_L0:;
3421   __Pyx_DECREF(__pyx_v_kwargs);
3422   __Pyx_DECREF(__pyx_v_k);
3423   __Pyx_DECREF(__pyx_v_v);
3424   __Pyx_RefNannyFinishContext();
3425   return __pyx_r;
3426 }
3427
3428 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":426
3429  *             raise RuntimeError, "Failed to initialize PocketSphinx"
3430  * 
3431  *     cdef set_boxed(Decoder self, box):             # <<<<<<<<<<<<<<
3432  *         cdef ps_decoder_t *ps
3433  *         ps = <ps_decoder_t *>(<PyGBoxed *>box).boxed
3434  */
3435
3436 static  PyObject *__pyx_f_12pocketsphinx_7Decoder_set_boxed(struct __pyx_obj_12pocketsphinx_Decoder *__pyx_v_self, PyObject *__pyx_v_box) {
3437   ps_decoder_t *__pyx_v_ps;
3438   PyObject *__pyx_r = NULL;
3439   __Pyx_RefNannySetupContext("set_boxed");
3440
3441   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":428
3442  *     cdef set_boxed(Decoder self, box):
3443  *         cdef ps_decoder_t *ps
3444  *         ps = <ps_decoder_t *>(<PyGBoxed *>box).boxed             # <<<<<<<<<<<<<<
3445  *         ps_retain(ps)
3446  *         ps_free(self.ps)
3447  */
3448   __pyx_v_ps = ((ps_decoder_t *)((PyGBoxed *)__pyx_v_box)->boxed);
3449
3450   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":429
3451  *         cdef ps_decoder_t *ps
3452  *         ps = <ps_decoder_t *>(<PyGBoxed *>box).boxed
3453  *         ps_retain(ps)             # <<<<<<<<<<<<<<
3454  *         ps_free(self.ps)
3455  *         self.ps = ps
3456  */
3457   ps_retain(__pyx_v_ps);
3458
3459   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":430
3460  *         ps = <ps_decoder_t *>(<PyGBoxed *>box).boxed
3461  *         ps_retain(ps)
3462  *         ps_free(self.ps)             # <<<<<<<<<<<<<<
3463  *         self.ps = ps
3464  * 
3465  */
3466   ps_free(__pyx_v_self->ps);
3467
3468   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":431
3469  *         ps_retain(ps)
3470  *         ps_free(self.ps)
3471  *         self.ps = ps             # <<<<<<<<<<<<<<
3472  * 
3473  *     def __dealloc__(self):
3474  */
3475   __pyx_v_self->ps = __pyx_v_ps;
3476
3477   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3478   __Pyx_XGIVEREF(__pyx_r);
3479   __Pyx_RefNannyFinishContext();
3480   return __pyx_r;
3481 }
3482
3483 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":433
3484  *         self.ps = ps
3485  * 
3486  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
3487  *         ps_free(self.ps)
3488  *         for i from 0 <= i < self.argc:
3489  */
3490
3491 static void __pyx_pf_12pocketsphinx_7Decoder___dealloc__(PyObject *__pyx_v_self); /*proto*/
3492 static void __pyx_pf_12pocketsphinx_7Decoder___dealloc__(PyObject *__pyx_v_self) {
3493   long __pyx_v_i;
3494   int __pyx_t_1;
3495   __Pyx_RefNannySetupContext("__dealloc__");
3496
3497   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":434
3498  * 
3499  *     def __dealloc__(self):
3500  *         ps_free(self.ps)             # <<<<<<<<<<<<<<
3501  *         for i from 0 <= i < self.argc:
3502  *             sb.ckd_free(self.argv[i])
3503  */
3504   ps_free(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);
3505
3506   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":435
3507  *     def __dealloc__(self):
3508  *         ps_free(self.ps)
3509  *         for i from 0 <= i < self.argc:             # <<<<<<<<<<<<<<
3510  *             sb.ckd_free(self.argv[i])
3511  *         sb.ckd_free(self.argv)
3512  */
3513   __pyx_t_1 = ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc;
3514   for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
3515
3516     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":436
3517  *         ps_free(self.ps)
3518  *         for i from 0 <= i < self.argc:
3519  *             sb.ckd_free(self.argv[i])             # <<<<<<<<<<<<<<
3520  *         sb.ckd_free(self.argv)
3521  *         self.argv = NULL
3522  */
3523     ckd_free((((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv[__pyx_v_i]));
3524   }
3525
3526   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":437
3527  *         for i from 0 <= i < self.argc:
3528  *             sb.ckd_free(self.argv[i])
3529  *         sb.ckd_free(self.argv)             # <<<<<<<<<<<<<<
3530  *         self.argv = NULL
3531  *         self.argc = 0
3532  */
3533   ckd_free(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv);
3534
3535   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":438
3536  *             sb.ckd_free(self.argv[i])
3537  *         sb.ckd_free(self.argv)
3538  *         self.argv = NULL             # <<<<<<<<<<<<<<
3539  *         self.argc = 0
3540  * 
3541  */
3542   ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv = NULL;
3543
3544   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":439
3545  *         sb.ckd_free(self.argv)
3546  *         self.argv = NULL
3547  *         self.argc = 0             # <<<<<<<<<<<<<<
3548  * 
3549  *     def decode_raw(self, fh, uttid=None, maxsamps=-1):
3550  */
3551   ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc = 0;
3552
3553   __Pyx_RefNannyFinishContext();
3554 }
3555
3556 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":441
3557  *         self.argc = 0
3558  * 
3559  *     def decode_raw(self, fh, uttid=None, maxsamps=-1):             # <<<<<<<<<<<<<<
3560  *         """
3561  *         Decode raw audio from a file.
3562  */
3563
3564 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_decode_raw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3565 static char __pyx_doc_12pocketsphinx_7Decoder_decode_raw[] = "\n        Decode raw audio from a file.\n\n        @param fh: Filehandle to read audio from.\n        @type fh: file\n        @param uttid: Identifier to give to this utterance.\n        @type uttid: str\n        @param maxsamps: Maximum number of samples to read.  If not\n        specified or -1, the rest of the file will be read.\n        @type maxsamps: int\n        ";
3566 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_decode_raw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3567   PyObject *__pyx_v_fh = 0;
3568   PyObject *__pyx_v_uttid = 0;
3569   PyObject *__pyx_v_maxsamps = 0;
3570   FILE *__pyx_v_cfh;
3571   char *__pyx_v_cuttid;
3572   PyObject *__pyx_r = NULL;
3573   PyObject *__pyx_t_1 = NULL;
3574   int __pyx_t_2;
3575   char *__pyx_t_3;
3576   long __pyx_t_4;
3577   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fh,&__pyx_n_s__uttid,&__pyx_n_s__maxsamps,0};
3578   __Pyx_RefNannySetupContext("decode_raw");
3579   if (unlikely(__pyx_kwds)) {
3580     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3581     PyObject* values[3] = {0,0,0};
3582     values[1] = ((PyObject *)Py_None);
3583     values[2] = ((PyObject *)__pyx_int_neg_1);
3584     switch (PyTuple_GET_SIZE(__pyx_args)) {
3585       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3586       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3587       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3588       case  0: break;
3589       default: goto __pyx_L5_argtuple_error;
3590     }
3591     switch (PyTuple_GET_SIZE(__pyx_args)) {
3592       case  0:
3593       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fh);
3594       if (likely(values[0])) kw_args--;
3595       else goto __pyx_L5_argtuple_error;
3596       case  1:
3597       if (kw_args > 0) {
3598         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uttid);
3599         if (value) { values[1] = value; kw_args--; }
3600       }
3601       case  2:
3602       if (kw_args > 0) {
3603         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__maxsamps);
3604         if (value) { values[2] = value; kw_args--; }
3605       }
3606     }
3607     if (unlikely(kw_args > 0)) {
3608       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "decode_raw") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3609     }
3610     __pyx_v_fh = values[0];
3611     __pyx_v_uttid = values[1];
3612     __pyx_v_maxsamps = values[2];
3613   } else {
3614     __pyx_v_uttid = ((PyObject *)Py_None);
3615     __pyx_v_maxsamps = ((PyObject *)__pyx_int_neg_1);
3616     switch (PyTuple_GET_SIZE(__pyx_args)) {
3617       case  3: __pyx_v_maxsamps = PyTuple_GET_ITEM(__pyx_args, 2);
3618       case  2: __pyx_v_uttid = PyTuple_GET_ITEM(__pyx_args, 1);
3619       case  1: __pyx_v_fh = PyTuple_GET_ITEM(__pyx_args, 0);
3620       break;
3621       default: goto __pyx_L5_argtuple_error;
3622     }
3623   }
3624   goto __pyx_L4_argument_unpacking_done;
3625   __pyx_L5_argtuple_error:;
3626   __Pyx_RaiseArgtupleInvalid("decode_raw", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3627   __pyx_L3_error:;
3628   __Pyx_AddTraceback("pocketsphinx.Decoder.decode_raw");
3629   __Pyx_RefNannyFinishContext();
3630   return NULL;
3631   __pyx_L4_argument_unpacking_done:;
3632
3633   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":457
3634  *         cdef char *cuttid
3635  * 
3636  *         cfh = PyFile_AsFile(fh)             # <<<<<<<<<<<<<<
3637  *         if uttid == None:
3638  *             cuttid = NULL
3639  */
3640   __pyx_v_cfh = PyFile_AsFile(__pyx_v_fh);
3641
3642   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":458
3643  * 
3644  *         cfh = PyFile_AsFile(fh)
3645  *         if uttid == None:             # <<<<<<<<<<<<<<
3646  *             cuttid = NULL
3647  *         else:
3648  */
3649   __pyx_t_1 = PyObject_RichCompare(__pyx_v_uttid, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3650   __Pyx_GOTREF(__pyx_t_1);
3651   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3652   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3653   if (__pyx_t_2) {
3654
3655     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":459
3656  *         cfh = PyFile_AsFile(fh)
3657  *         if uttid == None:
3658  *             cuttid = NULL             # <<<<<<<<<<<<<<
3659  *         else:
3660  *             cuttid = uttid
3661  */
3662     __pyx_v_cuttid = NULL;
3663     goto __pyx_L6;
3664   }
3665   /*else*/ {
3666
3667     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":461
3668  *             cuttid = NULL
3669  *         else:
3670  *             cuttid = uttid             # <<<<<<<<<<<<<<
3671  *         return ps_decode_raw(self.ps, cfh, cuttid, maxsamps)
3672  * 
3673  */
3674     __pyx_t_3 = PyBytes_AsString(__pyx_v_uttid); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3675     __pyx_v_cuttid = __pyx_t_3;
3676   }
3677   __pyx_L6:;
3678
3679   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":462
3680  *         else:
3681  *             cuttid = uttid
3682  *         return ps_decode_raw(self.ps, cfh, cuttid, maxsamps)             # <<<<<<<<<<<<<<
3683  * 
3684  *     def decode_senscr(self, fh, uttid=None):
3685  */
3686   __Pyx_XDECREF(__pyx_r);
3687   __pyx_t_4 = __Pyx_PyInt_AsLong(__pyx_v_maxsamps); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3688   __pyx_t_1 = PyInt_FromLong(ps_decode_raw(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_v_cfh, __pyx_v_cuttid, __pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3689   __Pyx_GOTREF(__pyx_t_1);
3690   __pyx_r = __pyx_t_1;
3691   __pyx_t_1 = 0;
3692   goto __pyx_L0;
3693
3694   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3695   goto __pyx_L0;
3696   __pyx_L1_error:;
3697   __Pyx_XDECREF(__pyx_t_1);
3698   __Pyx_AddTraceback("pocketsphinx.Decoder.decode_raw");
3699   __pyx_r = NULL;
3700   __pyx_L0:;
3701   __Pyx_XGIVEREF(__pyx_r);
3702   __Pyx_RefNannyFinishContext();
3703   return __pyx_r;
3704 }
3705
3706 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":464
3707  *         return ps_decode_raw(self.ps, cfh, cuttid, maxsamps)
3708  * 
3709  *     def decode_senscr(self, fh, uttid=None):             # <<<<<<<<<<<<<<
3710  *         """
3711  *         Decode senone scores from a file.
3712  */
3713
3714 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_decode_senscr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3715 static char __pyx_doc_12pocketsphinx_7Decoder_decode_senscr[] = "\n        Decode senone scores from a file.\n\n        @param fh: Filehandle to read senone scores from.\n        @type fh: file\n        @param uttid: Identifier to give to this utterance.\n        @type uttid: str\n        ";
3716 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_decode_senscr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3717   PyObject *__pyx_v_fh = 0;
3718   PyObject *__pyx_v_uttid = 0;
3719   FILE *__pyx_v_cfh;
3720   char *__pyx_v_cuttid;
3721   PyObject *__pyx_r = NULL;
3722   PyObject *__pyx_t_1 = NULL;
3723   int __pyx_t_2;
3724   char *__pyx_t_3;
3725   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fh,&__pyx_n_s__uttid,0};
3726   __Pyx_RefNannySetupContext("decode_senscr");
3727   if (unlikely(__pyx_kwds)) {
3728     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3729     PyObject* values[2] = {0,0};
3730     values[1] = ((PyObject *)Py_None);
3731     switch (PyTuple_GET_SIZE(__pyx_args)) {
3732       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3733       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3734       case  0: break;
3735       default: goto __pyx_L5_argtuple_error;
3736     }
3737     switch (PyTuple_GET_SIZE(__pyx_args)) {
3738       case  0:
3739       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fh);
3740       if (likely(values[0])) kw_args--;
3741       else goto __pyx_L5_argtuple_error;
3742       case  1:
3743       if (kw_args > 0) {
3744         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uttid);
3745         if (value) { values[1] = value; kw_args--; }
3746       }
3747     }
3748     if (unlikely(kw_args > 0)) {
3749       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "decode_senscr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3750     }
3751     __pyx_v_fh = values[0];
3752     __pyx_v_uttid = values[1];
3753   } else {
3754     __pyx_v_uttid = ((PyObject *)Py_None);
3755     switch (PyTuple_GET_SIZE(__pyx_args)) {
3756       case  2: __pyx_v_uttid = PyTuple_GET_ITEM(__pyx_args, 1);
3757       case  1: __pyx_v_fh = PyTuple_GET_ITEM(__pyx_args, 0);
3758       break;
3759       default: goto __pyx_L5_argtuple_error;
3760     }
3761   }
3762   goto __pyx_L4_argument_unpacking_done;
3763   __pyx_L5_argtuple_error:;
3764   __Pyx_RaiseArgtupleInvalid("decode_senscr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3765   __pyx_L3_error:;
3766   __Pyx_AddTraceback("pocketsphinx.Decoder.decode_senscr");
3767   __Pyx_RefNannyFinishContext();
3768   return NULL;
3769   __pyx_L4_argument_unpacking_done:;
3770
3771   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":476
3772  *         cdef char *cuttid
3773  * 
3774  *         cfh = PyFile_AsFile(fh)             # <<<<<<<<<<<<<<
3775  *         if uttid == None:
3776  *             cuttid = NULL
3777  */
3778   __pyx_v_cfh = PyFile_AsFile(__pyx_v_fh);
3779
3780   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":477
3781  * 
3782  *         cfh = PyFile_AsFile(fh)
3783  *         if uttid == None:             # <<<<<<<<<<<<<<
3784  *             cuttid = NULL
3785  *         else:
3786  */
3787   __pyx_t_1 = PyObject_RichCompare(__pyx_v_uttid, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3788   __Pyx_GOTREF(__pyx_t_1);
3789   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3790   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3791   if (__pyx_t_2) {
3792
3793     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":478
3794  *         cfh = PyFile_AsFile(fh)
3795  *         if uttid == None:
3796  *             cuttid = NULL             # <<<<<<<<<<<<<<
3797  *         else:
3798  *             cuttid = uttid
3799  */
3800     __pyx_v_cuttid = NULL;
3801     goto __pyx_L6;
3802   }
3803   /*else*/ {
3804
3805     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":480
3806  *             cuttid = NULL
3807  *         else:
3808  *             cuttid = uttid             # <<<<<<<<<<<<<<
3809  *         return ps_decode_senscr(self.ps, cfh, cuttid)
3810  * 
3811  */
3812     __pyx_t_3 = PyBytes_AsString(__pyx_v_uttid); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3813     __pyx_v_cuttid = __pyx_t_3;
3814   }
3815   __pyx_L6:;
3816
3817   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":481
3818  *         else:
3819  *             cuttid = uttid
3820  *         return ps_decode_senscr(self.ps, cfh, cuttid)             # <<<<<<<<<<<<<<
3821  * 
3822  *     def start_utt(self, uttid=None):
3823  */
3824   __Pyx_XDECREF(__pyx_r);
3825   __pyx_t_1 = PyInt_FromLong(ps_decode_senscr(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_v_cfh, __pyx_v_cuttid)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3826   __Pyx_GOTREF(__pyx_t_1);
3827   __pyx_r = __pyx_t_1;
3828   __pyx_t_1 = 0;
3829   goto __pyx_L0;
3830
3831   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3832   goto __pyx_L0;
3833   __pyx_L1_error:;
3834   __Pyx_XDECREF(__pyx_t_1);
3835   __Pyx_AddTraceback("pocketsphinx.Decoder.decode_senscr");
3836   __pyx_r = NULL;
3837   __pyx_L0:;
3838   __Pyx_XGIVEREF(__pyx_r);
3839   __Pyx_RefNannyFinishContext();
3840   return __pyx_r;
3841 }
3842
3843 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":483
3844  *         return ps_decode_senscr(self.ps, cfh, cuttid)
3845  * 
3846  *     def start_utt(self, uttid=None):             # <<<<<<<<<<<<<<
3847  *         """
3848  *         Prepare the decoder to recognize an utterance.
3849  */
3850
3851 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_start_utt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3852 static char __pyx_doc_12pocketsphinx_7Decoder_start_utt[] = "\n        Prepare the decoder to recognize an utterance.\n\n        @param uttid: Identifier to give to this utterance.\n        @type uttid: str\n        ";
3853 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_start_utt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3854   PyObject *__pyx_v_uttid = 0;
3855   char *__pyx_v_cuttid;
3856   PyObject *__pyx_r = NULL;
3857   PyObject *__pyx_t_1 = NULL;
3858   int __pyx_t_2;
3859   char *__pyx_t_3;
3860   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__uttid,0};
3861   __Pyx_RefNannySetupContext("start_utt");
3862   if (unlikely(__pyx_kwds)) {
3863     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3864     PyObject* values[1] = {0};
3865     values[0] = ((PyObject *)Py_None);
3866     switch (PyTuple_GET_SIZE(__pyx_args)) {
3867       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3868       case  0: break;
3869       default: goto __pyx_L5_argtuple_error;
3870     }
3871     switch (PyTuple_GET_SIZE(__pyx_args)) {
3872       case  0:
3873       if (kw_args > 0) {
3874         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uttid);
3875         if (value) { values[0] = value; kw_args--; }
3876       }
3877     }
3878     if (unlikely(kw_args > 0)) {
3879       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "start_utt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3880     }
3881     __pyx_v_uttid = values[0];
3882   } else {
3883     __pyx_v_uttid = ((PyObject *)Py_None);
3884     switch (PyTuple_GET_SIZE(__pyx_args)) {
3885       case  1: __pyx_v_uttid = PyTuple_GET_ITEM(__pyx_args, 0);
3886       case  0: break;
3887       default: goto __pyx_L5_argtuple_error;
3888     }
3889   }
3890   goto __pyx_L4_argument_unpacking_done;
3891   __pyx_L5_argtuple_error:;
3892   __Pyx_RaiseArgtupleInvalid("start_utt", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3893   __pyx_L3_error:;
3894   __Pyx_AddTraceback("pocketsphinx.Decoder.start_utt");
3895   __Pyx_RefNannyFinishContext();
3896   return NULL;
3897   __pyx_L4_argument_unpacking_done:;
3898
3899   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":492
3900  *         cdef char *cuttid
3901  * 
3902  *         if uttid == None:             # <<<<<<<<<<<<<<
3903  *             cuttid = NULL
3904  *         else:
3905  */
3906   __pyx_t_1 = PyObject_RichCompare(__pyx_v_uttid, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3907   __Pyx_GOTREF(__pyx_t_1);
3908   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3909   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3910   if (__pyx_t_2) {
3911
3912     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":493
3913  * 
3914  *         if uttid == None:
3915  *             cuttid = NULL             # <<<<<<<<<<<<<<
3916  *         else:
3917  *             cuttid = uttid
3918  */
3919     __pyx_v_cuttid = NULL;
3920     goto __pyx_L6;
3921   }
3922   /*else*/ {
3923
3924     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":495
3925  *             cuttid = NULL
3926  *         else:
3927  *             cuttid = uttid             # <<<<<<<<<<<<<<
3928  *         if ps_start_utt(self.ps, cuttid) < 0:
3929  *             raise RuntimeError, "Failed to start utterance processing"
3930  */
3931     __pyx_t_3 = PyBytes_AsString(__pyx_v_uttid); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3932     __pyx_v_cuttid = __pyx_t_3;
3933   }
3934   __pyx_L6:;
3935
3936   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":496
3937  *         else:
3938  *             cuttid = uttid
3939  *         if ps_start_utt(self.ps, cuttid) < 0:             # <<<<<<<<<<<<<<
3940  *             raise RuntimeError, "Failed to start utterance processing"
3941  * 
3942  */
3943   __pyx_t_2 = (ps_start_utt(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_v_cuttid) < 0);
3944   if (__pyx_t_2) {
3945
3946     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":497
3947  *             cuttid = uttid
3948  *         if ps_start_utt(self.ps, cuttid) < 0:
3949  *             raise RuntimeError, "Failed to start utterance processing"             # <<<<<<<<<<<<<<
3950  * 
3951  *     def process_raw(self, data, no_search=False, full_utt=False):
3952  */
3953     __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_6), 0);
3954     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3955     goto __pyx_L7;
3956   }
3957   __pyx_L7:;
3958
3959   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3960   goto __pyx_L0;
3961   __pyx_L1_error:;
3962   __Pyx_XDECREF(__pyx_t_1);
3963   __Pyx_AddTraceback("pocketsphinx.Decoder.start_utt");
3964   __pyx_r = NULL;
3965   __pyx_L0:;
3966   __Pyx_XGIVEREF(__pyx_r);
3967   __Pyx_RefNannyFinishContext();
3968   return __pyx_r;
3969 }
3970
3971 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":499
3972  *             raise RuntimeError, "Failed to start utterance processing"
3973  * 
3974  *     def process_raw(self, data, no_search=False, full_utt=False):             # <<<<<<<<<<<<<<
3975  *         """
3976  *         Process (decode) some audio data.
3977  */
3978
3979 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_process_raw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3980 static char __pyx_doc_12pocketsphinx_7Decoder_process_raw[] = "\n        Process (decode) some audio data.\n\n        @param data: Audio data to process.  This is packed binary\n        data, which consists of single-channel, 16-bit PCM audio, at\n        the sample rate specified when the decoder was initialized.\n        @type data: str\n        @param no_search: Buffer the data without actually processing it (default is to process the\n        data as it is received).\n        @type no_search: bool\n        @param full_utt: This block of data is an entire utterance.\n        Processing an entire utterance at once may improve\n        recognition, particularly for the first utterance passed to\n        the decoder.\n        @type full_utt: bool\n        ";
3981 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_process_raw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3982   PyObject *__pyx_v_data = 0;
3983   PyObject *__pyx_v_no_search = 0;
3984   PyObject *__pyx_v_full_utt = 0;
3985   Py_ssize_t __pyx_v_len;
3986   char *__pyx_v_strdata;
3987   int16 * __pyx_v_cdata;
3988   PyObject *__pyx_r = NULL;
3989   int __pyx_t_1;
3990   int __pyx_t_2;
3991   int __pyx_t_3;
3992   PyObject *__pyx_t_4 = NULL;
3993   PyObject *__pyx_t_5 = NULL;
3994   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__no_search,&__pyx_n_s__full_utt,0};
3995   __Pyx_RefNannySetupContext("process_raw");
3996   if (unlikely(__pyx_kwds)) {
3997     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3998     PyObject* values[3] = {0,0,0};
3999     values[1] = __pyx_k_7;
4000     values[2] = __pyx_k_8;
4001     switch (PyTuple_GET_SIZE(__pyx_args)) {
4002       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4003       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4004       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4005       case  0: break;
4006       default: goto __pyx_L5_argtuple_error;
4007     }
4008     switch (PyTuple_GET_SIZE(__pyx_args)) {
4009       case  0:
4010       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
4011       if (likely(values[0])) kw_args--;
4012       else goto __pyx_L5_argtuple_error;
4013       case  1:
4014       if (kw_args > 0) {
4015         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__no_search);
4016         if (value) { values[1] = value; kw_args--; }
4017       }
4018       case  2:
4019       if (kw_args > 0) {
4020         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__full_utt);
4021         if (value) { values[2] = value; kw_args--; }
4022       }
4023     }
4024     if (unlikely(kw_args > 0)) {
4025       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "process_raw") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4026     }
4027     __pyx_v_data = values[0];
4028     __pyx_v_no_search = values[1];
4029     __pyx_v_full_utt = values[2];
4030   } else {
4031     __pyx_v_no_search = __pyx_k_7;
4032     __pyx_v_full_utt = __pyx_k_8;
4033     switch (PyTuple_GET_SIZE(__pyx_args)) {
4034       case  3: __pyx_v_full_utt = PyTuple_GET_ITEM(__pyx_args, 2);
4035       case  2: __pyx_v_no_search = PyTuple_GET_ITEM(__pyx_args, 1);
4036       case  1: __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 0);
4037       break;
4038       default: goto __pyx_L5_argtuple_error;
4039     }
4040   }
4041   goto __pyx_L4_argument_unpacking_done;
4042   __pyx_L5_argtuple_error:;
4043   __Pyx_RaiseArgtupleInvalid("process_raw", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4044   __pyx_L3_error:;
4045   __Pyx_AddTraceback("pocketsphinx.Decoder.process_raw");
4046   __Pyx_RefNannyFinishContext();
4047   return NULL;
4048   __pyx_L4_argument_unpacking_done:;
4049
4050   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":520
4051  *         cdef raw_data_ptr cdata
4052  * 
4053  *         PyString_AsStringAndSize(data, &strdata, &len)             # <<<<<<<<<<<<<<
4054  *         cdata = strdata
4055  *         if ps_process_raw(self.ps, cdata, len, no_search, full_utt) < 0:
4056  */
4057   __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_data, (&__pyx_v_strdata), (&__pyx_v_len)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4058
4059   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":521
4060  * 
4061  *         PyString_AsStringAndSize(data, &strdata, &len)
4062  *         cdata = strdata             # <<<<<<<<<<<<<<
4063  *         if ps_process_raw(self.ps, cdata, len, no_search, full_utt) < 0:
4064  *             raise RuntimeError, "Failed to process %d samples of audio data" % len
4065  */
4066   __pyx_v_cdata = __pyx_v_strdata;
4067
4068   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":522
4069  *         PyString_AsStringAndSize(data, &strdata, &len)
4070  *         cdata = strdata
4071  *         if ps_process_raw(self.ps, cdata, len, no_search, full_utt) < 0:             # <<<<<<<<<<<<<<
4072  *             raise RuntimeError, "Failed to process %d samples of audio data" % len
4073  * 
4074  */
4075   __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_no_search); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4076   __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_full_utt); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4077   __pyx_t_3 = (ps_process_raw(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_v_cdata, __pyx_v_len, __pyx_t_1, __pyx_t_2) < 0);
4078   if (__pyx_t_3) {
4079
4080     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":523
4081  *         cdata = strdata
4082  *         if ps_process_raw(self.ps, cdata, len, no_search, full_utt) < 0:
4083  *             raise RuntimeError, "Failed to process %d samples of audio data" % len             # <<<<<<<<<<<<<<
4084  * 
4085  *     def ps_end_utt(self):
4086  */
4087     __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4088     __Pyx_GOTREF(__pyx_t_4);
4089     __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4090     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
4091     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4092     __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), 0);
4093     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
4094     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4095     goto __pyx_L6;
4096   }
4097   __pyx_L6:;
4098
4099   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4100   goto __pyx_L0;
4101   __pyx_L1_error:;
4102   __Pyx_XDECREF(__pyx_t_4);
4103   __Pyx_XDECREF(__pyx_t_5);
4104   __Pyx_AddTraceback("pocketsphinx.Decoder.process_raw");
4105   __pyx_r = NULL;
4106   __pyx_L0:;
4107   __Pyx_XGIVEREF(__pyx_r);
4108   __Pyx_RefNannyFinishContext();
4109   return __pyx_r;
4110 }
4111
4112 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":525
4113  *             raise RuntimeError, "Failed to process %d samples of audio data" % len
4114  * 
4115  *     def ps_end_utt(self):             # <<<<<<<<<<<<<<
4116  *         """
4117  *         Finish processing an utterance.
4118  */
4119
4120 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_ps_end_utt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4121 static char __pyx_doc_12pocketsphinx_7Decoder_ps_end_utt[] = "\n        Finish processing an utterance.\n        ";
4122 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_ps_end_utt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4123   PyObject *__pyx_r = NULL;
4124   int __pyx_t_1;
4125   __Pyx_RefNannySetupContext("ps_end_utt");
4126
4127   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":529
4128  *         Finish processing an utterance.
4129  *         """
4130  *         if ps_end_utt(self.ps) < 0:             # <<<<<<<<<<<<<<
4131  *             raise RuntimeError, "Failed to stop utterance processing"
4132  * 
4133  */
4134   __pyx_t_1 = (ps_end_utt(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps) < 0);
4135   if (__pyx_t_1) {
4136
4137     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":530
4138  *         """
4139  *         if ps_end_utt(self.ps) < 0:
4140  *             raise RuntimeError, "Failed to stop utterance processing"             # <<<<<<<<<<<<<<
4141  * 
4142  *     def get_hyp(self):
4143  */
4144     __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_10), 0);
4145     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4146     goto __pyx_L5;
4147   }
4148   __pyx_L5:;
4149
4150   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4151   goto __pyx_L0;
4152   __pyx_L1_error:;
4153   __Pyx_AddTraceback("pocketsphinx.Decoder.ps_end_utt");
4154   __pyx_r = NULL;
4155   __pyx_L0:;
4156   __Pyx_XGIVEREF(__pyx_r);
4157   __Pyx_RefNannyFinishContext();
4158   return __pyx_r;
4159 }
4160
4161 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":532
4162  *             raise RuntimeError, "Failed to stop utterance processing"
4163  * 
4164  *     def get_hyp(self):             # <<<<<<<<<<<<<<
4165  *         """
4166  *         Get a hypothesis string.
4167  */
4168
4169 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_hyp(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4170 static char __pyx_doc_12pocketsphinx_7Decoder_get_hyp[] = "\n        Get a hypothesis string.\n\n        This function returns the text which has been recognized so\n        far, or, if C{ps_end_utt()} has been called, the final\n        recognition result.\n\n        @return: Hypothesis string, utterance ID, recognition score\n        @rtype: (str, str, int)\n        ";
4171 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_hyp(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4172   const char* __pyx_v_hyp;
4173   const char* __pyx_v_uttid;
4174   int __pyx_v_score;
4175   PyObject *__pyx_r = NULL;
4176   int __pyx_t_1;
4177   PyObject *__pyx_t_2 = NULL;
4178   PyObject *__pyx_t_3 = NULL;
4179   PyObject *__pyx_t_4 = NULL;
4180   PyObject *__pyx_t_5 = NULL;
4181   __Pyx_RefNannySetupContext("get_hyp");
4182
4183   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":547
4184  *         cdef int score
4185  * 
4186  *         hyp = ps_get_hyp(self.ps, &score, &uttid)             # <<<<<<<<<<<<<<
4187  * 
4188  *         # No result
4189  */
4190   __pyx_v_hyp = ps_get_hyp(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, (&__pyx_v_score), (&__pyx_v_uttid));
4191
4192   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":550
4193  * 
4194  *         # No result
4195  *         if hyp == NULL:             # <<<<<<<<<<<<<<
4196  *              return None, uttid, 0
4197  * 
4198  */
4199   __pyx_t_1 = (__pyx_v_hyp == NULL);
4200   if (__pyx_t_1) {
4201
4202     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":551
4203  *         # No result
4204  *         if hyp == NULL:
4205  *              return None, uttid, 0             # <<<<<<<<<<<<<<
4206  * 
4207  *         return hyp, uttid, score
4208  */
4209     __Pyx_XDECREF(__pyx_r);
4210     __pyx_t_2 = PyBytes_FromString(__pyx_v_uttid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4211     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
4212     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4213     __Pyx_GOTREF(__pyx_t_3);
4214     __Pyx_INCREF(Py_None);
4215     PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
4216     __Pyx_GIVEREF(Py_None);
4217     PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_2));
4218     __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
4219     __Pyx_INCREF(__pyx_int_0);
4220     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_0);
4221     __Pyx_GIVEREF(__pyx_int_0);
4222     __pyx_t_2 = 0;
4223     __pyx_r = __pyx_t_3;
4224     __pyx_t_3 = 0;
4225     goto __pyx_L0;
4226     goto __pyx_L5;
4227   }
4228   __pyx_L5:;
4229
4230   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":553
4231  *              return None, uttid, 0
4232  * 
4233  *         return hyp, uttid, score             # <<<<<<<<<<<<<<
4234  * 
4235  *     def get_prob(self):
4236  */
4237   __Pyx_XDECREF(__pyx_r);
4238   __pyx_t_3 = PyBytes_FromString(__pyx_v_hyp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4239   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
4240   __pyx_t_2 = PyBytes_FromString(__pyx_v_uttid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4241   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
4242   __pyx_t_4 = PyInt_FromLong(__pyx_v_score); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4243   __Pyx_GOTREF(__pyx_t_4);
4244   __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4245   __Pyx_GOTREF(__pyx_t_5);
4246   PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3));
4247   __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
4248   PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_2));
4249   __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
4250   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
4251   __Pyx_GIVEREF(__pyx_t_4);
4252   __pyx_t_3 = 0;
4253   __pyx_t_2 = 0;
4254   __pyx_t_4 = 0;
4255   __pyx_r = __pyx_t_5;
4256   __pyx_t_5 = 0;
4257   goto __pyx_L0;
4258
4259   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4260   goto __pyx_L0;
4261   __pyx_L1_error:;
4262   __Pyx_XDECREF(__pyx_t_2);
4263   __Pyx_XDECREF(__pyx_t_3);
4264   __Pyx_XDECREF(__pyx_t_4);
4265   __Pyx_XDECREF(__pyx_t_5);
4266   __Pyx_AddTraceback("pocketsphinx.Decoder.get_hyp");
4267   __pyx_r = NULL;
4268   __pyx_L0:;
4269   __Pyx_XGIVEREF(__pyx_r);
4270   __Pyx_RefNannyFinishContext();
4271   return __pyx_r;
4272 }
4273
4274 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":555
4275  *         return hyp, uttid, score
4276  * 
4277  *     def get_prob(self):             # <<<<<<<<<<<<<<
4278  *         """
4279  *      Get a posterior probability.
4280  */
4281
4282 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_prob(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4283 static char __pyx_doc_12pocketsphinx_7Decoder_get_prob[] = "\n\tGet a posterior probability.\n\t\n\tReturns the posterior in linear scale.\n\t\n\t@return: posterior probability of the result\n\t@rtype: float\n\t";
4284 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_prob(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4285   logmath_t *__pyx_v_lmath;
4286   const char* __pyx_v_uttid;
4287   PyObject *__pyx_r = NULL;
4288   PyObject *__pyx_t_1 = NULL;
4289   __Pyx_RefNannySetupContext("get_prob");
4290
4291   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":566
4292  *         cdef logmath_t *lmath
4293  *         cdef const_char_ptr uttid
4294  *         lmath = ps_get_logmath(self.ps)             # <<<<<<<<<<<<<<
4295  *         return sb.logmath_exp(lmath, ps_get_prob(self.ps, &uttid))
4296  * 
4297  */
4298   __pyx_v_lmath = ps_get_logmath(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);
4299
4300   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":567
4301  *         cdef const_char_ptr uttid
4302  *         lmath = ps_get_logmath(self.ps)
4303  *         return sb.logmath_exp(lmath, ps_get_prob(self.ps, &uttid))             # <<<<<<<<<<<<<<
4304  * 
4305  *     def get_lattice(self):
4306  */
4307   __Pyx_XDECREF(__pyx_r);
4308   __pyx_t_1 = PyFloat_FromDouble(logmath_exp(__pyx_v_lmath, ps_get_prob(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, (&__pyx_v_uttid)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4309   __Pyx_GOTREF(__pyx_t_1);
4310   __pyx_r = __pyx_t_1;
4311   __pyx_t_1 = 0;
4312   goto __pyx_L0;
4313
4314   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4315   goto __pyx_L0;
4316   __pyx_L1_error:;
4317   __Pyx_XDECREF(__pyx_t_1);
4318   __Pyx_AddTraceback("pocketsphinx.Decoder.get_prob");
4319   __pyx_r = NULL;
4320   __pyx_L0:;
4321   __Pyx_XGIVEREF(__pyx_r);
4322   __Pyx_RefNannyFinishContext();
4323   return __pyx_r;
4324 }
4325
4326 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":569
4327  *         return sb.logmath_exp(lmath, ps_get_prob(self.ps, &uttid))
4328  * 
4329  *     def get_lattice(self):             # <<<<<<<<<<<<<<
4330  *         """
4331  *         Get the word lattice.
4332  */
4333
4334 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_lattice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4335 static char __pyx_doc_12pocketsphinx_7Decoder_get_lattice[] = "\n        Get the word lattice.\n\n        This function returns all hypotheses which have been\n        considered so far, in the form of a word lattice.\n\n        @return: Word lattice\n        @rtype: Lattice\n        ";
4336 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_lattice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4337   ps_lattice_t *__pyx_v_dag;
4338   struct __pyx_obj_12pocketsphinx_Lattice *__pyx_v_lat;
4339   PyObject *__pyx_r = NULL;
4340   int __pyx_t_1;
4341   PyObject *__pyx_t_2 = NULL;
4342   __Pyx_RefNannySetupContext("get_lattice");
4343   __pyx_v_lat = ((struct __pyx_obj_12pocketsphinx_Lattice *)Py_None); __Pyx_INCREF(Py_None);
4344
4345   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":582
4346  *         cdef Lattice lat
4347  * 
4348  *         dag = ps_get_lattice(self.ps)             # <<<<<<<<<<<<<<
4349  *         if dag == NULL:
4350  *             raise RuntimeError, "Failed to create word lattice"
4351  */
4352   __pyx_v_dag = ps_get_lattice(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);
4353
4354   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":583
4355  * 
4356  *         dag = ps_get_lattice(self.ps)
4357  *         if dag == NULL:             # <<<<<<<<<<<<<<
4358  *             raise RuntimeError, "Failed to create word lattice"
4359  *         lat = Lattice()
4360  */
4361   __pyx_t_1 = (__pyx_v_dag == NULL);
4362   if (__pyx_t_1) {
4363
4364     /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":584
4365  *         dag = ps_get_lattice(self.ps)
4366  *         if dag == NULL:
4367  *             raise RuntimeError, "Failed to create word lattice"             # <<<<<<<<<<<<<<
4368  *         lat = Lattice()
4369  *         lat.set_dag(dag)
4370  */
4371     __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_11), 0);
4372     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4373     goto __pyx_L5;
4374   }
4375   __pyx_L5:;
4376
4377   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":585
4378  *         if dag == NULL:
4379  *             raise RuntimeError, "Failed to create word lattice"
4380  *         lat = Lattice()             # <<<<<<<<<<<<<<
4381  *         lat.set_dag(dag)
4382  *         return lat
4383  */
4384   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_Lattice)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4385   __Pyx_GOTREF(__pyx_t_2);
4386   __Pyx_DECREF(((PyObject *)__pyx_v_lat));
4387   __pyx_v_lat = ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_t_2);
4388   __pyx_t_2 = 0;
4389
4390   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":586
4391  *             raise RuntimeError, "Failed to create word lattice"
4392  *         lat = Lattice()
4393  *         lat.set_dag(dag)             # <<<<<<<<<<<<<<
4394  *         return lat
4395  * 
4396  */
4397   __pyx_t_2 = ((struct __pyx_vtabstruct_12pocketsphinx_Lattice *)__pyx_v_lat->__pyx_vtab)->set_dag(__pyx_v_lat, __pyx_v_dag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4398   __Pyx_GOTREF(__pyx_t_2);
4399   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4400
4401   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":587
4402  *         lat = Lattice()
4403  *         lat.set_dag(dag)
4404  *         return lat             # <<<<<<<<<<<<<<
4405  * 
4406  *     def get_lmset(self):
4407  */
4408   __Pyx_XDECREF(__pyx_r);
4409   __Pyx_INCREF(((PyObject *)__pyx_v_lat));
4410   __pyx_r = ((PyObject *)__pyx_v_lat);
4411   goto __pyx_L0;
4412
4413   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4414   goto __pyx_L0;
4415   __pyx_L1_error:;
4416   __Pyx_XDECREF(__pyx_t_2);
4417   __Pyx_AddTraceback("pocketsphinx.Decoder.get_lattice");
4418   __pyx_r = NULL;
4419   __pyx_L0:;
4420   __Pyx_DECREF((PyObject *)__pyx_v_lat);
4421   __Pyx_XGIVEREF(__pyx_r);
4422   __Pyx_RefNannyFinishContext();
4423   return __pyx_r;
4424 }
4425
4426 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":589
4427  *         return lat
4428  * 
4429  *     def get_lmset(self):             # <<<<<<<<<<<<<<
4430  *         """
4431  *         Get the language model set.
4432  */
4433
4434 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_lmset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4435 static char __pyx_doc_12pocketsphinx_7Decoder_get_lmset[] = "\n        Get the language model set.\n\n        This function returns the language model set, which allows you\n        to obtain language model scores or switch language models.\n\n        @return: Language model set\n        @rtype: sphinxbase.NGramModel\n        ";
4436 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_lmset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4437   ngram_model_t *__pyx_v_clm;
4438   logmath_t *__pyx_v_lmath;
4439   cmd_ln_t *__pyx_v_config;
4440   struct __pyx_obj_10sphinxbase_NGramModel *__pyx_v_lm;
4441   PyObject *__pyx_r = NULL;
4442   PyObject *__pyx_t_1 = NULL;
4443   __Pyx_RefNannySetupContext("get_lmset");
4444   __pyx_v_lm = ((struct __pyx_obj_10sphinxbase_NGramModel *)Py_None); __Pyx_INCREF(Py_None);
4445
4446   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":604
4447  *         cdef NGramModel lm
4448  * 
4449  *         clm = ps_get_lmset(self.ps)             # <<<<<<<<<<<<<<
4450  *         lm = NGramModel()
4451  *         lm.set_lm(clm)
4452  */
4453   __pyx_v_clm = ps_get_lmset(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);
4454
4455   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":605
4456  * 
4457  *         clm = ps_get_lmset(self.ps)
4458  *         lm = NGramModel()             # <<<<<<<<<<<<<<
4459  *         lm.set_lm(clm)
4460  *         lmath = sb.logmath_retain(ps_get_logmath(self.ps))
4461  */
4462   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_10sphinxbase_NGramModel)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4463   __Pyx_GOTREF(__pyx_t_1);
4464   __Pyx_DECREF(((PyObject *)__pyx_v_lm));
4465   __pyx_v_lm = ((struct __pyx_obj_10sphinxbase_NGramModel *)__pyx_t_1);
4466   __pyx_t_1 = 0;
4467
4468   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":606
4469  *         clm = ps_get_lmset(self.ps)
4470  *         lm = NGramModel()
4471  *         lm.set_lm(clm)             # <<<<<<<<<<<<<<
4472  *         lmath = sb.logmath_retain(ps_get_logmath(self.ps))
4473  *         lm.set_lmath(lmath)
4474  */
4475   __pyx_t_1 = ((struct __pyx_vtabstruct_10sphinxbase_NGramModel *)__pyx_v_lm->__pyx_vtab)->set_lm(__pyx_v_lm, __pyx_v_clm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4476   __Pyx_GOTREF(__pyx_t_1);
4477   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4478
4479   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":607
4480  *         lm = NGramModel()
4481  *         lm.set_lm(clm)
4482  *         lmath = sb.logmath_retain(ps_get_logmath(self.ps))             # <<<<<<<<<<<<<<
4483  *         lm.set_lmath(lmath)
4484  *         config = ps_get_config(self.ps)
4485  */
4486   __pyx_v_lmath = logmath_retain(ps_get_logmath(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps));
4487
4488   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":608
4489  *         lm.set_lm(clm)
4490  *         lmath = sb.logmath_retain(ps_get_logmath(self.ps))
4491  *         lm.set_lmath(lmath)             # <<<<<<<<<<<<<<
4492  *         config = ps_get_config(self.ps)
4493  *         # This is not necessarily true but it will have to do
4494  */
4495   __pyx_t_1 = ((struct __pyx_vtabstruct_10sphinxbase_NGramModel *)__pyx_v_lm->__pyx_vtab)->set_lmath(__pyx_v_lm, __pyx_v_lmath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4496   __Pyx_GOTREF(__pyx_t_1);
4497   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4498
4499   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":609
4500  *         lmath = sb.logmath_retain(ps_get_logmath(self.ps))
4501  *         lm.set_lmath(lmath)
4502  *         config = ps_get_config(self.ps)             # <<<<<<<<<<<<<<
4503  *         # This is not necessarily true but it will have to do
4504  *         lm.lw = sb.cmd_ln_float32_r(config, "-lw")
4505  */
4506   __pyx_v_config = ps_get_config(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);
4507
4508   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":611
4509  *         config = ps_get_config(self.ps)
4510  *         # This is not necessarily true but it will have to do
4511  *         lm.lw = sb.cmd_ln_float32_r(config, "-lw")             # <<<<<<<<<<<<<<
4512  *         lm.wip = sb.cmd_ln_float32_r(config, "-wip")
4513  *         lm.uw = sb.cmd_ln_float32_r(config, "-uw")
4514  */
4515   __pyx_v_lm->lw = cmd_ln_float32_r(__pyx_v_config, __pyx_k_12);
4516
4517   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":612
4518  *         # This is not necessarily true but it will have to do
4519  *         lm.lw = sb.cmd_ln_float32_r(config, "-lw")
4520  *         lm.wip = sb.cmd_ln_float32_r(config, "-wip")             # <<<<<<<<<<<<<<
4521  *         lm.uw = sb.cmd_ln_float32_r(config, "-uw")
4522  *         return lm
4523  */
4524   __pyx_v_lm->wip = cmd_ln_float32_r(__pyx_v_config, __pyx_k_13);
4525
4526   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":613
4527  *         lm.lw = sb.cmd_ln_float32_r(config, "-lw")
4528  *         lm.wip = sb.cmd_ln_float32_r(config, "-wip")
4529  *         lm.uw = sb.cmd_ln_float32_r(config, "-uw")             # <<<<<<<<<<<<<<
4530  *         return lm
4531  * 
4532  */
4533   __pyx_v_lm->uw = cmd_ln_float32_r(__pyx_v_config, __pyx_k_14);
4534
4535   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":614
4536  *         lm.wip = sb.cmd_ln_float32_r(config, "-wip")
4537  *         lm.uw = sb.cmd_ln_float32_r(config, "-uw")
4538  *         return lm             # <<<<<<<<<<<<<<
4539  * 
4540  *     def add_word(self, word, phones, update=True):
4541  */
4542   __Pyx_XDECREF(__pyx_r);
4543   __Pyx_INCREF(((PyObject *)__pyx_v_lm));
4544   __pyx_r = ((PyObject *)__pyx_v_lm);
4545   goto __pyx_L0;
4546
4547   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4548   goto __pyx_L0;
4549   __pyx_L1_error:;
4550   __Pyx_XDECREF(__pyx_t_1);
4551   __Pyx_AddTraceback("pocketsphinx.Decoder.get_lmset");
4552   __pyx_r = NULL;
4553   __pyx_L0:;
4554   __Pyx_DECREF((PyObject *)__pyx_v_lm);
4555   __Pyx_XGIVEREF(__pyx_r);
4556   __Pyx_RefNannyFinishContext();
4557   return __pyx_r;
4558 }
4559
4560 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":616
4561  *         return lm
4562  * 
4563  *     def add_word(self, word, phones, update=True):             # <<<<<<<<<<<<<<
4564  *         """
4565  *         Add a word to the dictionary and current language model.
4566  */
4567
4568 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_add_word(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4569 static char __pyx_doc_12pocketsphinx_7Decoder_add_word[] = "\n        Add a word to the dictionary and current language model.\n\n        @param word: Name of the word to add.\n        @type word: str\n        @param phones: Pronunciation of the word, a space-separated list of phones.\n        @type phones: str\n        @param update: Update the decoder to recognize this new word.\n        If adding a number of words at once you may wish to pass\n        C{False} here.\n        @type update: bool\n        ";
4570 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_add_word(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4571   PyObject *__pyx_v_word = 0;
4572   PyObject *__pyx_v_phones = 0;
4573   PyObject *__pyx_v_update = 0;
4574   PyObject *__pyx_r = NULL;
4575   char *__pyx_t_1;
4576   char *__pyx_t_2;
4577   int __pyx_t_3;
4578   PyObject *__pyx_t_4 = NULL;
4579   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__word,&__pyx_n_s__phones,&__pyx_n_s__update,0};
4580   __Pyx_RefNannySetupContext("add_word");
4581   if (unlikely(__pyx_kwds)) {
4582     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4583     PyObject* values[3] = {0,0,0};
4584     values[2] = __pyx_k_15;
4585     switch (PyTuple_GET_SIZE(__pyx_args)) {
4586       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4587       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4588       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4589       case  0: break;
4590       default: goto __pyx_L5_argtuple_error;
4591     }
4592     switch (PyTuple_GET_SIZE(__pyx_args)) {
4593       case  0:
4594       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__word);
4595       if (likely(values[0])) kw_args--;
4596       else goto __pyx_L5_argtuple_error;
4597       case  1:
4598       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__phones);
4599       if (likely(values[1])) kw_args--;
4600       else {
4601         __Pyx_RaiseArgtupleInvalid("add_word", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4602       }
4603       case  2:
4604       if (kw_args > 0) {
4605         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__update);
4606         if (value) { values[2] = value; kw_args--; }
4607       }
4608     }
4609     if (unlikely(kw_args > 0)) {
4610       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_word") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4611     }
4612     __pyx_v_word = values[0];
4613     __pyx_v_phones = values[1];
4614     __pyx_v_update = values[2];
4615   } else {
4616     __pyx_v_update = __pyx_k_15;
4617     switch (PyTuple_GET_SIZE(__pyx_args)) {
4618       case  3:
4619       __pyx_v_update = PyTuple_GET_ITEM(__pyx_args, 2);
4620       case  2:
4621       __pyx_v_phones = PyTuple_GET_ITEM(__pyx_args, 1);
4622       __pyx_v_word = PyTuple_GET_ITEM(__pyx_args, 0);
4623       break;
4624       default: goto __pyx_L5_argtuple_error;
4625     }
4626   }
4627   goto __pyx_L4_argument_unpacking_done;
4628   __pyx_L5_argtuple_error:;
4629   __Pyx_RaiseArgtupleInvalid("add_word", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4630   __pyx_L3_error:;
4631   __Pyx_AddTraceback("pocketsphinx.Decoder.add_word");
4632   __Pyx_RefNannyFinishContext();
4633   return NULL;
4634   __pyx_L4_argument_unpacking_done:;
4635
4636   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":629
4637  *         @type update: bool
4638  *         """
4639  *         return ps_add_word(self.ps, word, phones, update)             # <<<<<<<<<<<<<<
4640  * 
4641  *     def load_dict(self, dictfile, fdictfile=None, format=None):
4642  */
4643   __Pyx_XDECREF(__pyx_r);
4644   __pyx_t_1 = PyBytes_AsString(__pyx_v_word); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4645   __pyx_t_2 = PyBytes_AsString(__pyx_v_phones); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4646   __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_update); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4647   __pyx_t_4 = PyInt_FromLong(ps_add_word(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_t_1, __pyx_t_2, __pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4648   __Pyx_GOTREF(__pyx_t_4);
4649   __pyx_r = __pyx_t_4;
4650   __pyx_t_4 = 0;
4651   goto __pyx_L0;
4652
4653   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4654   goto __pyx_L0;
4655   __pyx_L1_error:;
4656   __Pyx_XDECREF(__pyx_t_4);
4657   __Pyx_AddTraceback("pocketsphinx.Decoder.add_word");
4658   __pyx_r = NULL;
4659   __pyx_L0:;
4660   __Pyx_XGIVEREF(__pyx_r);
4661   __Pyx_RefNannyFinishContext();
4662   return __pyx_r;
4663 }
4664
4665 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":631
4666  *         return ps_add_word(self.ps, word, phones, update)
4667  * 
4668  *     def load_dict(self, dictfile, fdictfile=None, format=None):             # <<<<<<<<<<<<<<
4669  *         """
4670  *         Load a new pronunciation dictionary.
4671  */
4672
4673 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_load_dict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4674 static char __pyx_doc_12pocketsphinx_7Decoder_load_dict[] = "\n        Load a new pronunciation dictionary.\n\n        @param dictfile: Dictionary filename.\n        @type dictfile: str\n        @param fdictfile: Filler dictionary filename.\n        @type fdictfile: str\n        @param format: Dictionary format, currently unused.\n        @type format: str\n        ";
4675 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_load_dict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4676   PyObject *__pyx_v_dictfile = 0;
4677   PyObject *__pyx_v_fdictfile = 0;
4678   PyObject *__pyx_v_format = 0;
4679   PyObject *__pyx_r = NULL;
4680   char *__pyx_t_1;
4681   char *__pyx_t_2;
4682   char *__pyx_t_3;
4683   PyObject *__pyx_t_4 = NULL;
4684   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dictfile,&__pyx_n_s__fdictfile,&__pyx_n_s__format,0};
4685   __Pyx_RefNannySetupContext("load_dict");
4686   if (unlikely(__pyx_kwds)) {
4687     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4688     PyObject* values[3] = {0,0,0};
4689     values[1] = ((PyObject *)Py_None);
4690     values[2] = ((PyObject *)Py_None);
4691     switch (PyTuple_GET_SIZE(__pyx_args)) {
4692       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4693       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4694       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4695       case  0: break;
4696       default: goto __pyx_L5_argtuple_error;
4697     }
4698     switch (PyTuple_GET_SIZE(__pyx_args)) {
4699       case  0:
4700       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dictfile);
4701       if (likely(values[0])) kw_args--;
4702       else goto __pyx_L5_argtuple_error;
4703       case  1:
4704       if (kw_args > 0) {
4705         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fdictfile);
4706         if (value) { values[1] = value; kw_args--; }
4707       }
4708       case  2:
4709       if (kw_args > 0) {
4710         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
4711         if (value) { values[2] = value; kw_args--; }
4712       }
4713     }
4714     if (unlikely(kw_args > 0)) {
4715       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "load_dict") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4716     }
4717     __pyx_v_dictfile = values[0];
4718     __pyx_v_fdictfile = values[1];
4719     __pyx_v_format = values[2];
4720   } else {
4721     __pyx_v_fdictfile = ((PyObject *)Py_None);
4722     __pyx_v_format = ((PyObject *)Py_None);
4723     switch (PyTuple_GET_SIZE(__pyx_args)) {
4724       case  3: __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 2);
4725       case  2: __pyx_v_fdictfile = PyTuple_GET_ITEM(__pyx_args, 1);
4726       case  1: __pyx_v_dictfile = PyTuple_GET_ITEM(__pyx_args, 0);
4727       break;
4728       default: goto __pyx_L5_argtuple_error;
4729     }
4730   }
4731   goto __pyx_L4_argument_unpacking_done;
4732   __pyx_L5_argtuple_error:;
4733   __Pyx_RaiseArgtupleInvalid("load_dict", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4734   __pyx_L3_error:;
4735   __Pyx_AddTraceback("pocketsphinx.Decoder.load_dict");
4736   __Pyx_RefNannyFinishContext();
4737   return NULL;
4738   __pyx_L4_argument_unpacking_done:;
4739
4740   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":642
4741  *         @type format: str
4742  *         """
4743  *         return ps_load_dict(self.ps, dictfile, fdictfile, format)             # <<<<<<<<<<<<<<
4744  * 
4745  *     def save_dict(self, dictfile, format=None):
4746  */
4747   __Pyx_XDECREF(__pyx_r);
4748   __pyx_t_1 = PyBytes_AsString(__pyx_v_dictfile); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4749   __pyx_t_2 = PyBytes_AsString(__pyx_v_fdictfile); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4750   __pyx_t_3 = PyBytes_AsString(__pyx_v_format); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4751   __pyx_t_4 = PyInt_FromLong(ps_load_dict(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_t_1, __pyx_t_2, __pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4752   __Pyx_GOTREF(__pyx_t_4);
4753   __pyx_r = __pyx_t_4;
4754   __pyx_t_4 = 0;
4755   goto __pyx_L0;
4756
4757   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4758   goto __pyx_L0;
4759   __pyx_L1_error:;
4760   __Pyx_XDECREF(__pyx_t_4);
4761   __Pyx_AddTraceback("pocketsphinx.Decoder.load_dict");
4762   __pyx_r = NULL;
4763   __pyx_L0:;
4764   __Pyx_XGIVEREF(__pyx_r);
4765   __Pyx_RefNannyFinishContext();
4766   return __pyx_r;
4767 }
4768
4769 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":644
4770  *         return ps_load_dict(self.ps, dictfile, fdictfile, format)
4771  * 
4772  *     def save_dict(self, dictfile, format=None):             # <<<<<<<<<<<<<<
4773  *         """
4774  *         Save current pronunciation dictionary to a file.
4775  */
4776
4777 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_save_dict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4778 static char __pyx_doc_12pocketsphinx_7Decoder_save_dict[] = "\n        Save current pronunciation dictionary to a file.\n\n        @param dictfile: Dictionary filename.\n        @type dictfile: str\n        @param format: Dictionary format, currently unused.\n        @type format: str\n        ";
4779 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_save_dict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4780   PyObject *__pyx_v_dictfile = 0;
4781   PyObject *__pyx_v_format = 0;
4782   PyObject *__pyx_r = NULL;
4783   char *__pyx_t_1;
4784   char *__pyx_t_2;
4785   PyObject *__pyx_t_3 = NULL;
4786   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dictfile,&__pyx_n_s__format,0};
4787   __Pyx_RefNannySetupContext("save_dict");
4788   if (unlikely(__pyx_kwds)) {
4789     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4790     PyObject* values[2] = {0,0};
4791     values[1] = ((PyObject *)Py_None);
4792     switch (PyTuple_GET_SIZE(__pyx_args)) {
4793       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4794       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4795       case  0: break;
4796       default: goto __pyx_L5_argtuple_error;
4797     }
4798     switch (PyTuple_GET_SIZE(__pyx_args)) {
4799       case  0:
4800       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dictfile);
4801       if (likely(values[0])) kw_args--;
4802       else goto __pyx_L5_argtuple_error;
4803       case  1:
4804       if (kw_args > 0) {
4805         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
4806         if (value) { values[1] = value; kw_args--; }
4807       }
4808     }
4809     if (unlikely(kw_args > 0)) {
4810       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "save_dict") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4811     }
4812     __pyx_v_dictfile = values[0];
4813     __pyx_v_format = values[1];
4814   } else {
4815     __pyx_v_format = ((PyObject *)Py_None);
4816     switch (PyTuple_GET_SIZE(__pyx_args)) {
4817       case  2: __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 1);
4818       case  1: __pyx_v_dictfile = PyTuple_GET_ITEM(__pyx_args, 0);
4819       break;
4820       default: goto __pyx_L5_argtuple_error;
4821     }
4822   }
4823   goto __pyx_L4_argument_unpacking_done;
4824   __pyx_L5_argtuple_error:;
4825   __Pyx_RaiseArgtupleInvalid("save_dict", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4826   __pyx_L3_error:;
4827   __Pyx_AddTraceback("pocketsphinx.Decoder.save_dict");
4828   __Pyx_RefNannyFinishContext();
4829   return NULL;
4830   __pyx_L4_argument_unpacking_done:;
4831
4832   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":653
4833  *         @type format: str
4834  *         """
4835  *         return ps_save_dict(self.ps, dictfile, format)             # <<<<<<<<<<<<<<
4836  */
4837   __Pyx_XDECREF(__pyx_r);
4838   __pyx_t_1 = PyBytes_AsString(__pyx_v_dictfile); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4839   __pyx_t_2 = PyBytes_AsString(__pyx_v_format); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4840   __pyx_t_3 = PyInt_FromLong(ps_save_dict(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_t_1, __pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4841   __Pyx_GOTREF(__pyx_t_3);
4842   __pyx_r = __pyx_t_3;
4843   __pyx_t_3 = 0;
4844   goto __pyx_L0;
4845
4846   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4847   goto __pyx_L0;
4848   __pyx_L1_error:;
4849   __Pyx_XDECREF(__pyx_t_3);
4850   __Pyx_AddTraceback("pocketsphinx.Decoder.save_dict");
4851   __pyx_r = NULL;
4852   __pyx_L0:;
4853   __Pyx_XGIVEREF(__pyx_r);
4854   __Pyx_RefNannyFinishContext();
4855   return __pyx_r;
4856 }
4857
4858 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":141
4859  *     cdef ngram_model_t *lm
4860  *     cdef logmath_t *lmath
4861  *     cdef readonly float lw, wip, uw             # <<<<<<<<<<<<<<
4862  * 
4863  *     cdef set_lm(NGramModel self, ngram_model_t *lm)
4864  */
4865
4866 static PyObject *__pyx_pf_10sphinxbase_10NGramModel_2lw___get__(PyObject *__pyx_v_self); /*proto*/
4867 static PyObject *__pyx_pf_10sphinxbase_10NGramModel_2lw___get__(PyObject *__pyx_v_self) {
4868   PyObject *__pyx_r = NULL;
4869   PyObject *__pyx_t_1 = NULL;
4870   __Pyx_RefNannySetupContext("__get__");
4871   __Pyx_XDECREF(__pyx_r);
4872   __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_10sphinxbase_NGramModel *)__pyx_v_self)->lw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4873   __Pyx_GOTREF(__pyx_t_1);
4874   __pyx_r = __pyx_t_1;
4875   __pyx_t_1 = 0;
4876   goto __pyx_L0;
4877
4878   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4879   goto __pyx_L0;
4880   __pyx_L1_error:;
4881   __Pyx_XDECREF(__pyx_t_1);
4882   __Pyx_AddTraceback("sphinxbase.NGramModel.lw.__get__");
4883   __pyx_r = NULL;
4884   __pyx_L0:;
4885   __Pyx_XGIVEREF(__pyx_r);
4886   __Pyx_RefNannyFinishContext();
4887   return __pyx_r;
4888 }
4889
4890 static PyObject *__pyx_pf_10sphinxbase_10NGramModel_3wip___get__(PyObject *__pyx_v_self); /*proto*/
4891 static PyObject *__pyx_pf_10sphinxbase_10NGramModel_3wip___get__(PyObject *__pyx_v_self) {
4892   PyObject *__pyx_r = NULL;
4893   PyObject *__pyx_t_1 = NULL;
4894   __Pyx_RefNannySetupContext("__get__");
4895   __Pyx_XDECREF(__pyx_r);
4896   __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_10sphinxbase_NGramModel *)__pyx_v_self)->wip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4897   __Pyx_GOTREF(__pyx_t_1);
4898   __pyx_r = __pyx_t_1;
4899   __pyx_t_1 = 0;
4900   goto __pyx_L0;
4901
4902   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4903   goto __pyx_L0;
4904   __pyx_L1_error:;
4905   __Pyx_XDECREF(__pyx_t_1);
4906   __Pyx_AddTraceback("sphinxbase.NGramModel.wip.__get__");
4907   __pyx_r = NULL;
4908   __pyx_L0:;
4909   __Pyx_XGIVEREF(__pyx_r);
4910   __Pyx_RefNannyFinishContext();
4911   return __pyx_r;
4912 }
4913
4914 static PyObject *__pyx_pf_10sphinxbase_10NGramModel_2uw___get__(PyObject *__pyx_v_self); /*proto*/
4915 static PyObject *__pyx_pf_10sphinxbase_10NGramModel_2uw___get__(PyObject *__pyx_v_self) {
4916   PyObject *__pyx_r = NULL;
4917   PyObject *__pyx_t_1 = NULL;
4918   __Pyx_RefNannySetupContext("__get__");
4919   __Pyx_XDECREF(__pyx_r);
4920   __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_10sphinxbase_NGramModel *)__pyx_v_self)->uw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4921   __Pyx_GOTREF(__pyx_t_1);
4922   __pyx_r = __pyx_t_1;
4923   __pyx_t_1 = 0;
4924   goto __pyx_L0;
4925
4926   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4927   goto __pyx_L0;
4928   __pyx_L1_error:;
4929   __Pyx_XDECREF(__pyx_t_1);
4930   __Pyx_AddTraceback("sphinxbase.NGramModel.uw.__get__");
4931   __pyx_r = NULL;
4932   __pyx_L0:;
4933   __Pyx_XGIVEREF(__pyx_r);
4934   __Pyx_RefNannyFinishContext();
4935   return __pyx_r;
4936 }
4937
4938 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":154
4939  *     cdef int first_item
4940  *     cdef int m
4941  *     cdef readonly float log_prob, log_bowt             # <<<<<<<<<<<<<<
4942  *     cdef readonly object words
4943  * 
4944  */
4945
4946 static PyObject *__pyx_pf_10sphinxbase_9NGramIter_8log_prob___get__(PyObject *__pyx_v_self); /*proto*/
4947 static PyObject *__pyx_pf_10sphinxbase_9NGramIter_8log_prob___get__(PyObject *__pyx_v_self) {
4948   PyObject *__pyx_r = NULL;
4949   PyObject *__pyx_t_1 = NULL;
4950   __Pyx_RefNannySetupContext("__get__");
4951   __Pyx_XDECREF(__pyx_r);
4952   __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_10sphinxbase_NGramIter *)__pyx_v_self)->log_prob); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4953   __Pyx_GOTREF(__pyx_t_1);
4954   __pyx_r = __pyx_t_1;
4955   __pyx_t_1 = 0;
4956   goto __pyx_L0;
4957
4958   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4959   goto __pyx_L0;
4960   __pyx_L1_error:;
4961   __Pyx_XDECREF(__pyx_t_1);
4962   __Pyx_AddTraceback("sphinxbase.NGramIter.log_prob.__get__");
4963   __pyx_r = NULL;
4964   __pyx_L0:;
4965   __Pyx_XGIVEREF(__pyx_r);
4966   __Pyx_RefNannyFinishContext();
4967   return __pyx_r;
4968 }
4969
4970 static PyObject *__pyx_pf_10sphinxbase_9NGramIter_8log_bowt___get__(PyObject *__pyx_v_self); /*proto*/
4971 static PyObject *__pyx_pf_10sphinxbase_9NGramIter_8log_bowt___get__(PyObject *__pyx_v_self) {
4972   PyObject *__pyx_r = NULL;
4973   PyObject *__pyx_t_1 = NULL;
4974   __Pyx_RefNannySetupContext("__get__");
4975   __Pyx_XDECREF(__pyx_r);
4976   __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_10sphinxbase_NGramIter *)__pyx_v_self)->log_bowt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4977   __Pyx_GOTREF(__pyx_t_1);
4978   __pyx_r = __pyx_t_1;
4979   __pyx_t_1 = 0;
4980   goto __pyx_L0;
4981
4982   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4983   goto __pyx_L0;
4984   __pyx_L1_error:;
4985   __Pyx_XDECREF(__pyx_t_1);
4986   __Pyx_AddTraceback("sphinxbase.NGramIter.log_bowt.__get__");
4987   __pyx_r = NULL;
4988   __pyx_L0:;
4989   __Pyx_XGIVEREF(__pyx_r);
4990   __Pyx_RefNannyFinishContext();
4991   return __pyx_r;
4992 }
4993
4994 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":155
4995  *     cdef int m
4996  *     cdef readonly float log_prob, log_bowt
4997  *     cdef readonly object words             # <<<<<<<<<<<<<<
4998  * 
4999  *     cdef set_iter(NGramIter self, ngram_iter_t *itor)
5000  */
5001
5002 static PyObject *__pyx_pf_10sphinxbase_9NGramIter_5words___get__(PyObject *__pyx_v_self); /*proto*/
5003 static PyObject *__pyx_pf_10sphinxbase_9NGramIter_5words___get__(PyObject *__pyx_v_self) {
5004   PyObject *__pyx_r = NULL;
5005   __Pyx_RefNannySetupContext("__get__");
5006   __Pyx_XDECREF(__pyx_r);
5007   __Pyx_INCREF(((struct __pyx_obj_10sphinxbase_NGramIter *)__pyx_v_self)->words);
5008   __pyx_r = ((struct __pyx_obj_10sphinxbase_NGramIter *)__pyx_v_self)->words;
5009   goto __pyx_L0;
5010
5011   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5012   __pyx_L0:;
5013   __Pyx_XGIVEREF(__pyx_r);
5014   __Pyx_RefNannyFinishContext();
5015   return __pyx_r;
5016 }
5017
5018 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":149
5019  *     cdef set_dag(Lattice self, ps_lattice_t *dag)
5020  *     cdef set_boxed(Lattice self, box)
5021  *     cdef readonly n_frames             # <<<<<<<<<<<<<<
5022  * 
5023  * cdef class LatLink:
5024  */
5025
5026 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_8n_frames___get__(PyObject *__pyx_v_self); /*proto*/
5027 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_8n_frames___get__(PyObject *__pyx_v_self) {
5028   PyObject *__pyx_r = NULL;
5029   __Pyx_RefNannySetupContext("__get__");
5030   __Pyx_XDECREF(__pyx_r);
5031   __Pyx_INCREF(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->n_frames);
5032   __pyx_r = ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->n_frames;
5033   goto __pyx_L0;
5034
5035   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5036   __pyx_L0:;
5037   __Pyx_XGIVEREF(__pyx_r);
5038   __Pyx_RefNannyFinishContext();
5039   return __pyx_r;
5040 }
5041
5042 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":154
5043  *     cdef ps_latlink_t *link
5044  *     cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
5045  *     cdef readonly char *word, *baseword             # <<<<<<<<<<<<<<
5046  *     cdef readonly int sf, ef
5047  *     cdef readonly double prob
5048  */
5049
5050 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_4word___get__(PyObject *__pyx_v_self); /*proto*/
5051 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_4word___get__(PyObject *__pyx_v_self) {
5052   PyObject *__pyx_r = NULL;
5053   PyObject *__pyx_t_1 = NULL;
5054   __Pyx_RefNannySetupContext("__get__");
5055   __Pyx_XDECREF(__pyx_r);
5056   __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->word); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5057   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5058   __pyx_r = ((PyObject *)__pyx_t_1);
5059   __pyx_t_1 = 0;
5060   goto __pyx_L0;
5061
5062   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5063   goto __pyx_L0;
5064   __pyx_L1_error:;
5065   __Pyx_XDECREF(__pyx_t_1);
5066   __Pyx_AddTraceback("pocketsphinx.LatLink.word.__get__");
5067   __pyx_r = NULL;
5068   __pyx_L0:;
5069   __Pyx_XGIVEREF(__pyx_r);
5070   __Pyx_RefNannyFinishContext();
5071   return __pyx_r;
5072 }
5073
5074 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_8baseword___get__(PyObject *__pyx_v_self); /*proto*/
5075 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_8baseword___get__(PyObject *__pyx_v_self) {
5076   PyObject *__pyx_r = NULL;
5077   PyObject *__pyx_t_1 = NULL;
5078   __Pyx_RefNannySetupContext("__get__");
5079   __Pyx_XDECREF(__pyx_r);
5080   __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->baseword); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5081   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5082   __pyx_r = ((PyObject *)__pyx_t_1);
5083   __pyx_t_1 = 0;
5084   goto __pyx_L0;
5085
5086   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5087   goto __pyx_L0;
5088   __pyx_L1_error:;
5089   __Pyx_XDECREF(__pyx_t_1);
5090   __Pyx_AddTraceback("pocketsphinx.LatLink.baseword.__get__");
5091   __pyx_r = NULL;
5092   __pyx_L0:;
5093   __Pyx_XGIVEREF(__pyx_r);
5094   __Pyx_RefNannyFinishContext();
5095   return __pyx_r;
5096 }
5097
5098 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":155
5099  *     cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
5100  *     cdef readonly char *word, *baseword
5101  *     cdef readonly int sf, ef             # <<<<<<<<<<<<<<
5102  *     cdef readonly double prob
5103  *     cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link)
5104  */
5105
5106 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_2sf___get__(PyObject *__pyx_v_self); /*proto*/
5107 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_2sf___get__(PyObject *__pyx_v_self) {
5108   PyObject *__pyx_r = NULL;
5109   PyObject *__pyx_t_1 = NULL;
5110   __Pyx_RefNannySetupContext("__get__");
5111   __Pyx_XDECREF(__pyx_r);
5112   __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->sf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5113   __Pyx_GOTREF(__pyx_t_1);
5114   __pyx_r = __pyx_t_1;
5115   __pyx_t_1 = 0;
5116   goto __pyx_L0;
5117
5118   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5119   goto __pyx_L0;
5120   __pyx_L1_error:;
5121   __Pyx_XDECREF(__pyx_t_1);
5122   __Pyx_AddTraceback("pocketsphinx.LatLink.sf.__get__");
5123   __pyx_r = NULL;
5124   __pyx_L0:;
5125   __Pyx_XGIVEREF(__pyx_r);
5126   __Pyx_RefNannyFinishContext();
5127   return __pyx_r;
5128 }
5129
5130 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_2ef___get__(PyObject *__pyx_v_self); /*proto*/
5131 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_2ef___get__(PyObject *__pyx_v_self) {
5132   PyObject *__pyx_r = NULL;
5133   PyObject *__pyx_t_1 = NULL;
5134   __Pyx_RefNannySetupContext("__get__");
5135   __Pyx_XDECREF(__pyx_r);
5136   __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->ef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5137   __Pyx_GOTREF(__pyx_t_1);
5138   __pyx_r = __pyx_t_1;
5139   __pyx_t_1 = 0;
5140   goto __pyx_L0;
5141
5142   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5143   goto __pyx_L0;
5144   __pyx_L1_error:;
5145   __Pyx_XDECREF(__pyx_t_1);
5146   __Pyx_AddTraceback("pocketsphinx.LatLink.ef.__get__");
5147   __pyx_r = NULL;
5148   __pyx_L0:;
5149   __Pyx_XGIVEREF(__pyx_r);
5150   __Pyx_RefNannyFinishContext();
5151   return __pyx_r;
5152 }
5153
5154 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":156
5155  *     cdef readonly char *word, *baseword
5156  *     cdef readonly int sf, ef
5157  *     cdef readonly double prob             # <<<<<<<<<<<<<<
5158  *     cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link)
5159  * 
5160  */
5161
5162 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_4prob___get__(PyObject *__pyx_v_self); /*proto*/
5163 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_4prob___get__(PyObject *__pyx_v_self) {
5164   PyObject *__pyx_r = NULL;
5165   PyObject *__pyx_t_1 = NULL;
5166   __Pyx_RefNannySetupContext("__get__");
5167   __Pyx_XDECREF(__pyx_r);
5168   __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->prob); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5169   __Pyx_GOTREF(__pyx_t_1);
5170   __pyx_r = __pyx_t_1;
5171   __pyx_t_1 = 0;
5172   goto __pyx_L0;
5173
5174   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5175   goto __pyx_L0;
5176   __pyx_L1_error:;
5177   __Pyx_XDECREF(__pyx_t_1);
5178   __Pyx_AddTraceback("pocketsphinx.LatLink.prob.__get__");
5179   __pyx_r = NULL;
5180   __pyx_L0:;
5181   __Pyx_XGIVEREF(__pyx_r);
5182   __Pyx_RefNannyFinishContext();
5183   return __pyx_r;
5184 }
5185
5186 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":167
5187  *     cdef ps_latnode_t *node
5188  *     cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
5189  *     cdef readonly char *word, *baseword             # <<<<<<<<<<<<<<
5190  *     cdef readonly int sf, fef, lef
5191  *     cdef readonly double prob
5192  */
5193
5194 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_4word___get__(PyObject *__pyx_v_self); /*proto*/
5195 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_4word___get__(PyObject *__pyx_v_self) {
5196   PyObject *__pyx_r = NULL;
5197   PyObject *__pyx_t_1 = NULL;
5198   __Pyx_RefNannySetupContext("__get__");
5199   __Pyx_XDECREF(__pyx_r);
5200   __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->word); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5201   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5202   __pyx_r = ((PyObject *)__pyx_t_1);
5203   __pyx_t_1 = 0;
5204   goto __pyx_L0;
5205
5206   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5207   goto __pyx_L0;
5208   __pyx_L1_error:;
5209   __Pyx_XDECREF(__pyx_t_1);
5210   __Pyx_AddTraceback("pocketsphinx.LatNode.word.__get__");
5211   __pyx_r = NULL;
5212   __pyx_L0:;
5213   __Pyx_XGIVEREF(__pyx_r);
5214   __Pyx_RefNannyFinishContext();
5215   return __pyx_r;
5216 }
5217
5218 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_8baseword___get__(PyObject *__pyx_v_self); /*proto*/
5219 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_8baseword___get__(PyObject *__pyx_v_self) {
5220   PyObject *__pyx_r = NULL;
5221   PyObject *__pyx_t_1 = NULL;
5222   __Pyx_RefNannySetupContext("__get__");
5223   __Pyx_XDECREF(__pyx_r);
5224   __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->baseword); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5225   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5226   __pyx_r = ((PyObject *)__pyx_t_1);
5227   __pyx_t_1 = 0;
5228   goto __pyx_L0;
5229
5230   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5231   goto __pyx_L0;
5232   __pyx_L1_error:;
5233   __Pyx_XDECREF(__pyx_t_1);
5234   __Pyx_AddTraceback("pocketsphinx.LatNode.baseword.__get__");
5235   __pyx_r = NULL;
5236   __pyx_L0:;
5237   __Pyx_XGIVEREF(__pyx_r);
5238   __Pyx_RefNannyFinishContext();
5239   return __pyx_r;
5240 }
5241
5242 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":168
5243  *     cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
5244  *     cdef readonly char *word, *baseword
5245  *     cdef readonly int sf, fef, lef             # <<<<<<<<<<<<<<
5246  *     cdef readonly double prob
5247  *     cdef readonly LatLink best_exit
5248  */
5249
5250 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_2sf___get__(PyObject *__pyx_v_self); /*proto*/
5251 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_2sf___get__(PyObject *__pyx_v_self) {
5252   PyObject *__pyx_r = NULL;
5253   PyObject *__pyx_t_1 = NULL;
5254   __Pyx_RefNannySetupContext("__get__");
5255   __Pyx_XDECREF(__pyx_r);
5256   __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->sf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5257   __Pyx_GOTREF(__pyx_t_1);
5258   __pyx_r = __pyx_t_1;
5259   __pyx_t_1 = 0;
5260   goto __pyx_L0;
5261
5262   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5263   goto __pyx_L0;
5264   __pyx_L1_error:;
5265   __Pyx_XDECREF(__pyx_t_1);
5266   __Pyx_AddTraceback("pocketsphinx.LatNode.sf.__get__");
5267   __pyx_r = NULL;
5268   __pyx_L0:;
5269   __Pyx_XGIVEREF(__pyx_r);
5270   __Pyx_RefNannyFinishContext();
5271   return __pyx_r;
5272 }
5273
5274 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_3fef___get__(PyObject *__pyx_v_self); /*proto*/
5275 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_3fef___get__(PyObject *__pyx_v_self) {
5276   PyObject *__pyx_r = NULL;
5277   PyObject *__pyx_t_1 = NULL;
5278   __Pyx_RefNannySetupContext("__get__");
5279   __Pyx_XDECREF(__pyx_r);
5280   __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->fef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5281   __Pyx_GOTREF(__pyx_t_1);
5282   __pyx_r = __pyx_t_1;
5283   __pyx_t_1 = 0;
5284   goto __pyx_L0;
5285
5286   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5287   goto __pyx_L0;
5288   __pyx_L1_error:;
5289   __Pyx_XDECREF(__pyx_t_1);
5290   __Pyx_AddTraceback("pocketsphinx.LatNode.fef.__get__");
5291   __pyx_r = NULL;
5292   __pyx_L0:;
5293   __Pyx_XGIVEREF(__pyx_r);
5294   __Pyx_RefNannyFinishContext();
5295   return __pyx_r;
5296 }
5297
5298 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_3lef___get__(PyObject *__pyx_v_self); /*proto*/
5299 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_3lef___get__(PyObject *__pyx_v_self) {
5300   PyObject *__pyx_r = NULL;
5301   PyObject *__pyx_t_1 = NULL;
5302   __Pyx_RefNannySetupContext("__get__");
5303   __Pyx_XDECREF(__pyx_r);
5304   __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->lef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5305   __Pyx_GOTREF(__pyx_t_1);
5306   __pyx_r = __pyx_t_1;
5307   __pyx_t_1 = 0;
5308   goto __pyx_L0;
5309
5310   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5311   goto __pyx_L0;
5312   __pyx_L1_error:;
5313   __Pyx_XDECREF(__pyx_t_1);
5314   __Pyx_AddTraceback("pocketsphinx.LatNode.lef.__get__");
5315   __pyx_r = NULL;
5316   __pyx_L0:;
5317   __Pyx_XGIVEREF(__pyx_r);
5318   __Pyx_RefNannyFinishContext();
5319   return __pyx_r;
5320 }
5321
5322 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":169
5323  *     cdef readonly char *word, *baseword
5324  *     cdef readonly int sf, fef, lef
5325  *     cdef readonly double prob             # <<<<<<<<<<<<<<
5326  *     cdef readonly LatLink best_exit
5327  *     cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node)
5328  */
5329
5330 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_4prob___get__(PyObject *__pyx_v_self); /*proto*/
5331 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_4prob___get__(PyObject *__pyx_v_self) {
5332   PyObject *__pyx_r = NULL;
5333   PyObject *__pyx_t_1 = NULL;
5334   __Pyx_RefNannySetupContext("__get__");
5335   __Pyx_XDECREF(__pyx_r);
5336   __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->prob); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5337   __Pyx_GOTREF(__pyx_t_1);
5338   __pyx_r = __pyx_t_1;
5339   __pyx_t_1 = 0;
5340   goto __pyx_L0;
5341
5342   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5343   goto __pyx_L0;
5344   __pyx_L1_error:;
5345   __Pyx_XDECREF(__pyx_t_1);
5346   __Pyx_AddTraceback("pocketsphinx.LatNode.prob.__get__");
5347   __pyx_r = NULL;
5348   __pyx_L0:;
5349   __Pyx_XGIVEREF(__pyx_r);
5350   __Pyx_RefNannyFinishContext();
5351   return __pyx_r;
5352 }
5353
5354 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":170
5355  *     cdef readonly int sf, fef, lef
5356  *     cdef readonly double prob
5357  *     cdef readonly LatLink best_exit             # <<<<<<<<<<<<<<
5358  *     cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node)
5359  * 
5360  */
5361
5362 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_9best_exit___get__(PyObject *__pyx_v_self); /*proto*/
5363 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_9best_exit___get__(PyObject *__pyx_v_self) {
5364   PyObject *__pyx_r = NULL;
5365   __Pyx_RefNannySetupContext("__get__");
5366   __Pyx_XDECREF(__pyx_r);
5367   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->best_exit));
5368   __pyx_r = ((PyObject *)((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->best_exit);
5369   goto __pyx_L0;
5370
5371   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5372   __pyx_L0:;
5373   __Pyx_XGIVEREF(__pyx_r);
5374   __Pyx_RefNannyFinishContext();
5375   return __pyx_r;
5376 }
5377 static struct __pyx_vtabstruct_12pocketsphinx_Decoder __pyx_vtable_12pocketsphinx_Decoder;
5378
5379 static PyObject *__pyx_tp_new_12pocketsphinx_Decoder(PyTypeObject *t, PyObject *a, PyObject *k) {
5380   struct __pyx_obj_12pocketsphinx_Decoder *p;
5381   PyObject *o = (*t->tp_alloc)(t, 0);
5382   if (!o) return 0;
5383   p = ((struct __pyx_obj_12pocketsphinx_Decoder *)o);
5384   p->__pyx_vtab = __pyx_vtabptr_12pocketsphinx_Decoder;
5385   return o;
5386 }
5387
5388 static void __pyx_tp_dealloc_12pocketsphinx_Decoder(PyObject *o) {
5389   {
5390     PyObject *etype, *eval, *etb;
5391     PyErr_Fetch(&etype, &eval, &etb);
5392     ++Py_REFCNT(o);
5393     __pyx_pf_12pocketsphinx_7Decoder___dealloc__(o);
5394     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
5395     --Py_REFCNT(o);
5396     PyErr_Restore(etype, eval, etb);
5397   }
5398   (*Py_TYPE(o)->tp_free)(o);
5399 }
5400
5401 static PyMethodDef __pyx_methods_12pocketsphinx_Decoder[] = {
5402   {__Pyx_NAMESTR("decode_raw"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_decode_raw, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_decode_raw)},
5403   {__Pyx_NAMESTR("decode_senscr"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_decode_senscr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_decode_senscr)},
5404   {__Pyx_NAMESTR("start_utt"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_start_utt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_start_utt)},
5405   {__Pyx_NAMESTR("process_raw"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_process_raw, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_process_raw)},
5406   {__Pyx_NAMESTR("ps_end_utt"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_ps_end_utt, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_ps_end_utt)},
5407   {__Pyx_NAMESTR("get_hyp"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_get_hyp, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_get_hyp)},
5408   {__Pyx_NAMESTR("get_prob"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_get_prob, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_get_prob)},
5409   {__Pyx_NAMESTR("get_lattice"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_get_lattice, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_get_lattice)},
5410   {__Pyx_NAMESTR("get_lmset"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_get_lmset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_get_lmset)},
5411   {__Pyx_NAMESTR("add_word"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_add_word, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_add_word)},
5412   {__Pyx_NAMESTR("load_dict"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_load_dict, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_load_dict)},
5413   {__Pyx_NAMESTR("save_dict"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_save_dict, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_save_dict)},
5414   {0, 0, 0, 0}
5415 };
5416
5417 static PyNumberMethods __pyx_tp_as_number_Decoder = {
5418   0, /*nb_add*/
5419   0, /*nb_subtract*/
5420   0, /*nb_multiply*/
5421   #if PY_MAJOR_VERSION < 3
5422   0, /*nb_divide*/
5423   #endif
5424   0, /*nb_remainder*/
5425   0, /*nb_divmod*/
5426   0, /*nb_power*/
5427   0, /*nb_negative*/
5428   0, /*nb_positive*/
5429   0, /*nb_absolute*/
5430   0, /*nb_nonzero*/
5431   0, /*nb_invert*/
5432   0, /*nb_lshift*/
5433   0, /*nb_rshift*/
5434   0, /*nb_and*/
5435   0, /*nb_xor*/
5436   0, /*nb_or*/
5437   #if PY_MAJOR_VERSION < 3
5438   0, /*nb_coerce*/
5439   #endif
5440   0, /*nb_int*/
5441   #if PY_MAJOR_VERSION < 3
5442   0, /*nb_long*/
5443   #else
5444   0, /*reserved*/
5445   #endif
5446   0, /*nb_float*/
5447   #if PY_MAJOR_VERSION < 3
5448   0, /*nb_oct*/
5449   #endif
5450   #if PY_MAJOR_VERSION < 3
5451   0, /*nb_hex*/
5452   #endif
5453   0, /*nb_inplace_add*/
5454   0, /*nb_inplace_subtract*/
5455   0, /*nb_inplace_multiply*/
5456   #if PY_MAJOR_VERSION < 3
5457   0, /*nb_inplace_divide*/
5458   #endif
5459   0, /*nb_inplace_remainder*/
5460   0, /*nb_inplace_power*/
5461   0, /*nb_inplace_lshift*/
5462   0, /*nb_inplace_rshift*/
5463   0, /*nb_inplace_and*/
5464   0, /*nb_inplace_xor*/
5465   0, /*nb_inplace_or*/
5466   0, /*nb_floor_divide*/
5467   0, /*nb_true_divide*/
5468   0, /*nb_inplace_floor_divide*/
5469   0, /*nb_inplace_true_divide*/
5470   #if PY_VERSION_HEX >= 0x02050000
5471   0, /*nb_index*/
5472   #endif
5473 };
5474
5475 static PySequenceMethods __pyx_tp_as_sequence_Decoder = {
5476   0, /*sq_length*/
5477   0, /*sq_concat*/
5478   0, /*sq_repeat*/
5479   0, /*sq_item*/
5480   0, /*sq_slice*/
5481   0, /*sq_ass_item*/
5482   0, /*sq_ass_slice*/
5483   0, /*sq_contains*/
5484   0, /*sq_inplace_concat*/
5485   0, /*sq_inplace_repeat*/
5486 };
5487
5488 static PyMappingMethods __pyx_tp_as_mapping_Decoder = {
5489   0, /*mp_length*/
5490   0, /*mp_subscript*/
5491   0, /*mp_ass_subscript*/
5492 };
5493
5494 static PyBufferProcs __pyx_tp_as_buffer_Decoder = {
5495   #if PY_MAJOR_VERSION < 3
5496   0, /*bf_getreadbuffer*/
5497   #endif
5498   #if PY_MAJOR_VERSION < 3
5499   0, /*bf_getwritebuffer*/
5500   #endif
5501   #if PY_MAJOR_VERSION < 3
5502   0, /*bf_getsegcount*/
5503   #endif
5504   #if PY_MAJOR_VERSION < 3
5505   0, /*bf_getcharbuffer*/
5506   #endif
5507   #if PY_VERSION_HEX >= 0x02060000
5508   0, /*bf_getbuffer*/
5509   #endif
5510   #if PY_VERSION_HEX >= 0x02060000
5511   0, /*bf_releasebuffer*/
5512   #endif
5513 };
5514
5515 PyTypeObject __pyx_type_12pocketsphinx_Decoder = {
5516   PyVarObject_HEAD_INIT(0, 0)
5517   __Pyx_NAMESTR("pocketsphinx.Decoder"), /*tp_name*/
5518   sizeof(struct __pyx_obj_12pocketsphinx_Decoder), /*tp_basicsize*/
5519   0, /*tp_itemsize*/
5520   __pyx_tp_dealloc_12pocketsphinx_Decoder, /*tp_dealloc*/
5521   0, /*tp_print*/
5522   0, /*tp_getattr*/
5523   0, /*tp_setattr*/
5524   #if PY_MAJOR_VERSION < 3
5525   0, /*tp_compare*/
5526   #else
5527   0, /*reserved*/
5528   #endif
5529   0, /*tp_repr*/
5530   &__pyx_tp_as_number_Decoder, /*tp_as_number*/
5531   &__pyx_tp_as_sequence_Decoder, /*tp_as_sequence*/
5532   &__pyx_tp_as_mapping_Decoder, /*tp_as_mapping*/
5533   0, /*tp_hash*/
5534   0, /*tp_call*/
5535   0, /*tp_str*/
5536   0, /*tp_getattro*/
5537   0, /*tp_setattro*/
5538   &__pyx_tp_as_buffer_Decoder, /*tp_as_buffer*/
5539   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
5540   __Pyx_DOCSTR("\n    PocketSphinx speech decoder.\n\n    To initialize the PocketSphinx decoder, pass a list of keyword\n    arguments to the constructor::\n\n     d = pocketsphinx.Decoder(hmm='/path/to/acoustic/model',\n                              lm='/path/to/language/model',\n                              dict='/path/to/dictionary',\n                              beam='1e-80')\n\n    If no arguments are passed, the default acoustic and language\n    models will be loaded, which may be acceptable for general English\n    speech.  Any arguments supported by the PocketSphinx decoder are\n    allowed here.  Only the most frequent ones are described below.\n\n    @param boxed: Boxed pointer from GStreamer containing a decoder\n    @type boxed: PyGBoxed\n    @param hmm: Path to acoustic model directory\n    @type hmm: str\n    @param dict: Path to dictionary file\n    @type dict: str\n    @param lm: Path to language model file\n    @type lm: str\n    @param jsgf: Path to JSGF grammar file\n    @type jsgf str\n    "), /*tp_doc*/
5541   0, /*tp_traverse*/
5542   0, /*tp_clear*/
5543   0, /*tp_richcompare*/
5544   0, /*tp_weaklistoffset*/
5545   0, /*tp_iter*/
5546   0, /*tp_iternext*/
5547   __pyx_methods_12pocketsphinx_Decoder, /*tp_methods*/
5548   0, /*tp_members*/
5549   0, /*tp_getset*/
5550   0, /*tp_base*/
5551   0, /*tp_dict*/
5552   0, /*tp_descr_get*/
5553   0, /*tp_descr_set*/
5554   0, /*tp_dictoffset*/
5555   __pyx_pf_12pocketsphinx_7Decoder___init__, /*tp_init*/
5556   0, /*tp_alloc*/
5557   __pyx_tp_new_12pocketsphinx_Decoder, /*tp_new*/
5558   0, /*tp_free*/
5559   0, /*tp_is_gc*/
5560   0, /*tp_bases*/
5561   0, /*tp_mro*/
5562   0, /*tp_cache*/
5563   0, /*tp_subclasses*/
5564   0, /*tp_weaklist*/
5565   0, /*tp_del*/
5566   #if PY_VERSION_HEX >= 0x02060000
5567   0, /*tp_version_tag*/
5568   #endif
5569 };
5570 static struct __pyx_vtabstruct_12pocketsphinx_Lattice __pyx_vtable_12pocketsphinx_Lattice;
5571
5572 static PyObject *__pyx_tp_new_12pocketsphinx_Lattice(PyTypeObject *t, PyObject *a, PyObject *k) {
5573   struct __pyx_obj_12pocketsphinx_Lattice *p;
5574   PyObject *o = (*t->tp_alloc)(t, 0);
5575   if (!o) return 0;
5576   p = ((struct __pyx_obj_12pocketsphinx_Lattice *)o);
5577   p->__pyx_vtab = __pyx_vtabptr_12pocketsphinx_Lattice;
5578   p->n_frames = Py_None; Py_INCREF(Py_None);
5579   return o;
5580 }
5581
5582 static void __pyx_tp_dealloc_12pocketsphinx_Lattice(PyObject *o) {
5583   struct __pyx_obj_12pocketsphinx_Lattice *p = (struct __pyx_obj_12pocketsphinx_Lattice *)o;
5584   {
5585     PyObject *etype, *eval, *etb;
5586     PyErr_Fetch(&etype, &eval, &etb);
5587     ++Py_REFCNT(o);
5588     __pyx_pf_12pocketsphinx_7Lattice___dealloc__(o);
5589     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
5590     --Py_REFCNT(o);
5591     PyErr_Restore(etype, eval, etb);
5592   }
5593   Py_XDECREF(p->n_frames);
5594   (*Py_TYPE(o)->tp_free)(o);
5595 }
5596
5597 static int __pyx_tp_traverse_12pocketsphinx_Lattice(PyObject *o, visitproc v, void *a) {
5598   int e;
5599   struct __pyx_obj_12pocketsphinx_Lattice *p = (struct __pyx_obj_12pocketsphinx_Lattice *)o;
5600   if (p->n_frames) {
5601     e = (*v)(p->n_frames, a); if (e) return e;
5602   }
5603   return 0;
5604 }
5605
5606 static int __pyx_tp_clear_12pocketsphinx_Lattice(PyObject *o) {
5607   struct __pyx_obj_12pocketsphinx_Lattice *p = (struct __pyx_obj_12pocketsphinx_Lattice *)o;
5608   PyObject* tmp;
5609   tmp = ((PyObject*)p->n_frames);
5610   p->n_frames = Py_None; Py_INCREF(Py_None);
5611   Py_XDECREF(tmp);
5612   return 0;
5613 }
5614
5615 static PyObject *__pyx_getprop_12pocketsphinx_7Lattice_n_frames(PyObject *o, void *x) {
5616   return __pyx_pf_12pocketsphinx_7Lattice_8n_frames___get__(o);
5617 }
5618
5619 static PyMethodDef __pyx_methods_12pocketsphinx_Lattice[] = {
5620   {__Pyx_NAMESTR("bestpath"), (PyCFunction)__pyx_pf_12pocketsphinx_7Lattice_bestpath, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Lattice_bestpath)},
5621   {__Pyx_NAMESTR("posterior"), (PyCFunction)__pyx_pf_12pocketsphinx_7Lattice_posterior, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Lattice_posterior)},
5622   {__Pyx_NAMESTR("nodes"), (PyCFunction)__pyx_pf_12pocketsphinx_7Lattice_nodes, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Lattice_nodes)},
5623   {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pf_12pocketsphinx_7Lattice_write, METH_O, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Lattice_write)},
5624   {0, 0, 0, 0}
5625 };
5626
5627 static struct PyGetSetDef __pyx_getsets_12pocketsphinx_Lattice[] = {
5628   {(char *)"n_frames", __pyx_getprop_12pocketsphinx_7Lattice_n_frames, 0, 0, 0},
5629   {0, 0, 0, 0, 0}
5630 };
5631
5632 static PyNumberMethods __pyx_tp_as_number_Lattice = {
5633   0, /*nb_add*/
5634   0, /*nb_subtract*/
5635   0, /*nb_multiply*/
5636   #if PY_MAJOR_VERSION < 3
5637   0, /*nb_divide*/
5638   #endif
5639   0, /*nb_remainder*/
5640   0, /*nb_divmod*/
5641   0, /*nb_power*/
5642   0, /*nb_negative*/
5643   0, /*nb_positive*/
5644   0, /*nb_absolute*/
5645   0, /*nb_nonzero*/
5646   0, /*nb_invert*/
5647   0, /*nb_lshift*/
5648   0, /*nb_rshift*/
5649   0, /*nb_and*/
5650   0, /*nb_xor*/
5651   0, /*nb_or*/
5652   #if PY_MAJOR_VERSION < 3
5653   0, /*nb_coerce*/
5654   #endif
5655   0, /*nb_int*/
5656   #if PY_MAJOR_VERSION < 3
5657   0, /*nb_long*/
5658   #else
5659   0, /*reserved*/
5660   #endif
5661   0, /*nb_float*/
5662   #if PY_MAJOR_VERSION < 3
5663   0, /*nb_oct*/
5664   #endif
5665   #if PY_MAJOR_VERSION < 3
5666   0, /*nb_hex*/
5667   #endif
5668   0, /*nb_inplace_add*/
5669   0, /*nb_inplace_subtract*/
5670   0, /*nb_inplace_multiply*/
5671   #if PY_MAJOR_VERSION < 3
5672   0, /*nb_inplace_divide*/
5673   #endif
5674   0, /*nb_inplace_remainder*/
5675   0, /*nb_inplace_power*/
5676   0, /*nb_inplace_lshift*/
5677   0, /*nb_inplace_rshift*/
5678   0, /*nb_inplace_and*/
5679   0, /*nb_inplace_xor*/
5680   0, /*nb_inplace_or*/
5681   0, /*nb_floor_divide*/
5682   0, /*nb_true_divide*/
5683   0, /*nb_inplace_floor_divide*/
5684   0, /*nb_inplace_true_divide*/
5685   #if PY_VERSION_HEX >= 0x02050000
5686   0, /*nb_index*/
5687   #endif
5688 };
5689
5690 static PySequenceMethods __pyx_tp_as_sequence_Lattice = {
5691   0, /*sq_length*/
5692   0, /*sq_concat*/
5693   0, /*sq_repeat*/
5694   0, /*sq_item*/
5695   0, /*sq_slice*/
5696   0, /*sq_ass_item*/
5697   0, /*sq_ass_slice*/
5698   0, /*sq_contains*/
5699   0, /*sq_inplace_concat*/
5700   0, /*sq_inplace_repeat*/
5701 };
5702
5703 static PyMappingMethods __pyx_tp_as_mapping_Lattice = {
5704   0, /*mp_length*/
5705   0, /*mp_subscript*/
5706   0, /*mp_ass_subscript*/
5707 };
5708
5709 static PyBufferProcs __pyx_tp_as_buffer_Lattice = {
5710   #if PY_MAJOR_VERSION < 3
5711   0, /*bf_getreadbuffer*/
5712   #endif
5713   #if PY_MAJOR_VERSION < 3
5714   0, /*bf_getwritebuffer*/
5715   #endif
5716   #if PY_MAJOR_VERSION < 3
5717   0, /*bf_getsegcount*/
5718   #endif
5719   #if PY_MAJOR_VERSION < 3
5720   0, /*bf_getcharbuffer*/
5721   #endif
5722   #if PY_VERSION_HEX >= 0x02060000
5723   0, /*bf_getbuffer*/
5724   #endif
5725   #if PY_VERSION_HEX >= 0x02060000
5726   0, /*bf_releasebuffer*/
5727   #endif
5728 };
5729
5730 PyTypeObject __pyx_type_12pocketsphinx_Lattice = {
5731   PyVarObject_HEAD_INIT(0, 0)
5732   __Pyx_NAMESTR("pocketsphinx.Lattice"), /*tp_name*/
5733   sizeof(struct __pyx_obj_12pocketsphinx_Lattice), /*tp_basicsize*/
5734   0, /*tp_itemsize*/
5735   __pyx_tp_dealloc_12pocketsphinx_Lattice, /*tp_dealloc*/
5736   0, /*tp_print*/
5737   0, /*tp_getattr*/
5738   0, /*tp_setattr*/
5739   #if PY_MAJOR_VERSION < 3
5740   0, /*tp_compare*/
5741   #else
5742   0, /*reserved*/
5743   #endif
5744   0, /*tp_repr*/
5745   &__pyx_tp_as_number_Lattice, /*tp_as_number*/
5746   &__pyx_tp_as_sequence_Lattice, /*tp_as_sequence*/
5747   &__pyx_tp_as_mapping_Lattice, /*tp_as_mapping*/
5748   0, /*tp_hash*/
5749   0, /*tp_call*/
5750   0, /*tp_str*/
5751   0, /*tp_getattro*/
5752   0, /*tp_setattro*/
5753   &__pyx_tp_as_buffer_Lattice, /*tp_as_buffer*/
5754   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
5755   __Pyx_DOCSTR("\n    Word lattice.\n\n    The word lattice is a compact representation of the set of\n    hypotheses considered by the decoder when recognizing an\n    utterance.\n\n    A lattice object can be constructed either from a lattice file\n    on disk or from a 'boxed' object passed in from GStreamer (or,\n    in theory, anything else that uses GLib).  In the first case,\n    the C{ps} argument is required.\n\n    @param ps: PocketSphinx decoder.\n    @type ps: Decoder\n    @param latfile: Filename of lattice file to read.\n    @type latfile: str\n    @param boxed: Boxed pointer from GStreamer containing a lattice\n    @type boxed: PyGBoxed\n\n    @ivar n_frames: Number of frames of audio covered by this lattice\n    @type n_frames: int\n    @ivar start: Start node\n    @type start: LatNode\n    @ivar end: End node\n    @type end: LatNode\n    "), /*tp_doc*/
5756   __pyx_tp_traverse_12pocketsphinx_Lattice, /*tp_traverse*/
5757   __pyx_tp_clear_12pocketsphinx_Lattice, /*tp_clear*/
5758   0, /*tp_richcompare*/
5759   0, /*tp_weaklistoffset*/
5760   0, /*tp_iter*/
5761   0, /*tp_iternext*/
5762   __pyx_methods_12pocketsphinx_Lattice, /*tp_methods*/
5763   0, /*tp_members*/
5764   __pyx_getsets_12pocketsphinx_Lattice, /*tp_getset*/
5765   0, /*tp_base*/
5766   0, /*tp_dict*/
5767   0, /*tp_descr_get*/
5768   0, /*tp_descr_set*/
5769   0, /*tp_dictoffset*/
5770   __pyx_pf_12pocketsphinx_7Lattice___init__, /*tp_init*/
5771   0, /*tp_alloc*/
5772   __pyx_tp_new_12pocketsphinx_Lattice, /*tp_new*/
5773   0, /*tp_free*/
5774   0, /*tp_is_gc*/
5775   0, /*tp_bases*/
5776   0, /*tp_mro*/
5777   0, /*tp_cache*/
5778   0, /*tp_subclasses*/
5779   0, /*tp_weaklist*/
5780   0, /*tp_del*/
5781   #if PY_VERSION_HEX >= 0x02060000
5782   0, /*tp_version_tag*/
5783   #endif
5784 };
5785 static struct __pyx_vtabstruct_12pocketsphinx_LatLink __pyx_vtable_12pocketsphinx_LatLink;
5786
5787 static PyObject *__pyx_tp_new_12pocketsphinx_LatLink(PyTypeObject *t, PyObject *a, PyObject *k) {
5788   struct __pyx_obj_12pocketsphinx_LatLink *p;
5789   PyObject *o = (*t->tp_alloc)(t, 0);
5790   if (!o) return 0;
5791   p = ((struct __pyx_obj_12pocketsphinx_LatLink *)o);
5792   p->__pyx_vtab = __pyx_vtabptr_12pocketsphinx_LatLink;
5793   if (__pyx_pf_12pocketsphinx_7LatLink___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
5794     Py_DECREF(o); o = 0;
5795   }
5796   return o;
5797 }
5798
5799 static void __pyx_tp_dealloc_12pocketsphinx_LatLink(PyObject *o) {
5800   (*Py_TYPE(o)->tp_free)(o);
5801 }
5802
5803 static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_word(PyObject *o, void *x) {
5804   return __pyx_pf_12pocketsphinx_7LatLink_4word___get__(o);
5805 }
5806
5807 static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_baseword(PyObject *o, void *x) {
5808   return __pyx_pf_12pocketsphinx_7LatLink_8baseword___get__(o);
5809 }
5810
5811 static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_sf(PyObject *o, void *x) {
5812   return __pyx_pf_12pocketsphinx_7LatLink_2sf___get__(o);
5813 }
5814
5815 static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_ef(PyObject *o, void *x) {
5816   return __pyx_pf_12pocketsphinx_7LatLink_2ef___get__(o);
5817 }
5818
5819 static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_prob(PyObject *o, void *x) {
5820   return __pyx_pf_12pocketsphinx_7LatLink_4prob___get__(o);
5821 }
5822
5823 static PyMethodDef __pyx_methods_12pocketsphinx_LatLink[] = {
5824   {__Pyx_NAMESTR("nodes"), (PyCFunction)__pyx_pf_12pocketsphinx_7LatLink_nodes, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7LatLink_nodes)},
5825   {__Pyx_NAMESTR("pred"), (PyCFunction)__pyx_pf_12pocketsphinx_7LatLink_pred, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7LatLink_pred)},
5826   {0, 0, 0, 0}
5827 };
5828
5829 static struct PyGetSetDef __pyx_getsets_12pocketsphinx_LatLink[] = {
5830   {(char *)"word", __pyx_getprop_12pocketsphinx_7LatLink_word, 0, 0, 0},
5831   {(char *)"baseword", __pyx_getprop_12pocketsphinx_7LatLink_baseword, 0, 0, 0},
5832   {(char *)"sf", __pyx_getprop_12pocketsphinx_7LatLink_sf, 0, 0, 0},
5833   {(char *)"ef", __pyx_getprop_12pocketsphinx_7LatLink_ef, 0, 0, 0},
5834   {(char *)"prob", __pyx_getprop_12pocketsphinx_7LatLink_prob, 0, 0, 0},
5835   {0, 0, 0, 0, 0}
5836 };
5837
5838 static PyNumberMethods __pyx_tp_as_number_LatLink = {
5839   0, /*nb_add*/
5840   0, /*nb_subtract*/
5841   0, /*nb_multiply*/
5842   #if PY_MAJOR_VERSION < 3
5843   0, /*nb_divide*/
5844   #endif
5845   0, /*nb_remainder*/
5846   0, /*nb_divmod*/
5847   0, /*nb_power*/
5848   0, /*nb_negative*/
5849   0, /*nb_positive*/
5850   0, /*nb_absolute*/
5851   0, /*nb_nonzero*/
5852   0, /*nb_invert*/
5853   0, /*nb_lshift*/
5854   0, /*nb_rshift*/
5855   0, /*nb_and*/
5856   0, /*nb_xor*/
5857   0, /*nb_or*/
5858   #if PY_MAJOR_VERSION < 3
5859   0, /*nb_coerce*/
5860   #endif
5861   0, /*nb_int*/
5862   #if PY_MAJOR_VERSION < 3
5863   0, /*nb_long*/
5864   #else
5865   0, /*reserved*/
5866   #endif
5867   0, /*nb_float*/
5868   #if PY_MAJOR_VERSION < 3
5869   0, /*nb_oct*/
5870   #endif
5871   #if PY_MAJOR_VERSION < 3
5872   0, /*nb_hex*/
5873   #endif
5874   0, /*nb_inplace_add*/
5875   0, /*nb_inplace_subtract*/
5876   0, /*nb_inplace_multiply*/
5877   #if PY_MAJOR_VERSION < 3
5878   0, /*nb_inplace_divide*/
5879   #endif
5880   0, /*nb_inplace_remainder*/
5881   0, /*nb_inplace_power*/
5882   0, /*nb_inplace_lshift*/
5883   0, /*nb_inplace_rshift*/
5884   0, /*nb_inplace_and*/
5885   0, /*nb_inplace_xor*/
5886   0, /*nb_inplace_or*/
5887   0, /*nb_floor_divide*/
5888   0, /*nb_true_divide*/
5889   0, /*nb_inplace_floor_divide*/
5890   0, /*nb_inplace_true_divide*/
5891   #if PY_VERSION_HEX >= 0x02050000
5892   0, /*nb_index*/
5893   #endif
5894 };
5895
5896 static PySequenceMethods __pyx_tp_as_sequence_LatLink = {
5897   0, /*sq_length*/
5898   0, /*sq_concat*/
5899   0, /*sq_repeat*/
5900   0, /*sq_item*/
5901   0, /*sq_slice*/
5902   0, /*sq_ass_item*/
5903   0, /*sq_ass_slice*/
5904   0, /*sq_contains*/
5905   0, /*sq_inplace_concat*/
5906   0, /*sq_inplace_repeat*/
5907 };
5908
5909 static PyMappingMethods __pyx_tp_as_mapping_LatLink = {
5910   0, /*mp_length*/
5911   0, /*mp_subscript*/
5912   0, /*mp_ass_subscript*/
5913 };
5914
5915 static PyBufferProcs __pyx_tp_as_buffer_LatLink = {
5916   #if PY_MAJOR_VERSION < 3
5917   0, /*bf_getreadbuffer*/
5918   #endif
5919   #if PY_MAJOR_VERSION < 3
5920   0, /*bf_getwritebuffer*/
5921   #endif
5922   #if PY_MAJOR_VERSION < 3
5923   0, /*bf_getsegcount*/
5924   #endif
5925   #if PY_MAJOR_VERSION < 3
5926   0, /*bf_getcharbuffer*/
5927   #endif
5928   #if PY_VERSION_HEX >= 0x02060000
5929   0, /*bf_getbuffer*/
5930   #endif
5931   #if PY_VERSION_HEX >= 0x02060000
5932   0, /*bf_releasebuffer*/
5933   #endif
5934 };
5935
5936 PyTypeObject __pyx_type_12pocketsphinx_LatLink = {
5937   PyVarObject_HEAD_INIT(0, 0)
5938   __Pyx_NAMESTR("pocketsphinx.LatLink"), /*tp_name*/
5939   sizeof(struct __pyx_obj_12pocketsphinx_LatLink), /*tp_basicsize*/
5940   0, /*tp_itemsize*/
5941   __pyx_tp_dealloc_12pocketsphinx_LatLink, /*tp_dealloc*/
5942   0, /*tp_print*/
5943   0, /*tp_getattr*/
5944   0, /*tp_setattr*/
5945   #if PY_MAJOR_VERSION < 3
5946   0, /*tp_compare*/
5947   #else
5948   0, /*reserved*/
5949   #endif
5950   0, /*tp_repr*/
5951   &__pyx_tp_as_number_LatLink, /*tp_as_number*/
5952   &__pyx_tp_as_sequence_LatLink, /*tp_as_sequence*/
5953   &__pyx_tp_as_mapping_LatLink, /*tp_as_mapping*/
5954   0, /*tp_hash*/
5955   0, /*tp_call*/
5956   0, /*tp_str*/
5957   0, /*tp_getattro*/
5958   0, /*tp_setattro*/
5959   &__pyx_tp_as_buffer_LatLink, /*tp_as_buffer*/
5960   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
5961   __Pyx_DOCSTR("\n    Link (edge) in a word lattice, connecting two nodes.\n\n    @ivar word: Word (with pronunciation variant) for this link.\n    @type word: str\n    @ivar baseword: Base word (no pronunciation variant) for this link.\n    @type baseword: str\n    @ivar sf: Start frame for this link.\n    @type sf: int\n    @ivar fef: Ending frame for this link.\n    @type fef: int\n    @ivar prob: Posterior probability for this link.\n    @type prob: float\n    "), /*tp_doc*/
5962   0, /*tp_traverse*/
5963   0, /*tp_clear*/
5964   0, /*tp_richcompare*/
5965   0, /*tp_weaklistoffset*/
5966   0, /*tp_iter*/
5967   0, /*tp_iternext*/
5968   __pyx_methods_12pocketsphinx_LatLink, /*tp_methods*/
5969   0, /*tp_members*/
5970   __pyx_getsets_12pocketsphinx_LatLink, /*tp_getset*/
5971   0, /*tp_base*/
5972   0, /*tp_dict*/
5973   0, /*tp_descr_get*/
5974   0, /*tp_descr_set*/
5975   0, /*tp_dictoffset*/
5976   0, /*tp_init*/
5977   0, /*tp_alloc*/
5978   __pyx_tp_new_12pocketsphinx_LatLink, /*tp_new*/
5979   0, /*tp_free*/
5980   0, /*tp_is_gc*/
5981   0, /*tp_bases*/
5982   0, /*tp_mro*/
5983   0, /*tp_cache*/
5984   0, /*tp_subclasses*/
5985   0, /*tp_weaklist*/
5986   0, /*tp_del*/
5987   #if PY_VERSION_HEX >= 0x02060000
5988   0, /*tp_version_tag*/
5989   #endif
5990 };
5991
5992 static PyObject *__pyx_tp_new_12pocketsphinx_LatLinkIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
5993   PyObject *o = (*t->tp_alloc)(t, 0);
5994   if (!o) return 0;
5995   if (__pyx_pf_12pocketsphinx_15LatLinkIterator___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
5996     Py_DECREF(o); o = 0;
5997   }
5998   return o;
5999 }
6000
6001 static void __pyx_tp_dealloc_12pocketsphinx_LatLinkIterator(PyObject *o) {
6002   (*Py_TYPE(o)->tp_free)(o);
6003 }
6004
6005 static PyMethodDef __pyx_methods_12pocketsphinx_LatLinkIterator[] = {
6006   {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_12pocketsphinx_15LatLinkIterator___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_15LatLinkIterator___next__)},
6007   {0, 0, 0, 0}
6008 };
6009
6010 static PyNumberMethods __pyx_tp_as_number_LatLinkIterator = {
6011   0, /*nb_add*/
6012   0, /*nb_subtract*/
6013   0, /*nb_multiply*/
6014   #if PY_MAJOR_VERSION < 3
6015   0, /*nb_divide*/
6016   #endif
6017   0, /*nb_remainder*/
6018   0, /*nb_divmod*/
6019   0, /*nb_power*/
6020   0, /*nb_negative*/
6021   0, /*nb_positive*/
6022   0, /*nb_absolute*/
6023   0, /*nb_nonzero*/
6024   0, /*nb_invert*/
6025   0, /*nb_lshift*/
6026   0, /*nb_rshift*/
6027   0, /*nb_and*/
6028   0, /*nb_xor*/
6029   0, /*nb_or*/
6030   #if PY_MAJOR_VERSION < 3
6031   0, /*nb_coerce*/
6032   #endif
6033   0, /*nb_int*/
6034   #if PY_MAJOR_VERSION < 3
6035   0, /*nb_long*/
6036   #else
6037   0, /*reserved*/
6038   #endif
6039   0, /*nb_float*/
6040   #if PY_MAJOR_VERSION < 3
6041   0, /*nb_oct*/
6042   #endif
6043   #if PY_MAJOR_VERSION < 3
6044   0, /*nb_hex*/
6045   #endif
6046   0, /*nb_inplace_add*/
6047   0, /*nb_inplace_subtract*/
6048   0, /*nb_inplace_multiply*/
6049   #if PY_MAJOR_VERSION < 3
6050   0, /*nb_inplace_divide*/
6051   #endif
6052   0, /*nb_inplace_remainder*/
6053   0, /*nb_inplace_power*/
6054   0, /*nb_inplace_lshift*/
6055   0, /*nb_inplace_rshift*/
6056   0, /*nb_inplace_and*/
6057   0, /*nb_inplace_xor*/
6058   0, /*nb_inplace_or*/
6059   0, /*nb_floor_divide*/
6060   0, /*nb_true_divide*/
6061   0, /*nb_inplace_floor_divide*/
6062   0, /*nb_inplace_true_divide*/
6063   #if PY_VERSION_HEX >= 0x02050000
6064   0, /*nb_index*/
6065   #endif
6066 };
6067
6068 static PySequenceMethods __pyx_tp_as_sequence_LatLinkIterator = {
6069   0, /*sq_length*/
6070   0, /*sq_concat*/
6071   0, /*sq_repeat*/
6072   0, /*sq_item*/
6073   0, /*sq_slice*/
6074   0, /*sq_ass_item*/
6075   0, /*sq_ass_slice*/
6076   0, /*sq_contains*/
6077   0, /*sq_inplace_concat*/
6078   0, /*sq_inplace_repeat*/
6079 };
6080
6081 static PyMappingMethods __pyx_tp_as_mapping_LatLinkIterator = {
6082   0, /*mp_length*/
6083   0, /*mp_subscript*/
6084   0, /*mp_ass_subscript*/
6085 };
6086
6087 static PyBufferProcs __pyx_tp_as_buffer_LatLinkIterator = {
6088   #if PY_MAJOR_VERSION < 3
6089   0, /*bf_getreadbuffer*/
6090   #endif
6091   #if PY_MAJOR_VERSION < 3
6092   0, /*bf_getwritebuffer*/
6093   #endif
6094   #if PY_MAJOR_VERSION < 3
6095   0, /*bf_getsegcount*/
6096   #endif
6097   #if PY_MAJOR_VERSION < 3
6098   0, /*bf_getcharbuffer*/
6099   #endif
6100   #if PY_VERSION_HEX >= 0x02060000
6101   0, /*bf_getbuffer*/
6102   #endif
6103   #if PY_VERSION_HEX >= 0x02060000
6104   0, /*bf_releasebuffer*/
6105   #endif
6106 };
6107
6108 PyTypeObject __pyx_type_12pocketsphinx_LatLinkIterator = {
6109   PyVarObject_HEAD_INIT(0, 0)
6110   __Pyx_NAMESTR("pocketsphinx.LatLinkIterator"), /*tp_name*/
6111   sizeof(struct __pyx_obj_12pocketsphinx_LatLinkIterator), /*tp_basicsize*/
6112   0, /*tp_itemsize*/
6113   __pyx_tp_dealloc_12pocketsphinx_LatLinkIterator, /*tp_dealloc*/
6114   0, /*tp_print*/
6115   0, /*tp_getattr*/
6116   0, /*tp_setattr*/
6117   #if PY_MAJOR_VERSION < 3
6118   0, /*tp_compare*/
6119   #else
6120   0, /*reserved*/
6121   #endif
6122   0, /*tp_repr*/
6123   &__pyx_tp_as_number_LatLinkIterator, /*tp_as_number*/
6124   &__pyx_tp_as_sequence_LatLinkIterator, /*tp_as_sequence*/
6125   &__pyx_tp_as_mapping_LatLinkIterator, /*tp_as_mapping*/
6126   0, /*tp_hash*/
6127   0, /*tp_call*/
6128   0, /*tp_str*/
6129   0, /*tp_getattro*/
6130   0, /*tp_setattro*/
6131   &__pyx_tp_as_buffer_LatLinkIterator, /*tp_as_buffer*/
6132   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
6133   __Pyx_DOCSTR("\n    Iterator over word lattice links.\n    "), /*tp_doc*/
6134   0, /*tp_traverse*/
6135   0, /*tp_clear*/
6136   0, /*tp_richcompare*/
6137   0, /*tp_weaklistoffset*/
6138   __pyx_pf_12pocketsphinx_15LatLinkIterator___iter__, /*tp_iter*/
6139   __pyx_pf_12pocketsphinx_15LatLinkIterator___next__, /*tp_iternext*/
6140   __pyx_methods_12pocketsphinx_LatLinkIterator, /*tp_methods*/
6141   0, /*tp_members*/
6142   0, /*tp_getset*/
6143   0, /*tp_base*/
6144   0, /*tp_dict*/
6145   0, /*tp_descr_get*/
6146   0, /*tp_descr_set*/
6147   0, /*tp_dictoffset*/
6148   0, /*tp_init*/
6149   0, /*tp_alloc*/
6150   __pyx_tp_new_12pocketsphinx_LatLinkIterator, /*tp_new*/
6151   0, /*tp_free*/
6152   0, /*tp_is_gc*/
6153   0, /*tp_bases*/
6154   0, /*tp_mro*/
6155   0, /*tp_cache*/
6156   0, /*tp_subclasses*/
6157   0, /*tp_weaklist*/
6158   0, /*tp_del*/
6159   #if PY_VERSION_HEX >= 0x02060000
6160   0, /*tp_version_tag*/
6161   #endif
6162 };
6163 static struct __pyx_vtabstruct_12pocketsphinx_LatNode __pyx_vtable_12pocketsphinx_LatNode;
6164
6165 static PyObject *__pyx_tp_new_12pocketsphinx_LatNode(PyTypeObject *t, PyObject *a, PyObject *k) {
6166   struct __pyx_obj_12pocketsphinx_LatNode *p;
6167   PyObject *o = (*t->tp_alloc)(t, 0);
6168   if (!o) return 0;
6169   p = ((struct __pyx_obj_12pocketsphinx_LatNode *)o);
6170   p->__pyx_vtab = __pyx_vtabptr_12pocketsphinx_LatNode;
6171   p->best_exit = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); Py_INCREF(Py_None);
6172   if (__pyx_pf_12pocketsphinx_7LatNode___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
6173     Py_DECREF(o); o = 0;
6174   }
6175   return o;
6176 }
6177
6178 static void __pyx_tp_dealloc_12pocketsphinx_LatNode(PyObject *o) {
6179   struct __pyx_obj_12pocketsphinx_LatNode *p = (struct __pyx_obj_12pocketsphinx_LatNode *)o;
6180   Py_XDECREF(((PyObject *)p->best_exit));
6181   (*Py_TYPE(o)->tp_free)(o);
6182 }
6183
6184 static int __pyx_tp_traverse_12pocketsphinx_LatNode(PyObject *o, visitproc v, void *a) {
6185   int e;
6186   struct __pyx_obj_12pocketsphinx_LatNode *p = (struct __pyx_obj_12pocketsphinx_LatNode *)o;
6187   if (p->best_exit) {
6188     e = (*v)(((PyObject*)p->best_exit), a); if (e) return e;
6189   }
6190   return 0;
6191 }
6192
6193 static int __pyx_tp_clear_12pocketsphinx_LatNode(PyObject *o) {
6194   struct __pyx_obj_12pocketsphinx_LatNode *p = (struct __pyx_obj_12pocketsphinx_LatNode *)o;
6195   PyObject* tmp;
6196   tmp = ((PyObject*)p->best_exit);
6197   p->best_exit = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); Py_INCREF(Py_None);
6198   Py_XDECREF(tmp);
6199   return 0;
6200 }
6201
6202 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_word(PyObject *o, void *x) {
6203   return __pyx_pf_12pocketsphinx_7LatNode_4word___get__(o);
6204 }
6205
6206 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_baseword(PyObject *o, void *x) {
6207   return __pyx_pf_12pocketsphinx_7LatNode_8baseword___get__(o);
6208 }
6209
6210 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_sf(PyObject *o, void *x) {
6211   return __pyx_pf_12pocketsphinx_7LatNode_2sf___get__(o);
6212 }
6213
6214 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_fef(PyObject *o, void *x) {
6215   return __pyx_pf_12pocketsphinx_7LatNode_3fef___get__(o);
6216 }
6217
6218 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_lef(PyObject *o, void *x) {
6219   return __pyx_pf_12pocketsphinx_7LatNode_3lef___get__(o);
6220 }
6221
6222 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_prob(PyObject *o, void *x) {
6223   return __pyx_pf_12pocketsphinx_7LatNode_4prob___get__(o);
6224 }
6225
6226 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_best_exit(PyObject *o, void *x) {
6227   return __pyx_pf_12pocketsphinx_7LatNode_9best_exit___get__(o);
6228 }
6229
6230 static PyMethodDef __pyx_methods_12pocketsphinx_LatNode[] = {
6231   {__Pyx_NAMESTR("exits"), (PyCFunction)__pyx_pf_12pocketsphinx_7LatNode_exits, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7LatNode_exits)},
6232   {__Pyx_NAMESTR("entries"), (PyCFunction)__pyx_pf_12pocketsphinx_7LatNode_entries, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7LatNode_entries)},
6233   {0, 0, 0, 0}
6234 };
6235
6236 static struct PyGetSetDef __pyx_getsets_12pocketsphinx_LatNode[] = {
6237   {(char *)"word", __pyx_getprop_12pocketsphinx_7LatNode_word, 0, 0, 0},
6238   {(char *)"baseword", __pyx_getprop_12pocketsphinx_7LatNode_baseword, 0, 0, 0},
6239   {(char *)"sf", __pyx_getprop_12pocketsphinx_7LatNode_sf, 0, 0, 0},
6240   {(char *)"fef", __pyx_getprop_12pocketsphinx_7LatNode_fef, 0, 0, 0},
6241   {(char *)"lef", __pyx_getprop_12pocketsphinx_7LatNode_lef, 0, 0, 0},
6242   {(char *)"prob", __pyx_getprop_12pocketsphinx_7LatNode_prob, 0, 0, 0},
6243   {(char *)"best_exit", __pyx_getprop_12pocketsphinx_7LatNode_best_exit, 0, 0, 0},
6244   {0, 0, 0, 0, 0}
6245 };
6246
6247 static PyNumberMethods __pyx_tp_as_number_LatNode = {
6248   0, /*nb_add*/
6249   0, /*nb_subtract*/
6250   0, /*nb_multiply*/
6251   #if PY_MAJOR_VERSION < 3
6252   0, /*nb_divide*/
6253   #endif
6254   0, /*nb_remainder*/
6255   0, /*nb_divmod*/
6256   0, /*nb_power*/
6257   0, /*nb_negative*/
6258   0, /*nb_positive*/
6259   0, /*nb_absolute*/
6260   0, /*nb_nonzero*/
6261   0, /*nb_invert*/
6262   0, /*nb_lshift*/
6263   0, /*nb_rshift*/
6264   0, /*nb_and*/
6265   0, /*nb_xor*/
6266   0, /*nb_or*/
6267   #if PY_MAJOR_VERSION < 3
6268   0, /*nb_coerce*/
6269   #endif
6270   0, /*nb_int*/
6271   #if PY_MAJOR_VERSION < 3
6272   0, /*nb_long*/
6273   #else
6274   0, /*reserved*/
6275   #endif
6276   0, /*nb_float*/
6277   #if PY_MAJOR_VERSION < 3
6278   0, /*nb_oct*/
6279   #endif
6280   #if PY_MAJOR_VERSION < 3
6281   0, /*nb_hex*/
6282   #endif
6283   0, /*nb_inplace_add*/
6284   0, /*nb_inplace_subtract*/
6285   0, /*nb_inplace_multiply*/
6286   #if PY_MAJOR_VERSION < 3
6287   0, /*nb_inplace_divide*/
6288   #endif
6289   0, /*nb_inplace_remainder*/
6290   0, /*nb_inplace_power*/
6291   0, /*nb_inplace_lshift*/
6292   0, /*nb_inplace_rshift*/
6293   0, /*nb_inplace_and*/
6294   0, /*nb_inplace_xor*/
6295   0, /*nb_inplace_or*/
6296   0, /*nb_floor_divide*/
6297   0, /*nb_true_divide*/
6298   0, /*nb_inplace_floor_divide*/
6299   0, /*nb_inplace_true_divide*/
6300   #if PY_VERSION_HEX >= 0x02050000
6301   0, /*nb_index*/
6302   #endif
6303 };
6304
6305 static PySequenceMethods __pyx_tp_as_sequence_LatNode = {
6306   0, /*sq_length*/
6307   0, /*sq_concat*/
6308   0, /*sq_repeat*/
6309   0, /*sq_item*/
6310   0, /*sq_slice*/
6311   0, /*sq_ass_item*/
6312   0, /*sq_ass_slice*/
6313   0, /*sq_contains*/
6314   0, /*sq_inplace_concat*/
6315   0, /*sq_inplace_repeat*/
6316 };
6317
6318 static PyMappingMethods __pyx_tp_as_mapping_LatNode = {
6319   0, /*mp_length*/
6320   0, /*mp_subscript*/
6321   0, /*mp_ass_subscript*/
6322 };
6323
6324 static PyBufferProcs __pyx_tp_as_buffer_LatNode = {
6325   #if PY_MAJOR_VERSION < 3
6326   0, /*bf_getreadbuffer*/
6327   #endif
6328   #if PY_MAJOR_VERSION < 3
6329   0, /*bf_getwritebuffer*/
6330   #endif
6331   #if PY_MAJOR_VERSION < 3
6332   0, /*bf_getsegcount*/
6333   #endif
6334   #if PY_MAJOR_VERSION < 3
6335   0, /*bf_getcharbuffer*/
6336   #endif
6337   #if PY_VERSION_HEX >= 0x02060000
6338   0, /*bf_getbuffer*/
6339   #endif
6340   #if PY_VERSION_HEX >= 0x02060000
6341   0, /*bf_releasebuffer*/
6342   #endif
6343 };
6344
6345 PyTypeObject __pyx_type_12pocketsphinx_LatNode = {
6346   PyVarObject_HEAD_INIT(0, 0)
6347   __Pyx_NAMESTR("pocketsphinx.LatNode"), /*tp_name*/
6348   sizeof(struct __pyx_obj_12pocketsphinx_LatNode), /*tp_basicsize*/
6349   0, /*tp_itemsize*/
6350   __pyx_tp_dealloc_12pocketsphinx_LatNode, /*tp_dealloc*/
6351   0, /*tp_print*/
6352   0, /*tp_getattr*/
6353   0, /*tp_setattr*/
6354   #if PY_MAJOR_VERSION < 3
6355   0, /*tp_compare*/
6356   #else
6357   0, /*reserved*/
6358   #endif
6359   0, /*tp_repr*/
6360   &__pyx_tp_as_number_LatNode, /*tp_as_number*/
6361   &__pyx_tp_as_sequence_LatNode, /*tp_as_sequence*/
6362   &__pyx_tp_as_mapping_LatNode, /*tp_as_mapping*/
6363   0, /*tp_hash*/
6364   0, /*tp_call*/
6365   0, /*tp_str*/
6366   0, /*tp_getattro*/
6367   0, /*tp_setattro*/
6368   &__pyx_tp_as_buffer_LatNode, /*tp_as_buffer*/
6369   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
6370   __Pyx_DOCSTR("\n    Node in a word lattice.\n\n    @ivar word: Word this node corresponds to (with pronunciation variant).\n    @type word: str\n    @ivar baseword: Base word (no pronunciation variant) this node corresponds to.\n    @type baseword: str\n    @ivar sf: Start frame for this node.\n    @type sf: int\n    @ivar fef: First ending frame for this node.\n    @type fef: int\n    @ivar lef: Last ending frame for this node.\n    @type lef: int\n    @ivar best_exit: Best scoring exit link from this node\n    @type best_exit: LatLink\n    @ivar prob: Posterior probability for this node.\n    @type prob: float\n    "), /*tp_doc*/
6371   __pyx_tp_traverse_12pocketsphinx_LatNode, /*tp_traverse*/
6372   __pyx_tp_clear_12pocketsphinx_LatNode, /*tp_clear*/
6373   0, /*tp_richcompare*/
6374   0, /*tp_weaklistoffset*/
6375   0, /*tp_iter*/
6376   0, /*tp_iternext*/
6377   __pyx_methods_12pocketsphinx_LatNode, /*tp_methods*/
6378   0, /*tp_members*/
6379   __pyx_getsets_12pocketsphinx_LatNode, /*tp_getset*/
6380   0, /*tp_base*/
6381   0, /*tp_dict*/
6382   0, /*tp_descr_get*/
6383   0, /*tp_descr_set*/
6384   0, /*tp_dictoffset*/
6385   0, /*tp_init*/
6386   0, /*tp_alloc*/
6387   __pyx_tp_new_12pocketsphinx_LatNode, /*tp_new*/
6388   0, /*tp_free*/
6389   0, /*tp_is_gc*/
6390   0, /*tp_bases*/
6391   0, /*tp_mro*/
6392   0, /*tp_cache*/
6393   0, /*tp_subclasses*/
6394   0, /*tp_weaklist*/
6395   0, /*tp_del*/
6396   #if PY_VERSION_HEX >= 0x02060000
6397   0, /*tp_version_tag*/
6398   #endif
6399 };
6400
6401 static PyObject *__pyx_tp_new_12pocketsphinx_LatNodeIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
6402   PyObject *o = (*t->tp_alloc)(t, 0);
6403   if (!o) return 0;
6404   return o;
6405 }
6406
6407 static void __pyx_tp_dealloc_12pocketsphinx_LatNodeIterator(PyObject *o) {
6408   (*Py_TYPE(o)->tp_free)(o);
6409 }
6410
6411 static PyMethodDef __pyx_methods_12pocketsphinx_LatNodeIterator[] = {
6412   {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_12pocketsphinx_15LatNodeIterator___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_15LatNodeIterator___next__)},
6413   {0, 0, 0, 0}
6414 };
6415
6416 static PyNumberMethods __pyx_tp_as_number_LatNodeIterator = {
6417   0, /*nb_add*/
6418   0, /*nb_subtract*/
6419   0, /*nb_multiply*/
6420   #if PY_MAJOR_VERSION < 3
6421   0, /*nb_divide*/
6422   #endif
6423   0, /*nb_remainder*/
6424   0, /*nb_divmod*/
6425   0, /*nb_power*/
6426   0, /*nb_negative*/
6427   0, /*nb_positive*/
6428   0, /*nb_absolute*/
6429   0, /*nb_nonzero*/
6430   0, /*nb_invert*/
6431   0, /*nb_lshift*/
6432   0, /*nb_rshift*/
6433   0, /*nb_and*/
6434   0, /*nb_xor*/
6435   0, /*nb_or*/
6436   #if PY_MAJOR_VERSION < 3
6437   0, /*nb_coerce*/
6438   #endif
6439   0, /*nb_int*/
6440   #if PY_MAJOR_VERSION < 3
6441   0, /*nb_long*/
6442   #else
6443   0, /*reserved*/
6444   #endif
6445   0, /*nb_float*/
6446   #if PY_MAJOR_VERSION < 3
6447   0, /*nb_oct*/
6448   #endif
6449   #if PY_MAJOR_VERSION < 3
6450   0, /*nb_hex*/
6451   #endif
6452   0, /*nb_inplace_add*/
6453   0, /*nb_inplace_subtract*/
6454   0, /*nb_inplace_multiply*/
6455   #if PY_MAJOR_VERSION < 3
6456   0, /*nb_inplace_divide*/
6457   #endif
6458   0, /*nb_inplace_remainder*/
6459   0, /*nb_inplace_power*/
6460   0, /*nb_inplace_lshift*/
6461   0, /*nb_inplace_rshift*/
6462   0, /*nb_inplace_and*/
6463   0, /*nb_inplace_xor*/
6464   0, /*nb_inplace_or*/
6465   0, /*nb_floor_divide*/
6466   0, /*nb_true_divide*/
6467   0, /*nb_inplace_floor_divide*/
6468   0, /*nb_inplace_true_divide*/
6469   #if PY_VERSION_HEX >= 0x02050000
6470   0, /*nb_index*/
6471   #endif
6472 };
6473
6474 static PySequenceMethods __pyx_tp_as_sequence_LatNodeIterator = {
6475   0, /*sq_length*/
6476   0, /*sq_concat*/
6477   0, /*sq_repeat*/
6478   0, /*sq_item*/
6479   0, /*sq_slice*/
6480   0, /*sq_ass_item*/
6481   0, /*sq_ass_slice*/
6482   0, /*sq_contains*/
6483   0, /*sq_inplace_concat*/
6484   0, /*sq_inplace_repeat*/
6485 };
6486
6487 static PyMappingMethods __pyx_tp_as_mapping_LatNodeIterator = {
6488   0, /*mp_length*/
6489   0, /*mp_subscript*/
6490   0, /*mp_ass_subscript*/
6491 };
6492
6493 static PyBufferProcs __pyx_tp_as_buffer_LatNodeIterator = {
6494   #if PY_MAJOR_VERSION < 3
6495   0, /*bf_getreadbuffer*/
6496   #endif
6497   #if PY_MAJOR_VERSION < 3
6498   0, /*bf_getwritebuffer*/
6499   #endif
6500   #if PY_MAJOR_VERSION < 3
6501   0, /*bf_getsegcount*/
6502   #endif
6503   #if PY_MAJOR_VERSION < 3
6504   0, /*bf_getcharbuffer*/
6505   #endif
6506   #if PY_VERSION_HEX >= 0x02060000
6507   0, /*bf_getbuffer*/
6508   #endif
6509   #if PY_VERSION_HEX >= 0x02060000
6510   0, /*bf_releasebuffer*/
6511   #endif
6512 };
6513
6514 PyTypeObject __pyx_type_12pocketsphinx_LatNodeIterator = {
6515   PyVarObject_HEAD_INIT(0, 0)
6516   __Pyx_NAMESTR("pocketsphinx.LatNodeIterator"), /*tp_name*/
6517   sizeof(struct __pyx_obj_12pocketsphinx_LatNodeIterator), /*tp_basicsize*/
6518   0, /*tp_itemsize*/
6519   __pyx_tp_dealloc_12pocketsphinx_LatNodeIterator, /*tp_dealloc*/
6520   0, /*tp_print*/
6521   0, /*tp_getattr*/
6522   0, /*tp_setattr*/
6523   #if PY_MAJOR_VERSION < 3
6524   0, /*tp_compare*/
6525   #else
6526   0, /*reserved*/
6527   #endif
6528   0, /*tp_repr*/
6529   &__pyx_tp_as_number_LatNodeIterator, /*tp_as_number*/
6530   &__pyx_tp_as_sequence_LatNodeIterator, /*tp_as_sequence*/
6531   &__pyx_tp_as_mapping_LatNodeIterator, /*tp_as_mapping*/
6532   0, /*tp_hash*/
6533   0, /*tp_call*/
6534   0, /*tp_str*/
6535   0, /*tp_getattro*/
6536   0, /*tp_setattro*/
6537   &__pyx_tp_as_buffer_LatNodeIterator, /*tp_as_buffer*/
6538   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
6539   __Pyx_DOCSTR("\n    Iterator over word lattice nodes.\n    "), /*tp_doc*/
6540   0, /*tp_traverse*/
6541   0, /*tp_clear*/
6542   0, /*tp_richcompare*/
6543   0, /*tp_weaklistoffset*/
6544   __pyx_pf_12pocketsphinx_15LatNodeIterator___iter__, /*tp_iter*/
6545   __pyx_pf_12pocketsphinx_15LatNodeIterator___next__, /*tp_iternext*/
6546   __pyx_methods_12pocketsphinx_LatNodeIterator, /*tp_methods*/
6547   0, /*tp_members*/
6548   0, /*tp_getset*/
6549   0, /*tp_base*/
6550   0, /*tp_dict*/
6551   0, /*tp_descr_get*/
6552   0, /*tp_descr_set*/
6553   0, /*tp_dictoffset*/
6554   __pyx_pf_12pocketsphinx_15LatNodeIterator___init__, /*tp_init*/
6555   0, /*tp_alloc*/
6556   __pyx_tp_new_12pocketsphinx_LatNodeIterator, /*tp_new*/
6557   0, /*tp_free*/
6558   0, /*tp_is_gc*/
6559   0, /*tp_bases*/
6560   0, /*tp_mro*/
6561   0, /*tp_cache*/
6562   0, /*tp_subclasses*/
6563   0, /*tp_weaklist*/
6564   0, /*tp_del*/
6565   #if PY_VERSION_HEX >= 0x02060000
6566   0, /*tp_version_tag*/
6567   #endif
6568 };
6569
6570 static PyMethodDef __pyx_methods[] = {
6571   {0, 0, 0, 0}
6572 };
6573
6574 #if PY_MAJOR_VERSION >= 3
6575 static struct PyModuleDef __pyx_moduledef = {
6576     PyModuleDef_HEAD_INIT,
6577     __Pyx_NAMESTR("pocketsphinx"),
6578     0, /* m_doc */
6579     -1, /* m_size */
6580     __pyx_methods /* m_methods */,
6581     NULL, /* m_reload */
6582     NULL, /* m_traverse */
6583     NULL, /* m_clear */
6584     NULL /* m_free */
6585 };
6586 #endif
6587
6588 static __Pyx_StringTabEntry __pyx_string_tab[] = {
6589   {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
6590   {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
6591   {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
6592   {&__pyx_kp_u_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 1, 0, 0},
6593   {&__pyx_kp_u_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 1, 0, 0},
6594   {&__pyx_kp_u_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 1, 0, 0},
6595   {&__pyx_kp_u_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 1, 0, 0},
6596   {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
6597   {&__pyx_kp_u_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 1, 0, 0},
6598   {&__pyx_kp_u_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 1, 0, 0},
6599   {&__pyx_kp_u_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 1, 0, 0},
6600   {&__pyx_kp_u_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 1, 0, 0},
6601   {&__pyx_kp_u_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 1, 0, 0},
6602   {&__pyx_kp_u_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 1, 0, 0},
6603   {&__pyx_kp_u_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 1, 0, 0},
6604   {&__pyx_kp_u_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 1, 0, 0},
6605   {&__pyx_kp_u_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 1, 0, 0},
6606   {&__pyx_kp_u_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 1, 0, 0},
6607   {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
6608   {&__pyx_kp_u_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 1, 0, 0},
6609   {&__pyx_kp_u_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 1, 0, 0},
6610   {&__pyx_kp_u_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 1, 0, 0},
6611   {&__pyx_kp_u_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 1, 0, 0},
6612   {&__pyx_kp_u_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 1, 0, 0},
6613   {&__pyx_kp_u_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 1, 0, 0},
6614   {&__pyx_kp_u_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 1, 0, 0},
6615   {&__pyx_kp_u_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 1, 0, 0},
6616   {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
6617   {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
6618   {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
6619   {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
6620   {&__pyx_n_s__Decoder, __pyx_k__Decoder, sizeof(__pyx_k__Decoder), 0, 0, 1, 1},
6621   {&__pyx_n_s__LatLink, __pyx_k__LatLink, sizeof(__pyx_k__LatLink), 0, 0, 1, 1},
6622   {&__pyx_n_s__LatLinkIterator, __pyx_k__LatLinkIterator, sizeof(__pyx_k__LatLinkIterator), 0, 0, 1, 1},
6623   {&__pyx_n_s__LatNode, __pyx_k__LatNode, sizeof(__pyx_k__LatNode), 0, 0, 1, 1},
6624   {&__pyx_n_s__LatNodeIterator, __pyx_k__LatNodeIterator, sizeof(__pyx_k__LatNodeIterator), 0, 0, 1, 1},
6625   {&__pyx_n_s__Lattice, __pyx_k__Lattice, sizeof(__pyx_k__Lattice), 0, 0, 1, 1},
6626   {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
6627   {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
6628   {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
6629   {&__pyx_n_s____next__, __pyx_k____next__, sizeof(__pyx_k____next__), 0, 0, 1, 1},
6630   {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
6631   {&__pyx_n_s__add_word, __pyx_k__add_word, sizeof(__pyx_k__add_word), 0, 0, 1, 1},
6632   {&__pyx_n_s__argc, __pyx_k__argc, sizeof(__pyx_k__argc), 0, 0, 1, 1},
6633   {&__pyx_n_s__argv, __pyx_k__argv, sizeof(__pyx_k__argv), 0, 0, 1, 1},
6634   {&__pyx_n_s__ascale, __pyx_k__ascale, sizeof(__pyx_k__ascale), 0, 0, 1, 1},
6635   {&__pyx_n_s__baseword, __pyx_k__baseword, sizeof(__pyx_k__baseword), 0, 0, 1, 1},
6636   {&__pyx_n_s__best_exit, __pyx_k__best_exit, sizeof(__pyx_k__best_exit), 0, 0, 1, 1},
6637   {&__pyx_n_s__bestpath, __pyx_k__bestpath, sizeof(__pyx_k__bestpath), 0, 0, 1, 1},
6638   {&__pyx_n_s__boxed, __pyx_k__boxed, sizeof(__pyx_k__boxed), 0, 0, 1, 1},
6639   {&__pyx_n_s__dag, __pyx_k__dag, sizeof(__pyx_k__dag), 0, 0, 1, 1},
6640   {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
6641   {&__pyx_n_s__decode_raw, __pyx_k__decode_raw, sizeof(__pyx_k__decode_raw), 0, 0, 1, 1},
6642   {&__pyx_n_s__decode_senscr, __pyx_k__decode_senscr, sizeof(__pyx_k__decode_senscr), 0, 0, 1, 1},
6643   {&__pyx_n_s__dictfile, __pyx_k__dictfile, sizeof(__pyx_k__dictfile), 0, 0, 1, 1},
6644   {&__pyx_n_s__ef, __pyx_k__ef, sizeof(__pyx_k__ef), 0, 0, 1, 1},
6645   {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
6646   {&__pyx_n_s__entries, __pyx_k__entries, sizeof(__pyx_k__entries), 0, 0, 1, 1},
6647   {&__pyx_n_s__exits, __pyx_k__exits, sizeof(__pyx_k__exits), 0, 0, 1, 1},
6648   {&__pyx_n_s__fdictfile, __pyx_k__fdictfile, sizeof(__pyx_k__fdictfile), 0, 0, 1, 1},
6649   {&__pyx_n_s__fef, __pyx_k__fef, sizeof(__pyx_k__fef), 0, 0, 1, 1},
6650   {&__pyx_n_s__fh, __pyx_k__fh, sizeof(__pyx_k__fh), 0, 0, 1, 1},
6651   {&__pyx_n_s__first_link, __pyx_k__first_link, sizeof(__pyx_k__first_link), 0, 0, 1, 1},
6652   {&__pyx_n_s__first_node, __pyx_k__first_node, sizeof(__pyx_k__first_node), 0, 0, 1, 1},
6653   {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
6654   {&__pyx_n_s__full_utt, __pyx_k__full_utt, sizeof(__pyx_k__full_utt), 0, 0, 1, 1},
6655   {&__pyx_n_s__get_hyp, __pyx_k__get_hyp, sizeof(__pyx_k__get_hyp), 0, 0, 1, 1},
6656   {&__pyx_n_s__get_lattice, __pyx_k__get_lattice, sizeof(__pyx_k__get_lattice), 0, 0, 1, 1},
6657   {&__pyx_n_s__get_lmset, __pyx_k__get_lmset, sizeof(__pyx_k__get_lmset), 0, 0, 1, 1},
6658   {&__pyx_n_s__get_prob, __pyx_k__get_prob, sizeof(__pyx_k__get_prob), 0, 0, 1, 1},
6659   {&__pyx_n_s__itor, __pyx_k__itor, sizeof(__pyx_k__itor), 0, 0, 1, 1},
6660   {&__pyx_n_s__latfile, __pyx_k__latfile, sizeof(__pyx_k__latfile), 0, 0, 1, 1},
6661   {&__pyx_n_s__lef, __pyx_k__lef, sizeof(__pyx_k__lef), 0, 0, 1, 1},
6662   {&__pyx_n_s__link, __pyx_k__link, sizeof(__pyx_k__link), 0, 0, 1, 1},
6663   {&__pyx_n_s__lm, __pyx_k__lm, sizeof(__pyx_k__lm), 0, 0, 1, 1},
6664   {&__pyx_n_s__lmset, __pyx_k__lmset, sizeof(__pyx_k__lmset), 0, 0, 1, 1},
6665   {&__pyx_n_s__load_dict, __pyx_k__load_dict, sizeof(__pyx_k__load_dict), 0, 0, 1, 1},
6666   {&__pyx_n_s__log_bowt, __pyx_k__log_bowt, sizeof(__pyx_k__log_bowt), 0, 0, 1, 1},
6667   {&__pyx_n_s__log_prob, __pyx_k__log_prob, sizeof(__pyx_k__log_prob), 0, 0, 1, 1},
6668   {&__pyx_n_s__lw, __pyx_k__lw, sizeof(__pyx_k__lw), 0, 0, 1, 1},
6669   {&__pyx_n_s__lwf, __pyx_k__lwf, sizeof(__pyx_k__lwf), 0, 0, 1, 1},
6670   {&__pyx_n_s__maxsamps, __pyx_k__maxsamps, sizeof(__pyx_k__maxsamps), 0, 0, 1, 1},
6671   {&__pyx_n_s__n_frames, __pyx_k__n_frames, sizeof(__pyx_k__n_frames), 0, 0, 1, 1},
6672   {&__pyx_n_s__no_search, __pyx_k__no_search, sizeof(__pyx_k__no_search), 0, 0, 1, 1},
6673   {&__pyx_n_s__node, __pyx_k__node, sizeof(__pyx_k__node), 0, 0, 1, 1},
6674   {&__pyx_n_s__nodes, __pyx_k__nodes, sizeof(__pyx_k__nodes), 0, 0, 1, 1},
6675   {&__pyx_n_s__phones, __pyx_k__phones, sizeof(__pyx_k__phones), 0, 0, 1, 1},
6676   {&__pyx_n_s__posterior, __pyx_k__posterior, sizeof(__pyx_k__posterior), 0, 0, 1, 1},
6677   {&__pyx_n_s__pred, __pyx_k__pred, sizeof(__pyx_k__pred), 0, 0, 1, 1},
6678   {&__pyx_n_s__prob, __pyx_k__prob, sizeof(__pyx_k__prob), 0, 0, 1, 1},
6679   {&__pyx_n_s__process_raw, __pyx_k__process_raw, sizeof(__pyx_k__process_raw), 0, 0, 1, 1},
6680   {&__pyx_n_s__ps, __pyx_k__ps, sizeof(__pyx_k__ps), 0, 0, 1, 1},
6681   {&__pyx_n_s__ps_end_utt, __pyx_k__ps_end_utt, sizeof(__pyx_k__ps_end_utt), 0, 0, 1, 1},
6682   {&__pyx_n_s__read_dag, __pyx_k__read_dag, sizeof(__pyx_k__read_dag), 0, 0, 1, 1},
6683   {&__pyx_n_s__save_dict, __pyx_k__save_dict, sizeof(__pyx_k__save_dict), 0, 0, 1, 1},
6684   {&__pyx_n_s__set_boxed, __pyx_k__set_boxed, sizeof(__pyx_k__set_boxed), 0, 0, 1, 1},
6685   {&__pyx_n_s__set_dag, __pyx_k__set_dag, sizeof(__pyx_k__set_dag), 0, 0, 1, 1},
6686   {&__pyx_n_s__set_link, __pyx_k__set_link, sizeof(__pyx_k__set_link), 0, 0, 1, 1},
6687   {&__pyx_n_s__set_lm, __pyx_k__set_lm, sizeof(__pyx_k__set_lm), 0, 0, 1, 1},
6688   {&__pyx_n_s__set_lmath, __pyx_k__set_lmath, sizeof(__pyx_k__set_lmath), 0, 0, 1, 1},
6689   {&__pyx_n_s__set_node, __pyx_k__set_node, sizeof(__pyx_k__set_node), 0, 0, 1, 1},
6690   {&__pyx_n_s__sf, __pyx_k__sf, sizeof(__pyx_k__sf), 0, 0, 1, 1},
6691   {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
6692   {&__pyx_n_s__start_utt, __pyx_k__start_utt, sizeof(__pyx_k__start_utt), 0, 0, 1, 1},
6693   {&__pyx_n_s__update, __pyx_k__update, sizeof(__pyx_k__update), 0, 0, 1, 1},
6694   {&__pyx_n_s__uttid, __pyx_k__uttid, sizeof(__pyx_k__uttid), 0, 0, 1, 1},
6695   {&__pyx_n_s__uw, __pyx_k__uw, sizeof(__pyx_k__uw), 0, 0, 1, 1},
6696   {&__pyx_n_s__wip, __pyx_k__wip, sizeof(__pyx_k__wip), 0, 0, 1, 1},
6697   {&__pyx_n_s__word, __pyx_k__word, sizeof(__pyx_k__word), 0, 0, 1, 1},
6698   {&__pyx_n_s__words, __pyx_k__words, sizeof(__pyx_k__words), 0, 0, 1, 1},
6699   {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1},
6700   {0, 0, 0, 0, 0, 0, 0}
6701 };
6702 static int __Pyx_InitCachedBuiltins(void) {
6703   __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6704   __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6705   return 0;
6706   __pyx_L1_error:;
6707   return -1;
6708 }
6709
6710 static int __Pyx_InitGlobals(void) {
6711   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
6712   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
6713   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
6714   return 0;
6715   __pyx_L1_error:;
6716   return -1;
6717 }
6718
6719 #if PY_MAJOR_VERSION < 3
6720 PyMODINIT_FUNC initpocketsphinx(void); /*proto*/
6721 PyMODINIT_FUNC initpocketsphinx(void)
6722 #else
6723 PyMODINIT_FUNC PyInit_pocketsphinx(void); /*proto*/
6724 PyMODINIT_FUNC PyInit_pocketsphinx(void)
6725 #endif
6726 {
6727   PyObject *__pyx_t_1 = NULL;
6728   PyObject *__pyx_t_2 = NULL;
6729   PyObject *__pyx_t_3 = NULL;
6730   #if CYTHON_REFNANNY
6731   void* __pyx_refnanny = NULL;
6732   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
6733   if (!__Pyx_RefNanny) {
6734       PyErr_Clear();
6735       __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
6736       if (!__Pyx_RefNanny)
6737           Py_FatalError("failed to import 'refnanny' module");
6738   }
6739   __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_pocketsphinx(void)", __LINE__, __FILE__);
6740   #endif
6741   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6742   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6743   #ifdef __pyx_binding_PyCFunctionType_USED
6744   if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6745   #endif
6746   /*--- Library function declarations ---*/
6747   /*--- Threads initialization code ---*/
6748   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
6749   #ifdef WITH_THREAD /* Python build with threading support? */
6750   PyEval_InitThreads();
6751   #endif
6752   #endif
6753   /*--- Module creation code ---*/
6754   #if PY_MAJOR_VERSION < 3
6755   __pyx_m = Py_InitModule4(__Pyx_NAMESTR("pocketsphinx"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
6756   #else
6757   __pyx_m = PyModule_Create(&__pyx_moduledef);
6758   #endif
6759   if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
6760   #if PY_MAJOR_VERSION < 3
6761   Py_INCREF(__pyx_m);
6762   #endif
6763   __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
6764   if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
6765   if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
6766   /*--- Initialize various global constants etc. ---*/
6767   if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6768   if (__pyx_module_is_main_pocketsphinx) {
6769     if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
6770   }
6771   /*--- Builtin init code ---*/
6772   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6773   /*--- Global init code ---*/
6774   /*--- Function export code ---*/
6775   /*--- Type init code ---*/
6776   __pyx_vtabptr_12pocketsphinx_Decoder = &__pyx_vtable_12pocketsphinx_Decoder;
6777   #if PY_MAJOR_VERSION >= 3
6778   __pyx_vtable_12pocketsphinx_Decoder.set_boxed = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_Decoder *, PyObject *))__pyx_f_12pocketsphinx_7Decoder_set_boxed;
6779   #else
6780   *(void(**)(void))&__pyx_vtable_12pocketsphinx_Decoder.set_boxed = (void(*)(void))__pyx_f_12pocketsphinx_7Decoder_set_boxed;
6781   #endif
6782   if (PyType_Ready(&__pyx_type_12pocketsphinx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6783   if (__Pyx_SetVtable(__pyx_type_12pocketsphinx_Decoder.tp_dict, __pyx_vtabptr_12pocketsphinx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6784   if (__Pyx_SetAttrString(__pyx_m, "Decoder", (PyObject *)&__pyx_type_12pocketsphinx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6785   __pyx_ptype_12pocketsphinx_Decoder = &__pyx_type_12pocketsphinx_Decoder;
6786   __pyx_vtabptr_12pocketsphinx_Lattice = &__pyx_vtable_12pocketsphinx_Lattice;
6787   #if PY_MAJOR_VERSION >= 3
6788   __pyx_vtable_12pocketsphinx_Lattice.read_dag = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_Lattice *, struct __pyx_obj_12pocketsphinx_Decoder *, PyObject *))__pyx_f_12pocketsphinx_7Lattice_read_dag;
6789   __pyx_vtable_12pocketsphinx_Lattice.set_dag = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_Lattice *, ps_lattice_t *))__pyx_f_12pocketsphinx_7Lattice_set_dag;
6790   __pyx_vtable_12pocketsphinx_Lattice.set_boxed = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_Lattice *, PyObject *))__pyx_f_12pocketsphinx_7Lattice_set_boxed;
6791   #else
6792   *(void(**)(void))&__pyx_vtable_12pocketsphinx_Lattice.read_dag = (void(*)(void))__pyx_f_12pocketsphinx_7Lattice_read_dag;
6793   *(void(**)(void))&__pyx_vtable_12pocketsphinx_Lattice.set_dag = (void(*)(void))__pyx_f_12pocketsphinx_7Lattice_set_dag;
6794   *(void(**)(void))&__pyx_vtable_12pocketsphinx_Lattice.set_boxed = (void(*)(void))__pyx_f_12pocketsphinx_7Lattice_set_boxed;
6795   #endif
6796   if (PyType_Ready(&__pyx_type_12pocketsphinx_Lattice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6797   if (__Pyx_SetVtable(__pyx_type_12pocketsphinx_Lattice.tp_dict, __pyx_vtabptr_12pocketsphinx_Lattice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6798   if (__Pyx_SetAttrString(__pyx_m, "Lattice", (PyObject *)&__pyx_type_12pocketsphinx_Lattice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6799   __pyx_ptype_12pocketsphinx_Lattice = &__pyx_type_12pocketsphinx_Lattice;
6800   __pyx_vtabptr_12pocketsphinx_LatLink = &__pyx_vtable_12pocketsphinx_LatLink;
6801   #if PY_MAJOR_VERSION >= 3
6802   __pyx_vtable_12pocketsphinx_LatLink.set_link = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_LatLink *, ps_lattice_t *, ps_latlink_t *))__pyx_f_12pocketsphinx_7LatLink_set_link;
6803   #else
6804   *(void(**)(void))&__pyx_vtable_12pocketsphinx_LatLink.set_link = (void(*)(void))__pyx_f_12pocketsphinx_7LatLink_set_link;
6805   #endif
6806   if (PyType_Ready(&__pyx_type_12pocketsphinx_LatLink) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6807   if (__Pyx_SetVtable(__pyx_type_12pocketsphinx_LatLink.tp_dict, __pyx_vtabptr_12pocketsphinx_LatLink) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6808   if (__Pyx_SetAttrString(__pyx_m, "LatLink", (PyObject *)&__pyx_type_12pocketsphinx_LatLink) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6809   __pyx_ptype_12pocketsphinx_LatLink = &__pyx_type_12pocketsphinx_LatLink;
6810   if (PyType_Ready(&__pyx_type_12pocketsphinx_LatLinkIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6811   {
6812     PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_12pocketsphinx_LatLinkIterator, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6813     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
6814       __pyx_wrapperbase_12pocketsphinx_15LatLinkIterator___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
6815       __pyx_wrapperbase_12pocketsphinx_15LatLinkIterator___next__.doc = __pyx_doc_12pocketsphinx_15LatLinkIterator___next__;
6816       ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_12pocketsphinx_15LatLinkIterator___next__;
6817     }
6818   }
6819   if (__Pyx_SetAttrString(__pyx_m, "LatLinkIterator", (PyObject *)&__pyx_type_12pocketsphinx_LatLinkIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6820   __pyx_ptype_12pocketsphinx_LatLinkIterator = &__pyx_type_12pocketsphinx_LatLinkIterator;
6821   __pyx_vtabptr_12pocketsphinx_LatNode = &__pyx_vtable_12pocketsphinx_LatNode;
6822   #if PY_MAJOR_VERSION >= 3
6823   __pyx_vtable_12pocketsphinx_LatNode.set_node = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_LatNode *, ps_lattice_t *, ps_latnode_t *))__pyx_f_12pocketsphinx_7LatNode_set_node;
6824   #else
6825   *(void(**)(void))&__pyx_vtable_12pocketsphinx_LatNode.set_node = (void(*)(void))__pyx_f_12pocketsphinx_7LatNode_set_node;
6826   #endif
6827   if (PyType_Ready(&__pyx_type_12pocketsphinx_LatNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6828   if (__Pyx_SetVtable(__pyx_type_12pocketsphinx_LatNode.tp_dict, __pyx_vtabptr_12pocketsphinx_LatNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6829   if (__Pyx_SetAttrString(__pyx_m, "LatNode", (PyObject *)&__pyx_type_12pocketsphinx_LatNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6830   __pyx_ptype_12pocketsphinx_LatNode = &__pyx_type_12pocketsphinx_LatNode;
6831   if (PyType_Ready(&__pyx_type_12pocketsphinx_LatNodeIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6832   {
6833     PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_12pocketsphinx_LatNodeIterator, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6834     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
6835       __pyx_wrapperbase_12pocketsphinx_15LatNodeIterator___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
6836       __pyx_wrapperbase_12pocketsphinx_15LatNodeIterator___next__.doc = __pyx_doc_12pocketsphinx_15LatNodeIterator___next__;
6837       ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_12pocketsphinx_15LatNodeIterator___next__;
6838     }
6839   }
6840   if (__Pyx_SetAttrString(__pyx_m, "LatNodeIterator", (PyObject *)&__pyx_type_12pocketsphinx_LatNodeIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6841   __pyx_ptype_12pocketsphinx_LatNodeIterator = &__pyx_type_12pocketsphinx_LatNodeIterator;
6842   /*--- Type import code ---*/
6843   __pyx_ptype_10sphinxbase_NGramModel = __Pyx_ImportType("sphinxbase", "NGramModel", sizeof(struct __pyx_obj_10sphinxbase_NGramModel), 1); if (unlikely(!__pyx_ptype_10sphinxbase_NGramModel)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6844   if (__Pyx_GetVtable(__pyx_ptype_10sphinxbase_NGramModel->tp_dict, &__pyx_vtabptr_10sphinxbase_NGramModel) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6845   __pyx_ptype_10sphinxbase_LogMath = __Pyx_ImportType("sphinxbase", "LogMath", sizeof(struct __pyx_obj_10sphinxbase_LogMath), 1); if (unlikely(!__pyx_ptype_10sphinxbase_LogMath)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6846   __pyx_ptype_10sphinxbase_NGramIter = __Pyx_ImportType("sphinxbase", "NGramIter", sizeof(struct __pyx_obj_10sphinxbase_NGramIter), 1); if (unlikely(!__pyx_ptype_10sphinxbase_NGramIter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6847   if (__Pyx_GetVtable(__pyx_ptype_10sphinxbase_NGramIter->tp_dict, &__pyx_vtabptr_10sphinxbase_NGramIter) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6848   __pyx_ptype_10sphinxbase_HuffCode = __Pyx_ImportType("sphinxbase", "HuffCode", sizeof(struct __pyx_obj_10sphinxbase_HuffCode), 1); if (unlikely(!__pyx_ptype_10sphinxbase_HuffCode)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6849   /*--- Function import code ---*/
6850   /*--- Execution code ---*/
6851
6852   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":499
6853  *             raise RuntimeError, "Failed to start utterance processing"
6854  * 
6855  *     def process_raw(self, data, no_search=False, full_utt=False):             # <<<<<<<<<<<<<<
6856  *         """
6857  *         Process (decode) some audio data.
6858  */
6859   __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6860   __Pyx_GOTREF(__pyx_t_1);
6861   __pyx_k_7 = __pyx_t_1;
6862   __Pyx_GIVEREF(__pyx_t_1);
6863   __pyx_t_1 = 0;
6864   __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6865   __Pyx_GOTREF(__pyx_t_1);
6866   __pyx_k_8 = __pyx_t_1;
6867   __Pyx_GIVEREF(__pyx_t_1);
6868   __pyx_t_1 = 0;
6869
6870   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":616
6871  *         return lm
6872  * 
6873  *     def add_word(self, word, phones, update=True):             # <<<<<<<<<<<<<<
6874  *         """
6875  *         Add a word to the dictionary and current language model.
6876  */
6877   __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6878   __Pyx_GOTREF(__pyx_t_1);
6879   __pyx_k_15 = __pyx_t_1;
6880   __Pyx_GIVEREF(__pyx_t_1);
6881   __pyx_t_1 = 0;
6882
6883   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":1
6884  * # Copyright (c) 2008 Carnegie Mellon University. All rights             # <<<<<<<<<<<<<<
6885  * # reserved.
6886  * #
6887  */
6888   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6889   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6890   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__LatNode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6891   __Pyx_GOTREF(__pyx_t_2);
6892   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__exits); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6893   __Pyx_GOTREF(__pyx_t_3);
6894   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6895   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6896   __Pyx_GOTREF(__pyx_t_2);
6897   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6898   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_16), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6899   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6900   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__LatNode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6901   __Pyx_GOTREF(__pyx_t_2);
6902   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__entries); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6903   __Pyx_GOTREF(__pyx_t_3);
6904   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6905   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6906   __Pyx_GOTREF(__pyx_t_2);
6907   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6908   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_17), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6909   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6910   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__LatNodeIterator); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6911   __Pyx_GOTREF(__pyx_t_2);
6912   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____next__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6913   __Pyx_GOTREF(__pyx_t_3);
6914   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6915   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6916   __Pyx_GOTREF(__pyx_t_2);
6917   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6918   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_18), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6919   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6920   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__LatLink); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6921   __Pyx_GOTREF(__pyx_t_2);
6922   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__nodes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6923   __Pyx_GOTREF(__pyx_t_3);
6924   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6925   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6926   __Pyx_GOTREF(__pyx_t_2);
6927   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6928   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_19), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6929   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6930   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__LatLink); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6931   __Pyx_GOTREF(__pyx_t_2);
6932   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__pred); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6933   __Pyx_GOTREF(__pyx_t_3);
6934   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6935   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6936   __Pyx_GOTREF(__pyx_t_2);
6937   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6938   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_20), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6939   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6940   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__LatLinkIterator); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6941   __Pyx_GOTREF(__pyx_t_2);
6942   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____next__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6943   __Pyx_GOTREF(__pyx_t_3);
6944   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6945   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6946   __Pyx_GOTREF(__pyx_t_2);
6947   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6948   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_21), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6949   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6950   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Lattice); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6951   __Pyx_GOTREF(__pyx_t_2);
6952   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__bestpath); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6953   __Pyx_GOTREF(__pyx_t_3);
6954   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6955   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6956   __Pyx_GOTREF(__pyx_t_2);
6957   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6958   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_22), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6959   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6960   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Lattice); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6961   __Pyx_GOTREF(__pyx_t_2);
6962   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__posterior); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6963   __Pyx_GOTREF(__pyx_t_3);
6964   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6965   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6966   __Pyx_GOTREF(__pyx_t_2);
6967   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6968   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_23), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6969   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6970   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Lattice); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6971   __Pyx_GOTREF(__pyx_t_2);
6972   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__nodes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6973   __Pyx_GOTREF(__pyx_t_3);
6974   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6975   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6976   __Pyx_GOTREF(__pyx_t_2);
6977   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6978   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_24), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6979   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6980   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Lattice); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6981   __Pyx_GOTREF(__pyx_t_2);
6982   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6983   __Pyx_GOTREF(__pyx_t_3);
6984   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6985   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6986   __Pyx_GOTREF(__pyx_t_2);
6987   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6988   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_25), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6989   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6990   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6991   __Pyx_GOTREF(__pyx_t_2);
6992   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__decode_raw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6993   __Pyx_GOTREF(__pyx_t_3);
6994   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6995   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6996   __Pyx_GOTREF(__pyx_t_2);
6997   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6998   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_26), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6999   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7000   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7001   __Pyx_GOTREF(__pyx_t_2);
7002   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__decode_senscr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7003   __Pyx_GOTREF(__pyx_t_3);
7004   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7005   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7006   __Pyx_GOTREF(__pyx_t_2);
7007   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7008   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_27), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7009   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7010   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7011   __Pyx_GOTREF(__pyx_t_2);
7012   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__start_utt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7013   __Pyx_GOTREF(__pyx_t_3);
7014   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7015   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7016   __Pyx_GOTREF(__pyx_t_2);
7017   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7018   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_28), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7019   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7020   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7021   __Pyx_GOTREF(__pyx_t_2);
7022   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__process_raw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7023   __Pyx_GOTREF(__pyx_t_3);
7024   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7025   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7026   __Pyx_GOTREF(__pyx_t_2);
7027   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7028   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_29), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7029   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7030   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7031   __Pyx_GOTREF(__pyx_t_2);
7032   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ps_end_utt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7033   __Pyx_GOTREF(__pyx_t_3);
7034   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7035   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7036   __Pyx_GOTREF(__pyx_t_2);
7037   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7038   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_30), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7039   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7040   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7041   __Pyx_GOTREF(__pyx_t_2);
7042   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_hyp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7043   __Pyx_GOTREF(__pyx_t_3);
7044   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7045   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7046   __Pyx_GOTREF(__pyx_t_2);
7047   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7048   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_31), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7049   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7050   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7051   __Pyx_GOTREF(__pyx_t_2);
7052   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_prob); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7053   __Pyx_GOTREF(__pyx_t_3);
7054   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7055   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7056   __Pyx_GOTREF(__pyx_t_2);
7057   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7058   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_32), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7059   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7060   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7061   __Pyx_GOTREF(__pyx_t_2);
7062   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_lattice); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7063   __Pyx_GOTREF(__pyx_t_3);
7064   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7065   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7066   __Pyx_GOTREF(__pyx_t_2);
7067   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7068   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_33), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7069   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7070   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7071   __Pyx_GOTREF(__pyx_t_2);
7072   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_lmset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7073   __Pyx_GOTREF(__pyx_t_3);
7074   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7075   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7076   __Pyx_GOTREF(__pyx_t_2);
7077   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7078   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_34), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7079   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7080   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7081   __Pyx_GOTREF(__pyx_t_2);
7082   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__add_word); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7083   __Pyx_GOTREF(__pyx_t_3);
7084   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7085   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7086   __Pyx_GOTREF(__pyx_t_2);
7087   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7088   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_35), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7089   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7090   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7091   __Pyx_GOTREF(__pyx_t_2);
7092   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__load_dict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7093   __Pyx_GOTREF(__pyx_t_3);
7094   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7095   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7096   __Pyx_GOTREF(__pyx_t_2);
7097   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7098   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_36), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7099   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7100   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7101   __Pyx_GOTREF(__pyx_t_2);
7102   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__save_dict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7103   __Pyx_GOTREF(__pyx_t_3);
7104   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7105   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7106   __Pyx_GOTREF(__pyx_t_2);
7107   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7108   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_37), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7109   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7110   if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7111   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
7112
7113   /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":170
7114  *     cdef readonly int sf, fef, lef
7115  *     cdef readonly double prob
7116  *     cdef readonly LatLink best_exit             # <<<<<<<<<<<<<<
7117  *     cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node)
7118  * 
7119  */
7120   goto __pyx_L0;
7121   __pyx_L1_error:;
7122   __Pyx_XDECREF(__pyx_t_1);
7123   __Pyx_XDECREF(__pyx_t_2);
7124   __Pyx_XDECREF(__pyx_t_3);
7125   if (__pyx_m) {
7126     __Pyx_AddTraceback("init pocketsphinx");
7127     Py_DECREF(__pyx_m); __pyx_m = 0;
7128   } else if (!PyErr_Occurred()) {
7129     PyErr_SetString(PyExc_ImportError, "init pocketsphinx");
7130   }
7131   __pyx_L0:;
7132   __Pyx_RefNannyFinishContext();
7133   #if PY_MAJOR_VERSION < 3
7134   return;
7135   #else
7136   return __pyx_m;
7137   #endif
7138 }
7139
7140 /* Runtime support code */
7141
7142 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
7143     PyObject *result;
7144     result = PyObject_GetAttr(dict, name);
7145     if (!result)
7146         PyErr_SetObject(PyExc_NameError, name);
7147     return result;
7148 }
7149
7150 static void __Pyx_RaiseArgtupleInvalid(
7151     const char* func_name,
7152     int exact,
7153     Py_ssize_t num_min,
7154     Py_ssize_t num_max,
7155     Py_ssize_t num_found)
7156 {
7157     Py_ssize_t num_expected;
7158     const char *number, *more_or_less;
7159
7160     if (num_found < num_min) {
7161         num_expected = num_min;
7162         more_or_less = "at least";
7163     } else {
7164         num_expected = num_max;
7165         more_or_less = "at most";
7166     }
7167     if (exact) {
7168         more_or_less = "exactly";
7169     }
7170     number = (num_expected == 1) ? "" : "s";
7171     PyErr_Format(PyExc_TypeError,
7172         #if PY_VERSION_HEX < 0x02050000
7173             "%s() takes %s %d positional argument%s (%d given)",
7174         #else
7175             "%s() takes %s %zd positional argument%s (%zd given)",
7176         #endif
7177         func_name, more_or_less, num_expected, number, num_found);
7178 }
7179
7180 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
7181     PyObject *kwdict,
7182     const char* function_name,
7183     int kw_allowed)
7184 {
7185     PyObject* key = 0;
7186     Py_ssize_t pos = 0;
7187     while (PyDict_Next(kwdict, &pos, &key, 0)) {
7188         #if PY_MAJOR_VERSION < 3
7189         if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
7190         #else
7191         if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
7192         #endif
7193             goto invalid_keyword_type;
7194     }
7195     if ((!kw_allowed) && unlikely(key))
7196         goto invalid_keyword;
7197     return 1;
7198 invalid_keyword_type:
7199     PyErr_Format(PyExc_TypeError,
7200         "%s() keywords must be strings", function_name);
7201     return 0;
7202 invalid_keyword:
7203     PyErr_Format(PyExc_TypeError,
7204     #if PY_MAJOR_VERSION < 3
7205         "%s() got an unexpected keyword argument '%s'",
7206         function_name, PyString_AsString(key));
7207     #else
7208         "%s() got an unexpected keyword argument '%U'",
7209         function_name, key);
7210     #endif
7211     return 0;
7212 }
7213
7214 static void __Pyx_RaiseDoubleKeywordsError(
7215     const char* func_name,
7216     PyObject* kw_name)
7217 {
7218     PyErr_Format(PyExc_TypeError,
7219         #if PY_MAJOR_VERSION >= 3
7220         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
7221         #else
7222         "%s() got multiple values for keyword argument '%s'", func_name,
7223         PyString_AS_STRING(kw_name));
7224         #endif
7225 }
7226
7227 static int __Pyx_ParseOptionalKeywords(
7228     PyObject *kwds,
7229     PyObject **argnames[],
7230     PyObject *kwds2,
7231     PyObject *values[],
7232     Py_ssize_t num_pos_args,
7233     const char* function_name)
7234 {
7235     PyObject *key = 0, *value = 0;
7236     Py_ssize_t pos = 0;
7237     PyObject*** name;
7238     PyObject*** first_kw_arg = argnames + num_pos_args;
7239
7240     while (PyDict_Next(kwds, &pos, &key, &value)) {
7241         name = first_kw_arg;
7242         while (*name && (**name != key)) name++;
7243         if (*name) {
7244             values[name-argnames] = value;
7245         } else {
7246             #if PY_MAJOR_VERSION < 3
7247             if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
7248             #else
7249             if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
7250             #endif
7251                 goto invalid_keyword_type;
7252             } else {
7253                 for (name = first_kw_arg; *name; name++) {
7254                     #if PY_MAJOR_VERSION >= 3
7255                     if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
7256                         PyUnicode_Compare(**name, key) == 0) break;
7257                     #else
7258                     if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
7259                         _PyString_Eq(**name, key)) break;
7260                     #endif
7261                 }
7262                 if (*name) {
7263                     values[name-argnames] = value;
7264                 } else {
7265                     /* unexpected keyword found */
7266                     for (name=argnames; name != first_kw_arg; name++) {
7267                         if (**name == key) goto arg_passed_twice;
7268                         #if PY_MAJOR_VERSION >= 3
7269                         if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
7270                             PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
7271                         #else
7272                         if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
7273                             _PyString_Eq(**name, key)) goto arg_passed_twice;
7274                         #endif
7275                     }
7276                     if (kwds2) {
7277                         if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
7278                     } else {
7279                         goto invalid_keyword;
7280                     }
7281                 }
7282             }
7283         }
7284     }
7285     return 0;
7286 arg_passed_twice:
7287     __Pyx_RaiseDoubleKeywordsError(function_name, **name);
7288     goto bad;
7289 invalid_keyword_type:
7290     PyErr_Format(PyExc_TypeError,
7291         "%s() keywords must be strings", function_name);
7292     goto bad;
7293 invalid_keyword:
7294     PyErr_Format(PyExc_TypeError,
7295     #if PY_MAJOR_VERSION < 3
7296         "%s() got an unexpected keyword argument '%s'",
7297         function_name, PyString_AsString(key));
7298     #else
7299         "%s() got an unexpected keyword argument '%U'",
7300         function_name, key);
7301     #endif
7302 bad:
7303     return -1;
7304 }
7305
7306 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
7307     if (unlikely(!type)) {
7308         PyErr_Format(PyExc_SystemError, "Missing type object");
7309         return 0;
7310     }
7311     if (likely(PyObject_TypeCheck(obj, type)))
7312         return 1;
7313     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
7314                  Py_TYPE(obj)->tp_name, type->tp_name);
7315     return 0;
7316 }
7317
7318 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
7319     const char *name, int exact)
7320 {
7321     if (!type) {
7322         PyErr_Format(PyExc_SystemError, "Missing type object");
7323         return 0;
7324     }
7325     if (none_allowed && obj == Py_None) return 1;
7326     else if (exact) {
7327         if (Py_TYPE(obj) == type) return 1;
7328     }
7329     else {
7330         if (PyObject_TypeCheck(obj, type)) return 1;
7331     }
7332     PyErr_Format(PyExc_TypeError,
7333         "Argument '%s' has incorrect type (expected %s, got %s)",
7334         name, type->tp_name, Py_TYPE(obj)->tp_name);
7335     return 0;
7336 }
7337
7338 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
7339     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
7340 }
7341
7342 static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
7343     PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
7344 }
7345
7346
7347 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
7348     PyObject *tmp_type, *tmp_value, *tmp_tb;
7349     PyThreadState *tstate = PyThreadState_GET();
7350
7351     tmp_type = tstate->curexc_type;
7352     tmp_value = tstate->curexc_value;
7353     tmp_tb = tstate->curexc_traceback;
7354     tstate->curexc_type = type;
7355     tstate->curexc_value = value;
7356     tstate->curexc_traceback = tb;
7357     Py_XDECREF(tmp_type);
7358     Py_XDECREF(tmp_value);
7359     Py_XDECREF(tmp_tb);
7360 }
7361
7362 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
7363     PyThreadState *tstate = PyThreadState_GET();
7364     *type = tstate->curexc_type;
7365     *value = tstate->curexc_value;
7366     *tb = tstate->curexc_traceback;
7367
7368     tstate->curexc_type = 0;
7369     tstate->curexc_value = 0;
7370     tstate->curexc_traceback = 0;
7371 }
7372
7373
7374 #if PY_MAJOR_VERSION < 3
7375 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
7376     Py_XINCREF(type);
7377     Py_XINCREF(value);
7378     Py_XINCREF(tb);
7379     /* First, check the traceback argument, replacing None with NULL. */
7380     if (tb == Py_None) {
7381         Py_DECREF(tb);
7382         tb = 0;
7383     }
7384     else if (tb != NULL && !PyTraceBack_Check(tb)) {
7385         PyErr_SetString(PyExc_TypeError,
7386             "raise: arg 3 must be a traceback or None");
7387         goto raise_error;
7388     }
7389     /* Next, replace a missing value with None */
7390     if (value == NULL) {
7391         value = Py_None;
7392         Py_INCREF(value);
7393     }
7394     #if PY_VERSION_HEX < 0x02050000
7395     if (!PyClass_Check(type))
7396     #else
7397     if (!PyType_Check(type))
7398     #endif
7399     {
7400         /* Raising an instance.  The value should be a dummy. */
7401         if (value != Py_None) {
7402             PyErr_SetString(PyExc_TypeError,
7403                 "instance exception may not have a separate value");
7404             goto raise_error;
7405         }
7406         /* Normalize to raise <class>, <instance> */
7407         Py_DECREF(value);
7408         value = type;
7409         #if PY_VERSION_HEX < 0x02050000
7410             if (PyInstance_Check(type)) {
7411                 type = (PyObject*) ((PyInstanceObject*)type)->in_class;
7412                 Py_INCREF(type);
7413             }
7414             else {
7415                 type = 0;
7416                 PyErr_SetString(PyExc_TypeError,
7417                     "raise: exception must be an old-style class or instance");
7418                 goto raise_error;
7419             }
7420         #else
7421             type = (PyObject*) Py_TYPE(type);
7422             Py_INCREF(type);
7423             if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
7424                 PyErr_SetString(PyExc_TypeError,
7425                     "raise: exception class must be a subclass of BaseException");
7426                 goto raise_error;
7427             }
7428         #endif
7429     }
7430
7431     __Pyx_ErrRestore(type, value, tb);
7432     return;
7433 raise_error:
7434     Py_XDECREF(value);
7435     Py_XDECREF(type);
7436     Py_XDECREF(tb);
7437     return;
7438 }
7439
7440 #else /* Python 3+ */
7441
7442 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
7443     if (tb == Py_None) {
7444         tb = 0;
7445     } else if (tb && !PyTraceBack_Check(tb)) {
7446         PyErr_SetString(PyExc_TypeError,
7447             "raise: arg 3 must be a traceback or None");
7448         goto bad;
7449     }
7450     if (value == Py_None)
7451         value = 0;
7452
7453     if (PyExceptionInstance_Check(type)) {
7454         if (value) {
7455             PyErr_SetString(PyExc_TypeError,
7456                 "instance exception may not have a separate value");
7457             goto bad;
7458         }
7459         value = type;
7460         type = (PyObject*) Py_TYPE(value);
7461     } else if (!PyExceptionClass_Check(type)) {
7462         PyErr_SetString(PyExc_TypeError,
7463             "raise: exception class must be a subclass of BaseException");
7464         goto bad;
7465     }
7466
7467     PyErr_SetObject(type, value);
7468
7469     if (tb) {
7470         PyThreadState *tstate = PyThreadState_GET();
7471         PyObject* tmp_tb = tstate->curexc_traceback;
7472         if (tb != tmp_tb) {
7473             Py_INCREF(tb);
7474             tstate->curexc_traceback = tb;
7475             Py_XDECREF(tmp_tb);
7476         }
7477     }
7478
7479 bad:
7480     return;
7481 }
7482 #endif
7483
7484 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
7485     const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
7486     const int is_unsigned = neg_one > const_zero;
7487     if (sizeof(unsigned char) < sizeof(long)) {
7488         long val = __Pyx_PyInt_AsLong(x);
7489         if (unlikely(val != (long)(unsigned char)val)) {
7490             if (!unlikely(val == -1 && PyErr_Occurred())) {
7491                 PyErr_SetString(PyExc_OverflowError,
7492                     (is_unsigned && unlikely(val < 0)) ?
7493                     "can't convert negative value to unsigned char" :
7494                     "value too large to convert to unsigned char");
7495             }
7496             return (unsigned char)-1;
7497         }
7498         return (unsigned char)val;
7499     }
7500     return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
7501 }
7502
7503 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
7504     const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
7505     const int is_unsigned = neg_one > const_zero;
7506     if (sizeof(unsigned short) < sizeof(long)) {
7507         long val = __Pyx_PyInt_AsLong(x);
7508         if (unlikely(val != (long)(unsigned short)val)) {
7509             if (!unlikely(val == -1 && PyErr_Occurred())) {
7510                 PyErr_SetString(PyExc_OverflowError,
7511                     (is_unsigned && unlikely(val < 0)) ?
7512                     "can't convert negative value to unsigned short" :
7513                     "value too large to convert to unsigned short");
7514             }
7515             return (unsigned short)-1;
7516         }
7517         return (unsigned short)val;
7518     }
7519     return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
7520 }
7521
7522 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
7523     const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
7524     const int is_unsigned = neg_one > const_zero;
7525     if (sizeof(unsigned int) < sizeof(long)) {
7526         long val = __Pyx_PyInt_AsLong(x);
7527         if (unlikely(val != (long)(unsigned int)val)) {
7528             if (!unlikely(val == -1 && PyErr_Occurred())) {
7529                 PyErr_SetString(PyExc_OverflowError,
7530                     (is_unsigned && unlikely(val < 0)) ?
7531                     "can't convert negative value to unsigned int" :
7532                     "value too large to convert to unsigned int");
7533             }
7534             return (unsigned int)-1;
7535         }
7536         return (unsigned int)val;
7537     }
7538     return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
7539 }
7540
7541 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
7542     const char neg_one = (char)-1, const_zero = 0;
7543     const int is_unsigned = neg_one > const_zero;
7544     if (sizeof(char) < sizeof(long)) {
7545         long val = __Pyx_PyInt_AsLong(x);
7546         if (unlikely(val != (long)(char)val)) {
7547             if (!unlikely(val == -1 && PyErr_Occurred())) {
7548                 PyErr_SetString(PyExc_OverflowError,
7549                     (is_unsigned && unlikely(val < 0)) ?
7550                     "can't convert negative value to char" :
7551                     "value too large to convert to char");
7552             }
7553             return (char)-1;
7554         }
7555         return (char)val;
7556     }
7557     return (char)__Pyx_PyInt_AsLong(x);
7558 }
7559
7560 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
7561     const short neg_one = (short)-1, const_zero = 0;
7562     const int is_unsigned = neg_one > const_zero;
7563     if (sizeof(short) < sizeof(long)) {
7564         long val = __Pyx_PyInt_AsLong(x);
7565         if (unlikely(val != (long)(short)val)) {
7566             if (!unlikely(val == -1 && PyErr_Occurred())) {
7567                 PyErr_SetString(PyExc_OverflowError,
7568                     (is_unsigned && unlikely(val < 0)) ?
7569                     "can't convert negative value to short" :
7570                     "value too large to convert to short");
7571             }
7572             return (short)-1;
7573         }
7574         return (short)val;
7575     }
7576     return (short)__Pyx_PyInt_AsLong(x);
7577 }
7578
7579 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
7580     const int neg_one = (int)-1, const_zero = 0;
7581     const int is_unsigned = neg_one > const_zero;
7582     if (sizeof(int) < sizeof(long)) {
7583         long val = __Pyx_PyInt_AsLong(x);
7584         if (unlikely(val != (long)(int)val)) {
7585             if (!unlikely(val == -1 && PyErr_Occurred())) {
7586                 PyErr_SetString(PyExc_OverflowError,
7587                     (is_unsigned && unlikely(val < 0)) ?
7588                     "can't convert negative value to int" :
7589                     "value too large to convert to int");
7590             }
7591             return (int)-1;
7592         }
7593         return (int)val;
7594     }
7595     return (int)__Pyx_PyInt_AsLong(x);
7596 }
7597
7598 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
7599     const signed char neg_one = (signed char)-1, const_zero = 0;
7600     const int is_unsigned = neg_one > const_zero;
7601     if (sizeof(signed char) < sizeof(long)) {
7602         long val = __Pyx_PyInt_AsLong(x);
7603         if (unlikely(val != (long)(signed char)val)) {
7604             if (!unlikely(val == -1 && PyErr_Occurred())) {
7605                 PyErr_SetString(PyExc_OverflowError,
7606                     (is_unsigned && unlikely(val < 0)) ?
7607                     "can't convert negative value to signed char" :
7608                     "value too large to convert to signed char");
7609             }
7610             return (signed char)-1;
7611         }
7612         return (signed char)val;
7613     }
7614     return (signed char)__Pyx_PyInt_AsSignedLong(x);
7615 }
7616
7617 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
7618     const signed short neg_one = (signed short)-1, const_zero = 0;
7619     const int is_unsigned = neg_one > const_zero;
7620     if (sizeof(signed short) < sizeof(long)) {
7621         long val = __Pyx_PyInt_AsLong(x);
7622         if (unlikely(val != (long)(signed short)val)) {
7623             if (!unlikely(val == -1 && PyErr_Occurred())) {
7624                 PyErr_SetString(PyExc_OverflowError,
7625                     (is_unsigned && unlikely(val < 0)) ?
7626                     "can't convert negative value to signed short" :
7627                     "value too large to convert to signed short");
7628             }
7629             return (signed short)-1;
7630         }
7631         return (signed short)val;
7632     }
7633     return (signed short)__Pyx_PyInt_AsSignedLong(x);
7634 }
7635
7636 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
7637     const signed int neg_one = (signed int)-1, const_zero = 0;
7638     const int is_unsigned = neg_one > const_zero;
7639     if (sizeof(signed int) < sizeof(long)) {
7640         long val = __Pyx_PyInt_AsLong(x);
7641         if (unlikely(val != (long)(signed int)val)) {
7642             if (!unlikely(val == -1 && PyErr_Occurred())) {
7643                 PyErr_SetString(PyExc_OverflowError,
7644                     (is_unsigned && unlikely(val < 0)) ?
7645                     "can't convert negative value to signed int" :
7646                     "value too large to convert to signed int");
7647             }
7648             return (signed int)-1;
7649         }
7650         return (signed int)val;
7651     }
7652     return (signed int)__Pyx_PyInt_AsSignedLong(x);
7653 }
7654
7655 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
7656     const int neg_one = (int)-1, const_zero = 0;
7657     const int is_unsigned = neg_one > const_zero;
7658     if (sizeof(int) < sizeof(long)) {
7659         long val = __Pyx_PyInt_AsLong(x);
7660         if (unlikely(val != (long)(int)val)) {
7661             if (!unlikely(val == -1 && PyErr_Occurred())) {
7662                 PyErr_SetString(PyExc_OverflowError,
7663                     (is_unsigned && unlikely(val < 0)) ?
7664                     "can't convert negative value to int" :
7665                     "value too large to convert to int");
7666             }
7667             return (int)-1;
7668         }
7669         return (int)val;
7670     }
7671     return (int)__Pyx_PyInt_AsLong(x);
7672 }
7673
7674 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
7675     const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
7676     const int is_unsigned = neg_one > const_zero;
7677 #if PY_VERSION_HEX < 0x03000000
7678     if (likely(PyInt_Check(x))) {
7679         long val = PyInt_AS_LONG(x);
7680         if (is_unsigned && unlikely(val < 0)) {
7681             PyErr_SetString(PyExc_OverflowError,
7682                             "can't convert negative value to unsigned long");
7683             return (unsigned long)-1;
7684         }
7685         return (unsigned long)val;
7686     } else
7687 #endif
7688     if (likely(PyLong_Check(x))) {
7689         if (is_unsigned) {
7690             if (unlikely(Py_SIZE(x) < 0)) {
7691                 PyErr_SetString(PyExc_OverflowError,
7692                                 "can't convert negative value to unsigned long");
7693                 return (unsigned long)-1;
7694             }
7695             return PyLong_AsUnsignedLong(x);
7696         } else {
7697             return PyLong_AsLong(x);
7698         }
7699     } else {
7700         unsigned long val;
7701         PyObject *tmp = __Pyx_PyNumber_Int(x);
7702         if (!tmp) return (unsigned long)-1;
7703         val = __Pyx_PyInt_AsUnsignedLong(tmp);
7704         Py_DECREF(tmp);
7705         return val;
7706     }
7707 }
7708
7709 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
7710     const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
7711     const int is_unsigned = neg_one > const_zero;
7712 #if PY_VERSION_HEX < 0x03000000
7713     if (likely(PyInt_Check(x))) {
7714         long val = PyInt_AS_LONG(x);
7715         if (is_unsigned && unlikely(val < 0)) {
7716             PyErr_SetString(PyExc_OverflowError,
7717                             "can't convert negative value to unsigned PY_LONG_LONG");
7718             return (unsigned PY_LONG_LONG)-1;
7719         }
7720         return (unsigned PY_LONG_LONG)val;
7721     } else
7722 #endif
7723     if (likely(PyLong_Check(x))) {
7724         if (is_unsigned) {
7725             if (unlikely(Py_SIZE(x) < 0)) {
7726                 PyErr_SetString(PyExc_OverflowError,
7727                                 "can't convert negative value to unsigned PY_LONG_LONG");
7728                 return (unsigned PY_LONG_LONG)-1;
7729             }
7730             return PyLong_AsUnsignedLongLong(x);
7731         } else {
7732             return PyLong_AsLongLong(x);
7733         }
7734     } else {
7735         unsigned PY_LONG_LONG val;
7736         PyObject *tmp = __Pyx_PyNumber_Int(x);
7737         if (!tmp) return (unsigned PY_LONG_LONG)-1;
7738         val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
7739         Py_DECREF(tmp);
7740         return val;
7741     }
7742 }
7743
7744 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
7745     const long neg_one = (long)-1, const_zero = 0;
7746     const int is_unsigned = neg_one > const_zero;
7747 #if PY_VERSION_HEX < 0x03000000
7748     if (likely(PyInt_Check(x))) {
7749         long val = PyInt_AS_LONG(x);
7750         if (is_unsigned && unlikely(val < 0)) {
7751             PyErr_SetString(PyExc_OverflowError,
7752                             "can't convert negative value to long");
7753             return (long)-1;
7754         }
7755         return (long)val;
7756     } else
7757 #endif
7758     if (likely(PyLong_Check(x))) {
7759         if (is_unsigned) {
7760             if (unlikely(Py_SIZE(x) < 0)) {
7761                 PyErr_SetString(PyExc_OverflowError,
7762                                 "can't convert negative value to long");
7763                 return (long)-1;
7764             }
7765             return PyLong_AsUnsignedLong(x);
7766         } else {
7767             return PyLong_AsLong(x);
7768         }
7769     } else {
7770         long val;
7771         PyObject *tmp = __Pyx_PyNumber_Int(x);
7772         if (!tmp) return (long)-1;
7773         val = __Pyx_PyInt_AsLong(tmp);
7774         Py_DECREF(tmp);
7775         return val;
7776     }
7777 }
7778
7779 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
7780     const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
7781     const int is_unsigned = neg_one > const_zero;
7782 #if PY_VERSION_HEX < 0x03000000
7783     if (likely(PyInt_Check(x))) {
7784         long val = PyInt_AS_LONG(x);
7785         if (is_unsigned && unlikely(val < 0)) {
7786             PyErr_SetString(PyExc_OverflowError,
7787                             "can't convert negative value to PY_LONG_LONG");
7788             return (PY_LONG_LONG)-1;
7789         }
7790         return (PY_LONG_LONG)val;
7791     } else
7792 #endif
7793     if (likely(PyLong_Check(x))) {
7794         if (is_unsigned) {
7795             if (unlikely(Py_SIZE(x) < 0)) {
7796                 PyErr_SetString(PyExc_OverflowError,
7797                                 "can't convert negative value to PY_LONG_LONG");
7798                 return (PY_LONG_LONG)-1;
7799             }
7800             return PyLong_AsUnsignedLongLong(x);
7801         } else {
7802             return PyLong_AsLongLong(x);
7803         }
7804     } else {
7805         PY_LONG_LONG val;
7806         PyObject *tmp = __Pyx_PyNumber_Int(x);
7807         if (!tmp) return (PY_LONG_LONG)-1;
7808         val = __Pyx_PyInt_AsLongLong(tmp);
7809         Py_DECREF(tmp);
7810         return val;
7811     }
7812 }
7813
7814 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
7815     const signed long neg_one = (signed long)-1, const_zero = 0;
7816     const int is_unsigned = neg_one > const_zero;
7817 #if PY_VERSION_HEX < 0x03000000
7818     if (likely(PyInt_Check(x))) {
7819         long val = PyInt_AS_LONG(x);
7820         if (is_unsigned && unlikely(val < 0)) {
7821             PyErr_SetString(PyExc_OverflowError,
7822                             "can't convert negative value to signed long");
7823             return (signed long)-1;
7824         }
7825         return (signed long)val;
7826     } else
7827 #endif
7828     if (likely(PyLong_Check(x))) {
7829         if (is_unsigned) {
7830             if (unlikely(Py_SIZE(x) < 0)) {
7831                 PyErr_SetString(PyExc_OverflowError,
7832                                 "can't convert negative value to signed long");
7833                 return (signed long)-1;
7834             }
7835             return PyLong_AsUnsignedLong(x);
7836         } else {
7837             return PyLong_AsLong(x);
7838         }
7839     } else {
7840         signed long val;
7841         PyObject *tmp = __Pyx_PyNumber_Int(x);
7842         if (!tmp) return (signed long)-1;
7843         val = __Pyx_PyInt_AsSignedLong(tmp);
7844         Py_DECREF(tmp);
7845         return val;
7846     }
7847 }
7848
7849 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
7850     const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
7851     const int is_unsigned = neg_one > const_zero;
7852 #if PY_VERSION_HEX < 0x03000000
7853     if (likely(PyInt_Check(x))) {
7854         long val = PyInt_AS_LONG(x);
7855         if (is_unsigned && unlikely(val < 0)) {
7856             PyErr_SetString(PyExc_OverflowError,
7857                             "can't convert negative value to signed PY_LONG_LONG");
7858             return (signed PY_LONG_LONG)-1;
7859         }
7860         return (signed PY_LONG_LONG)val;
7861     } else
7862 #endif
7863     if (likely(PyLong_Check(x))) {
7864         if (is_unsigned) {
7865             if (unlikely(Py_SIZE(x) < 0)) {
7866                 PyErr_SetString(PyExc_OverflowError,
7867                                 "can't convert negative value to signed PY_LONG_LONG");
7868                 return (signed PY_LONG_LONG)-1;
7869             }
7870             return PyLong_AsUnsignedLongLong(x);
7871         } else {
7872             return PyLong_AsLongLong(x);
7873         }
7874     } else {
7875         signed PY_LONG_LONG val;
7876         PyObject *tmp = __Pyx_PyNumber_Int(x);
7877         if (!tmp) return (signed PY_LONG_LONG)-1;
7878         val = __Pyx_PyInt_AsSignedLongLong(tmp);
7879         Py_DECREF(tmp);
7880         return val;
7881     }
7882 }
7883
7884 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
7885 #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
7886     PyObject *ob = PyCapsule_New(vtable, 0, 0);
7887 #else
7888     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
7889 #endif
7890     if (!ob)
7891         goto bad;
7892     if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
7893         goto bad;
7894     Py_DECREF(ob);
7895     return 0;
7896 bad:
7897     Py_XDECREF(ob);
7898     return -1;
7899 }
7900
7901 #ifndef __PYX_HAVE_RT_ImportType
7902 #define __PYX_HAVE_RT_ImportType
7903 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
7904     long size, int strict)
7905 {
7906     PyObject *py_module = 0;
7907     PyObject *result = 0;
7908     PyObject *py_name = 0;
7909     char warning[200];
7910
7911     py_module = __Pyx_ImportModule(module_name);
7912     if (!py_module)
7913         goto bad;
7914     #if PY_MAJOR_VERSION < 3
7915     py_name = PyString_FromString(class_name);
7916     #else
7917     py_name = PyUnicode_FromString(class_name);
7918     #endif
7919     if (!py_name)
7920         goto bad;
7921     result = PyObject_GetAttr(py_module, py_name);
7922     Py_DECREF(py_name);
7923     py_name = 0;
7924     Py_DECREF(py_module);
7925     py_module = 0;
7926     if (!result)
7927         goto bad;
7928     if (!PyType_Check(result)) {
7929         PyErr_Format(PyExc_TypeError, 
7930             "%s.%s is not a type object",
7931             module_name, class_name);
7932         goto bad;
7933     }
7934     if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) {
7935         PyOS_snprintf(warning, sizeof(warning), 
7936             "%s.%s size changed, may indicate binary incompatibility",
7937             module_name, class_name);
7938         #if PY_VERSION_HEX < 0x02050000
7939         PyErr_Warn(NULL, warning);
7940         #else
7941         PyErr_WarnEx(NULL, warning, 0);
7942         #endif
7943     }
7944     else if (((PyTypeObject *)result)->tp_basicsize != size) {
7945         PyErr_Format(PyExc_ValueError, 
7946             "%s.%s has the wrong size, try recompiling",
7947             module_name, class_name);
7948         goto bad;
7949     }
7950     return (PyTypeObject *)result;
7951 bad:
7952     Py_XDECREF(py_module);
7953     Py_XDECREF(result);
7954     return 0;
7955 }
7956 #endif
7957
7958 #ifndef __PYX_HAVE_RT_ImportModule
7959 #define __PYX_HAVE_RT_ImportModule
7960 static PyObject *__Pyx_ImportModule(const char *name) {
7961     PyObject *py_name = 0;
7962     PyObject *py_module = 0;
7963
7964     #if PY_MAJOR_VERSION < 3
7965     py_name = PyString_FromString(name);
7966     #else
7967     py_name = PyUnicode_FromString(name);
7968     #endif
7969     if (!py_name)
7970         goto bad;
7971     py_module = PyImport_Import(py_name);
7972     Py_DECREF(py_name);
7973     return py_module;
7974 bad:
7975     Py_XDECREF(py_name);
7976     return 0;
7977 }
7978 #endif
7979
7980 static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) {
7981     PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__");
7982     if (!ob)
7983         goto bad;
7984 #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
7985     *(void **)vtabptr = PyCapsule_GetPointer(ob, 0);
7986 #else
7987     *(void **)vtabptr = PyCObject_AsVoidPtr(ob);
7988 #endif
7989     if (!*(void **)vtabptr)
7990         goto bad;
7991     Py_DECREF(ob);
7992     return 0;
7993 bad:
7994     Py_XDECREF(ob);
7995     return -1;
7996 }
7997
7998 #include "compile.h"
7999 #include "frameobject.h"
8000 #include "traceback.h"
8001
8002 static void __Pyx_AddTraceback(const char *funcname) {
8003     PyObject *py_srcfile = 0;
8004     PyObject *py_funcname = 0;
8005     PyObject *py_globals = 0;
8006     PyCodeObject *py_code = 0;
8007     PyFrameObject *py_frame = 0;
8008
8009     #if PY_MAJOR_VERSION < 3
8010     py_srcfile = PyString_FromString(__pyx_filename);
8011     #else
8012     py_srcfile = PyUnicode_FromString(__pyx_filename);
8013     #endif
8014     if (!py_srcfile) goto bad;
8015     if (__pyx_clineno) {
8016         #if PY_MAJOR_VERSION < 3
8017         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
8018         #else
8019         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
8020         #endif
8021     }
8022     else {
8023         #if PY_MAJOR_VERSION < 3
8024         py_funcname = PyString_FromString(funcname);
8025         #else
8026         py_funcname = PyUnicode_FromString(funcname);
8027         #endif
8028     }
8029     if (!py_funcname) goto bad;
8030     py_globals = PyModule_GetDict(__pyx_m);
8031     if (!py_globals) goto bad;
8032     py_code = PyCode_New(
8033         0,            /*int argcount,*/
8034         #if PY_MAJOR_VERSION >= 3
8035         0,            /*int kwonlyargcount,*/
8036         #endif
8037         0,            /*int nlocals,*/
8038         0,            /*int stacksize,*/
8039         0,            /*int flags,*/
8040         __pyx_empty_bytes, /*PyObject *code,*/
8041         __pyx_empty_tuple,  /*PyObject *consts,*/
8042         __pyx_empty_tuple,  /*PyObject *names,*/
8043         __pyx_empty_tuple,  /*PyObject *varnames,*/
8044         __pyx_empty_tuple,  /*PyObject *freevars,*/
8045         __pyx_empty_tuple,  /*PyObject *cellvars,*/
8046         py_srcfile,   /*PyObject *filename,*/
8047         py_funcname,  /*PyObject *name,*/
8048         __pyx_lineno,   /*int firstlineno,*/
8049         __pyx_empty_bytes  /*PyObject *lnotab*/
8050     );
8051     if (!py_code) goto bad;
8052     py_frame = PyFrame_New(
8053         PyThreadState_GET(), /*PyThreadState *tstate,*/
8054         py_code,             /*PyCodeObject *code,*/
8055         py_globals,          /*PyObject *globals,*/
8056         0                    /*PyObject *locals*/
8057     );
8058     if (!py_frame) goto bad;
8059     py_frame->f_lineno = __pyx_lineno;
8060     PyTraceBack_Here(py_frame);
8061 bad:
8062     Py_XDECREF(py_srcfile);
8063     Py_XDECREF(py_funcname);
8064     Py_XDECREF(py_code);
8065     Py_XDECREF(py_frame);
8066 }
8067
8068 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
8069     while (t->p) {
8070         #if PY_MAJOR_VERSION < 3
8071         if (t->is_unicode) {
8072             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
8073         } else if (t->intern) {
8074             *t->p = PyString_InternFromString(t->s);
8075         } else {
8076             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
8077         }
8078         #else  /* Python 3+ has unicode identifiers */
8079         if (t->is_unicode | t->is_str) {
8080             if (t->intern) {
8081                 *t->p = PyUnicode_InternFromString(t->s);
8082             } else if (t->encoding) {
8083                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
8084             } else {
8085                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
8086             }
8087         } else {
8088             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
8089         }
8090         #endif
8091         if (!*t->p)
8092             return -1;
8093         ++t;
8094     }
8095     return 0;
8096 }
8097
8098 /* Type Conversion Functions */
8099
8100 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
8101    int is_true = x == Py_True;
8102    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
8103    else return PyObject_IsTrue(x);
8104 }
8105
8106 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
8107   PyNumberMethods *m;
8108   const char *name = NULL;
8109   PyObject *res = NULL;
8110 #if PY_VERSION_HEX < 0x03000000
8111   if (PyInt_Check(x) || PyLong_Check(x))
8112 #else
8113   if (PyLong_Check(x))
8114 #endif
8115     return Py_INCREF(x), x;
8116   m = Py_TYPE(x)->tp_as_number;
8117 #if PY_VERSION_HEX < 0x03000000
8118   if (m && m->nb_int) {
8119     name = "int";
8120     res = PyNumber_Int(x);
8121   }
8122   else if (m && m->nb_long) {
8123     name = "long";
8124     res = PyNumber_Long(x);
8125   }
8126 #else
8127   if (m && m->nb_int) {
8128     name = "int";
8129     res = PyNumber_Long(x);
8130   }
8131 #endif
8132   if (res) {
8133 #if PY_VERSION_HEX < 0x03000000
8134     if (!PyInt_Check(res) && !PyLong_Check(res)) {
8135 #else
8136     if (!PyLong_Check(res)) {
8137 #endif
8138       PyErr_Format(PyExc_TypeError,
8139                    "__%s__ returned non-%s (type %.200s)",
8140                    name, name, Py_TYPE(res)->tp_name);
8141       Py_DECREF(res);
8142       return NULL;
8143     }
8144   }
8145   else if (!PyErr_Occurred()) {
8146     PyErr_SetString(PyExc_TypeError,
8147                     "an integer is required");
8148   }
8149   return res;
8150 }
8151
8152 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
8153   Py_ssize_t ival;
8154   PyObject* x = PyNumber_Index(b);
8155   if (!x) return -1;
8156   ival = PyInt_AsSsize_t(x);
8157   Py_DECREF(x);
8158   return ival;
8159 }
8160
8161 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
8162 #if PY_VERSION_HEX < 0x02050000
8163    if (ival <= LONG_MAX)
8164        return PyInt_FromLong((long)ival);
8165    else {
8166        unsigned char *bytes = (unsigned char *) &ival;
8167        int one = 1; int little = (int)*(unsigned char*)&one;
8168        return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
8169    }
8170 #else
8171    return PyInt_FromSize_t(ival);
8172 #endif
8173 }
8174
8175 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
8176    unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
8177    if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
8178        return (size_t)-1;
8179    } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
8180        PyErr_SetString(PyExc_OverflowError,
8181                        "value too large to convert to size_t");
8182        return (size_t)-1;
8183    }
8184    return (size_t)val;
8185 }
8186
8187
8188 #endif /* Py_PYTHON_H */