-/* Generated by Cython 0.29.6 */
+/* Generated by Cython 0.29.12 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
#error Cython requires Python 2.6+ or Python 3.3+.
#else
-#define CYTHON_ABI "0_29_6"
-#define CYTHON_HEX_VERSION 0x001D06F0
+#define CYTHON_ABI "0_29_12"
+#define CYTHON_HEX_VERSION 0x001D0CF0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
#define __Pyx_DefaultClassType PyClass_Type
#else
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
+#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+#else
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+#endif
#define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
struct __pyx_obj_9pywrapfst_FarWriter;
struct __pyx_obj_9pywrapfst___pyx_scope_struct____iter__;
-/* "fst.pxd":514
+/* "fst.pxd":516
*
*
* ctypedef pair[int64, const FstClass *] LabelFstClassPair # <<<<<<<<<<<<<<
*/
typedef std::pair<__pyx_t_10basictypes_int64,fst::script::FstClass const *> __pyx_t_3fst_LabelFstClassPair;
-/* "fst.pxd":516
+/* "fst.pxd":518
* ctypedef pair[int64, const FstClass *] LabelFstClassPair
*
* ctypedef pair[int64, int64] LabelPair # <<<<<<<<<<<<<<
PyObject *missing_sym;
};
-/* "pywrapfst.pxd":289
- * cpdef int64 add_state(self) except *
+/* "pywrapfst.pxd":291
+ * cpdef void add_states(self, size_t) except *
*
* cdef void _arcsort(self, sort_type=?) except * # <<<<<<<<<<<<<<
*
PyObject *sort_type;
};
-/* "pywrapfst.pxd":291
+/* "pywrapfst.pxd":293
* cdef void _arcsort(self, sort_type=?) except *
*
* cdef void _closure(self, bool closure_plus=?) except * # <<<<<<<<<<<<<<
bool closure_plus;
};
-/* "pywrapfst.pxd":299
+/* "pywrapfst.pxd":301
* cdef void _decode(self, EncodeMapper) except *
*
* cdef void _delete_arcs(self, int64 state, size_t n=?) except * # <<<<<<<<<<<<<<
size_t n;
};
-/* "pywrapfst.pxd":301
+/* "pywrapfst.pxd":303
* cdef void _delete_arcs(self, int64 state, size_t n=?) except *
*
* cdef void _delete_states(self, states=?) except * # <<<<<<<<<<<<<<
PyObject *states;
};
-/* "pywrapfst.pxd":307
+/* "pywrapfst.pxd":309
* cdef void _invert(self) except *
*
* cdef void _minimize(self, float delta=?, bool allow_nondet=?) except * # <<<<<<<<<<<<<<
bool allow_nondet;
};
-/* "pywrapfst.pxd":313
+/* "pywrapfst.pxd":315
* cpdef int64 num_states(self)
*
* cdef void _project(self, bool project_output=?) except * # <<<<<<<<<<<<<<
bool project_output;
};
-/* "pywrapfst.pxd":315
+/* "pywrapfst.pxd":317
* cdef void _project(self, bool project_output=?) except *
*
* cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except * # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":317
+/* "pywrapfst.pxd":319
* cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except *
*
* cdef void _push(self, float delta=?, bool remove_total_weight=?, # <<<<<<<<<<<<<<
bool to_final;
};
-/* "pywrapfst.pxd":320
+/* "pywrapfst.pxd":322
* bool to_final=?) except *
*
* cdef void _relabel_pairs(self, ipairs=?, opairs=?) except * # <<<<<<<<<<<<<<
PyObject *opairs;
};
-/* "pywrapfst.pxd":322
+/* "pywrapfst.pxd":324
* cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *
*
* cdef void _relabel_tables(self, _SymbolTable old_isymbols=?, # <<<<<<<<<<<<<<
bool attach_new_osymbols;
};
-/* "pywrapfst.pxd":332
+/* "pywrapfst.pxd":334
* cdef void _reserve_states(self, int64 n) except *
*
* cdef void _reweight(self, potentials, bool to_final=?) except * # <<<<<<<<<<<<<<
bool to_final;
};
-/* "pywrapfst.pxd":334
+/* "pywrapfst.pxd":336
* cdef void _reweight(self, potentials, bool to_final=?) except *
*
* cdef void _rmepsilon(self, queue_type=?, bool connect=?, weight=?, # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":337
+/* "pywrapfst.pxd":339
* int64 nstate=?, float delta=?) except *
*
* cdef void _set_final(self, int64 state, weight=?) except * # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":361
+/* "pywrapfst.pxd":363
* cdef _Fst _init_XFst(FstClass_ptr tfst)
*
* cdef _MutableFst _create_Fst(arc_type=?) # <<<<<<<<<<<<<<
PyObject *arc_type;
};
-/* "pywrapfst.pxd":444
+/* "pywrapfst.pxd":446
*
*
* cdef _Fst _map(_Fst ifst, float delta=?, map_type=?, double power=?, weight=?) # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":446
+/* "pywrapfst.pxd":448
* cdef _Fst _map(_Fst ifst, float delta=?, map_type=?, double power=?, weight=?)
*
* cpdef _Fst arcmap(_Fst ifst, float delta=?, map_type=?, double power=?, # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":449
+/* "pywrapfst.pxd":451
* weight=?)
*
* cpdef _MutableFst compose(_Fst ifst1, _Fst ifst2, compose_filter=?, # <<<<<<<<<<<<<<
bool connect;
};
-/* "pywrapfst.pxd":452
+/* "pywrapfst.pxd":454
* bool connect=?)
*
* cpdef _Fst convert(_Fst ifst, fst_type=?) # <<<<<<<<<<<<<<
PyObject *fst_type;
};
-/* "pywrapfst.pxd":454
+/* "pywrapfst.pxd":456
* cpdef _Fst convert(_Fst ifst, fst_type=?)
*
* cpdef _MutableFst determinize(_Fst ifst, float delta=?, det_type=?, # <<<<<<<<<<<<<<
bool increment_subsequential_label;
};
-/* "pywrapfst.pxd":458
+/* "pywrapfst.pxd":460
* weight=?, bool increment_subsequential_label=?)
*
* cpdef _MutableFst difference(_Fst ifst1, _Fst ifst2, compose_filter=?, # <<<<<<<<<<<<<<
bool connect;
};
-/* "pywrapfst.pxd":461
+/* "pywrapfst.pxd":463
* bool connect=?)
*
* cpdef _MutableFst disambiguate(_Fst ifst, float delta=?, int64 nstate=?, # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":464
+/* "pywrapfst.pxd":466
* int64 subsequential_label=?, weight=?)
*
* cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=?) # <<<<<<<<<<<<<<
bool eps_norm_output;
};
-/* "pywrapfst.pxd":466
+/* "pywrapfst.pxd":468
* cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=?)
*
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=?) # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":468
+/* "pywrapfst.pxd":470
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=?)
*
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=?) except * # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":470
+/* "pywrapfst.pxd":472
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=?) except *
*
* cpdef _MutableFst intersect(_Fst ifst1, _Fst ifst2, compose_filter=?, # <<<<<<<<<<<<<<
bool connect;
};
-/* "pywrapfst.pxd":473
+/* "pywrapfst.pxd":475
* bool connect=?)
*
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=?) # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":475
+/* "pywrapfst.pxd":477
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=?)
*
* cpdef _MutableFst prune(_Fst ifst, float delta=?, int64 nstate=?, # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":478
+/* "pywrapfst.pxd":480
* weight=?)
*
* cpdef _MutableFst push(_Fst ifst, float delta=?, bool push_weights=?, # <<<<<<<<<<<<<<
bool to_final;
};
-/* "pywrapfst.pxd":482
+/* "pywrapfst.pxd":484
* bool remove_total_weight=?, bool to_final=?)
*
* cpdef bool randequivalent(_Fst ifst1, _Fst ifst2, int32 npath=?, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int32 max_length;
};
-/* "pywrapfst.pxd":486
+/* "pywrapfst.pxd":488
* int32 max_length=?) except *
*
* cpdef _MutableFst randgen(_Fst ifst, int32 npath=?, time_t seed=?, # <<<<<<<<<<<<<<
bool weighted;
};
-/* "pywrapfst.pxd":493
+/* "pywrapfst.pxd":495
* bool epsilon_on_replace) except *
*
* cpdef _MutableFst replace(pairs, call_arc_labeling=?, return_arc_labeling=?, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int64 return_label;
};
-/* "pywrapfst.pxd":496
+/* "pywrapfst.pxd":498
* bool epsilon_on_replace=?, int64 return_label=?)
*
* cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=?) # <<<<<<<<<<<<<<
bool require_superinitial;
};
-/* "pywrapfst.pxd":498
+/* "pywrapfst.pxd":500
* cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=?)
*
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, float delta=?, # <<<<<<<<<<<<<<
bool reverse;
};
-/* "pywrapfst.pxd":502
+/* "pywrapfst.pxd":504
* bool reverse=?) except *
*
* cpdef _MutableFst shortestpath(_Fst ifst, float delta=?, int32 nshortest=?, # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":371
+/* "pywrapfst.pxd":373
*
*
* cdef class Arc(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":381
+/* "pywrapfst.pxd":383
*
*
* cdef class ArcIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":403
+/* "pywrapfst.pxd":405
*
*
* cdef class MutableArcIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":427
+/* "pywrapfst.pxd":429
*
*
* cdef class StateIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":514
+/* "pywrapfst.pxd":516
*
*
* cdef class Compiler(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":535
+/* "pywrapfst.pxd":537
* # FarReader.
*
* cdef class FarReader(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":560
+/* "pywrapfst.pxd":562
* # FarWriter.
*
* cdef class FarWriter(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pyx":3118
+/* "pywrapfst.pyx":3130
*
* # Magic method used to get a Pythonic Iterator API out of the C++ API
* def __iter__(self): # <<<<<<<<<<<<<<
void (*_check_mutating_imethod)(struct __pyx_obj_9pywrapfst__MutableFst *);
void (*_add_arc)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64, struct __pyx_obj_9pywrapfst_Arc *);
__pyx_t_10basictypes_int64 (*add_state)(struct __pyx_obj_9pywrapfst__MutableFst *, int __pyx_skip_dispatch);
+ void (*add_states)(struct __pyx_obj_9pywrapfst__MutableFst *, size_t, int __pyx_skip_dispatch);
void (*_arcsort)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort *__pyx_optional_args);
void (*_closure)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure *__pyx_optional_args);
void (*_concat)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst__Fst *);
static struct __pyx_vtabstruct_9pywrapfst__MutableFst *__pyx_vtabptr_9pywrapfst__MutableFst;
-/* "pywrapfst.pyx":2920
+/* "pywrapfst.pyx":2932
*
*
* cdef class Arc(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Arc *__pyx_vtabptr_9pywrapfst_Arc;
-/* "pywrapfst.pyx":2987
+/* "pywrapfst.pyx":2999
*
*
* cdef class ArcIterator(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_ArcIterator *__pyx_vtabptr_9pywrapfst_ArcIterator;
-/* "pywrapfst.pyx":3098
+/* "pywrapfst.pyx":3110
*
*
* cdef class MutableArcIterator(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *__pyx_vtabptr_9pywrapfst_MutableArcIterator;
-/* "pywrapfst.pyx":3218
+/* "pywrapfst.pyx":3230
*
*
* cdef class StateIterator(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_StateIterator *__pyx_vtabptr_9pywrapfst_StateIterator;
-/* "pywrapfst.pyx":4119
+/* "pywrapfst.pyx":4133
*
*
* cdef class Compiler(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Compiler *__pyx_vtabptr_9pywrapfst_Compiler;
-/* "pywrapfst.pyx":4249
+/* "pywrapfst.pyx":4263
*
*
* cdef class FarReader(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_FarReader *__pyx_vtabptr_9pywrapfst_FarReader;
-/* "pywrapfst.pyx":4396
+/* "pywrapfst.pyx":4410
*
*
* cdef class FarWriter(object): # <<<<<<<<<<<<<<
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
__Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
-static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
static void __pyx_f_9pywrapfst_11_MutableFst__check_mutating_imethod(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__add_arc(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc); /* proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_add_state(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
+static void __pyx_f_9pywrapfst_11_MutableFst_add_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, size_t __pyx_v_n, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__closure(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__concat(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto*/
static const char __pyx_k_TOP_SORTED[] = "TOP_SORTED";
static const char __pyx_k_UNWEIGHTED[] = "UNWEIGHTED";
static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_add_states[] = "add_states";
static const char __pyx_k_add_symbol[] = "add_symbol";
static const char __pyx_k_functional[] = "functional";
static const char __pyx_k_max_length[] = "max_length";
static PyObject *__pyx_n_s_acceptor;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_state;
+static PyObject *__pyx_n_s_add_states;
static PyObject *__pyx_n_s_add_symbol;
static PyObject *__pyx_n_s_add_table;
static PyObject *__pyx_n_s_allow_negative_labels;
static PyObject *__pyx_pf_9pywrapfst_4_Fst_46write_to_string(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_add_arc(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_2add_state(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_4arcsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_sort_type); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_6closure(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_closure_plus); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_8concat(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_10connect(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_12decode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_14delete_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_16delete_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_states); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_18encode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_20invert(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_22minimize(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_allow_nondet); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_24mutable_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_30num_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_32project(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_project_output); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_34prune(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_36push(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_remove_total_weight, bool __pyx_v_to_final); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_38relabel_pairs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_ipairs, PyObject *__pyx_v_opairs); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_42reserve_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_44reserve_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_n); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reweight(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, bool __pyx_v_to_final); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, __pyx_t_10basictypes_int64 __pyx_v_nstate, float __pyx_v_delta); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_50set_final(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, PyObject *__pyx_v_weight); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_52set_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_54set_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_56set_properties(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_props, __pyx_t_10basictypes_uint64 __pyx_v_mask); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_58set_start(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_60topsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_62union(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_4add_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, size_t __pyx_v_n); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_6arcsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_sort_type); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_8closure(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_closure_plus); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_10concat(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_12connect(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_14decode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_16delete_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_18delete_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_states); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_20encode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_22invert(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_24minimize(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_allow_nondet); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_30mutable_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_32num_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_34project(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_project_output); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_36prune(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_38push(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_remove_total_weight, bool __pyx_v_to_final); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_40relabel_pairs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_ipairs, PyObject *__pyx_v_opairs); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_42relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_44reserve_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reserve_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_n); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48reweight(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, bool __pyx_v_to_final); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_50rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, __pyx_t_10basictypes_int64 __pyx_v_nstate, float __pyx_v_delta); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_52set_final(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, PyObject *__pyx_v_weight); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_54set_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_56set_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_58set_properties(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_props, __pyx_t_10basictypes_uint64 __pyx_v_mask); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_60set_start(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_62topsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_64union(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto */
static PyObject *__pyx_pf_9pywrapfst_14_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_9pywrapfst_16_read_Fst_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst___new__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_arc_type); /* proto */
* self._check_mutating_imethod()
* return result # <<<<<<<<<<<<<<
*
- * cdef void _arcsort(self, sort_type=b"ilabel") except *:
+ * cpdef void add_states(self, size_t n) except *:
*/
__pyx_r = __pyx_v_result;
goto __pyx_L0;
/* "pywrapfst.pyx":1864
* return result
*
+ * cpdef void add_states(self, size_t n) except *: # <<<<<<<<<<<<<<
+ * """
+ * add_states(self, n)
+ */
+
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_5add_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
+static void __pyx_f_9pywrapfst_11_MutableFst_add_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, size_t __pyx_v_n, int __pyx_skip_dispatch) {
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannySetupContext("add_states", 0);
+ /* Check if called by wrapper */
+ if (unlikely(__pyx_skip_dispatch)) ;
+ /* Check if overridden in Python */
+ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
+ static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
+ if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
+ PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
+ #endif
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1864, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11_MutableFst_5add_states)) {
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1864, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1864, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
+ __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
+ __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
+ if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
+ __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
+ }
+ #endif
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
+ }
+ #endif
+ }
+
+ /* "pywrapfst.pyx":1873
+ * n: The number of states to add.
+ * """
+ * self._mfst.get().AddStates(n) # <<<<<<<<<<<<<<
+ * self._check_mutating_imethod()
+ *
+ */
+ if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
+ __PYX_ERR(0, 1873, __pyx_L1_error)
+ }
+ __pyx_v_self->_mfst.get()->AddStates(__pyx_v_n);
+
+ /* "pywrapfst.pyx":1874
+ * """
+ * self._mfst.get().AddStates(n)
+ * self._check_mutating_imethod() # <<<<<<<<<<<<<<
+ *
+ * cdef void _arcsort(self, sort_type=b"ilabel") except *:
+ */
+ if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
+ __PYX_ERR(0, 1874, __pyx_L1_error)
+ }
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1874, __pyx_L1_error)
+
+ /* "pywrapfst.pyx":1864
+ * return result
+ *
+ * cpdef void add_states(self, size_t n) except *: # <<<<<<<<<<<<<<
+ * """
+ * add_states(self, n)
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("pywrapfst._MutableFst.add_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_5add_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_4add_states[] = "\n add_states(self, n)\n\n Adds n new states to the FST.\n\n Args:\n n: The number of states to add.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_5add_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
+ size_t __pyx_v_n;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("add_states (wrapper)", 0);
+ assert(__pyx_arg_n); {
+ __pyx_v_n = __Pyx_PyInt_As_size_t(__pyx_arg_n); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1864, __pyx_L3_error)
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("pywrapfst._MutableFst.add_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_4add_states(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((size_t)__pyx_v_n));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_4add_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, size_t __pyx_v_n) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("add_states", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_f_9pywrapfst_11_MutableFst_add_states(__pyx_v_self, __pyx_v_n, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1864, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1864, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("pywrapfst._MutableFst.add_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "pywrapfst.pyx":1876
+ * self._check_mutating_imethod()
+ *
* cdef void _arcsort(self, sort_type=b"ilabel") except *: # <<<<<<<<<<<<<<
* cdef fst.ArcSortType sort_type_enum
* if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
}
}
- /* "pywrapfst.pyx":1866
+ /* "pywrapfst.pyx":1878
* cdef void _arcsort(self, sort_type=b"ilabel") except *:
* cdef fst.ArcSortType sort_type_enum
* if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)): # <<<<<<<<<<<<<<
* raise FstArgError("Unknown sort type {!r}".format(sort_type))
* fst.ArcSort(self._mfst.get(), sort_type_enum)
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_sort_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1866, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_sort_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1878, __pyx_L1_error)
__pyx_t_2 = ((!(fst::script::GetArcSortType(__pyx_t_1, (&__pyx_v_sort_type_enum)) != 0)) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1867
+ /* "pywrapfst.pyx":1879
* cdef fst.ArcSortType sort_type_enum
* if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
* raise FstArgError("Unknown sort type {!r}".format(sort_type)) # <<<<<<<<<<<<<<
* fst.ArcSort(self._mfst.get(), sort_type_enum)
* self._check_mutating_imethod()
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1867, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1879, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_sort_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1867, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_sort_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1879, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
__pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_sort_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_sort_type);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1867, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1879, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
__pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1867, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1879, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 1867, __pyx_L1_error)
+ __PYX_ERR(0, 1879, __pyx_L1_error)
- /* "pywrapfst.pyx":1866
+ /* "pywrapfst.pyx":1878
* cdef void _arcsort(self, sort_type=b"ilabel") except *:
* cdef fst.ArcSortType sort_type_enum
* if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1868
+ /* "pywrapfst.pyx":1880
* if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
* raise FstArgError("Unknown sort type {!r}".format(sort_type))
* fst.ArcSort(self._mfst.get(), sort_type_enum) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 1868, __pyx_L1_error)
+ __PYX_ERR(0, 1880, __pyx_L1_error)
}
fst::script::ArcSort(__pyx_v_self->_mfst.get(), __pyx_v_sort_type_enum);
- /* "pywrapfst.pyx":1869
+ /* "pywrapfst.pyx":1881
* raise FstArgError("Unknown sort type {!r}".format(sort_type))
* fst.ArcSort(self._mfst.get(), sort_type_enum)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1869, __pyx_L1_error)
+ __PYX_ERR(0, 1881, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1869, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1881, __pyx_L1_error)
- /* "pywrapfst.pyx":1864
- * return result
+ /* "pywrapfst.pyx":1876
+ * self._check_mutating_imethod()
*
* cdef void _arcsort(self, sort_type=b"ilabel") except *: # <<<<<<<<<<<<<<
* cdef fst.ArcSortType sort_type_enum
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1871
+/* "pywrapfst.pyx":1883
* self._check_mutating_imethod()
*
* def arcsort(self, sort_type=b"ilabel"): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_5arcsort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_4arcsort[] = "\n arcsort(self, sort_type=\"ilabel\")\n\n Sorts arcs leaving each state of the FST.\n\n This operation destructively sorts arcs leaving each state using either\n input or output labels.\n\n Args:\n sort_type: Either \"ilabel\" (sort arcs according to input labels) or\n \"olabel\" (sort arcs according to output labels).\n\n Returns:\n self.\n\n Raises:\n FstArgError: Unknown sort type.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_5arcsort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_7arcsort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_6arcsort[] = "\n arcsort(self, sort_type=\"ilabel\")\n\n Sorts arcs leaving each state of the FST.\n\n This operation destructively sorts arcs leaving each state using either\n input or output labels.\n\n Args:\n sort_type: Either \"ilabel\" (sort arcs according to input labels) or\n \"olabel\" (sort arcs according to output labels).\n\n Returns:\n self.\n\n Raises:\n FstArgError: Unknown sort type.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_7arcsort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_sort_type = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 1871, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 1883, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("arcsort", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1871, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("arcsort", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1883, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_4arcsort(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_sort_type);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_6arcsort(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_sort_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_4arcsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_sort_type) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_6arcsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_sort_type) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort __pyx_t_1;
__Pyx_RefNannySetupContext("arcsort", 0);
- /* "pywrapfst.pyx":1890
+ /* "pywrapfst.pyx":1902
* FstArgError: Unknown sort type.
* """
* self._arcsort(sort_type) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arcsort");
- __PYX_ERR(0, 1890, __pyx_L1_error)
+ __PYX_ERR(0, 1902, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 1;
__pyx_t_1.sort_type = __pyx_v_sort_type;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_arcsort(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1890, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_arcsort(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1902, __pyx_L1_error)
- /* "pywrapfst.pyx":1891
+ /* "pywrapfst.pyx":1903
* """
* self._arcsort(sort_type)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1871
+ /* "pywrapfst.pyx":1883
* self._check_mutating_imethod()
*
* def arcsort(self, sort_type=b"ilabel"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1893
+/* "pywrapfst.pyx":1905
* return self
*
* cdef void _closure(self, bool closure_plus=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1894
+ /* "pywrapfst.pyx":1906
*
* cdef void _closure(self, bool closure_plus=False) except *:
* fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 1894, __pyx_L1_error)
+ __PYX_ERR(0, 1906, __pyx_L1_error)
}
fst::script::Closure(__pyx_v_self->_mfst.get(), fst::script::GetClosureType(__pyx_v_closure_plus));
- /* "pywrapfst.pyx":1895
+ /* "pywrapfst.pyx":1907
* cdef void _closure(self, bool closure_plus=False) except *:
* fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1895, __pyx_L1_error)
+ __PYX_ERR(0, 1907, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1895, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1907, __pyx_L1_error)
- /* "pywrapfst.pyx":1893
+ /* "pywrapfst.pyx":1905
* return self
*
* cdef void _closure(self, bool closure_plus=False) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1897
+/* "pywrapfst.pyx":1909
* self._check_mutating_imethod()
*
* def closure(self, bool closure_plus=False): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_7closure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_6closure[] = "\n closure(self, closure_plus=False)\n\n Computes concatenative closure.\n\n This operation destructively converts the FST to its concatenative closure.\n If A transduces string x to y with weight a, then the closure transduces x\n to y with weight a, xx to yy with weight a \\otimes a, xxx to yyy with weight\n a \\otimes a \\otimes a, and so on. The empty string is also transduced to\n itself with semiring One if `closure_plus` is False.\n\n Args:\n closure_plus: If False, do not accept the empty string.\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_7closure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_9closure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_8closure[] = "\n closure(self, closure_plus=False)\n\n Computes concatenative closure.\n\n This operation destructively converts the FST to its concatenative closure.\n If A transduces string x to y with weight a, then the closure transduces x\n to y with weight a, xx to yy with weight a \\otimes a, xxx to yyy with weight\n a \\otimes a \\otimes a, and so on. The empty string is also transduced to\n itself with semiring One if `closure_plus` is False.\n\n Args:\n closure_plus: If False, do not accept the empty string.\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_9closure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
bool __pyx_v_closure_plus;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "closure") < 0)) __PYX_ERR(0, 1897, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "closure") < 0)) __PYX_ERR(0, 1909, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
}
if (values[0]) {
- __pyx_v_closure_plus = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_closure_plus == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1897, __pyx_L3_error)
+ __pyx_v_closure_plus = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_closure_plus == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1909, __pyx_L3_error)
} else {
__pyx_v_closure_plus = ((bool)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("closure", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1897, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("closure", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1909, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.closure", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_6closure(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_closure_plus);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_8closure(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_closure_plus);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_6closure(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_closure_plus) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_8closure(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_closure_plus) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure __pyx_t_1;
__Pyx_RefNannySetupContext("closure", 0);
- /* "pywrapfst.pyx":1915
+ /* "pywrapfst.pyx":1927
* self.
* """
* self._closure(closure_plus) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_closure");
- __PYX_ERR(0, 1915, __pyx_L1_error)
+ __PYX_ERR(0, 1927, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 1;
__pyx_t_1.closure_plus = __pyx_v_closure_plus;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_closure(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1915, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_closure(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L1_error)
- /* "pywrapfst.pyx":1916
+ /* "pywrapfst.pyx":1928
* """
* self._closure(closure_plus)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1897
+ /* "pywrapfst.pyx":1909
* self._check_mutating_imethod()
*
* def closure(self, bool closure_plus=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1918
+/* "pywrapfst.pyx":1930
* return self
*
* cdef void _concat(self, _Fst ifst) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_concat", 0);
- /* "pywrapfst.pyx":1919
+ /* "pywrapfst.pyx":1931
*
* cdef void _concat(self, _Fst ifst) except *:
* fst.Concat(self._mfst.get(), deref(ifst._fst)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 1919, __pyx_L1_error)
+ __PYX_ERR(0, 1931, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1919, __pyx_L1_error)
+ __PYX_ERR(0, 1931, __pyx_L1_error)
}
fst::script::Concat(__pyx_v_self->_mfst.get(), (*__pyx_v_ifst->_fst));
- /* "pywrapfst.pyx":1920
+ /* "pywrapfst.pyx":1932
* cdef void _concat(self, _Fst ifst) except *:
* fst.Concat(self._mfst.get(), deref(ifst._fst))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1920, __pyx_L1_error)
+ __PYX_ERR(0, 1932, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1920, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1932, __pyx_L1_error)
- /* "pywrapfst.pyx":1918
+ /* "pywrapfst.pyx":1930
* return self
*
* cdef void _concat(self, _Fst ifst) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1922
+/* "pywrapfst.pyx":1934
* self._check_mutating_imethod()
*
* def concat(self, _Fst ifst): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_9concat(PyObject *__pyx_v_self, PyObject *__pyx_v_ifst); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_8concat[] = "\n concat(self, ifst)\n\n Computes the concatenation (product) of two FSTs.\n\n This operation destructively concatenates the FST with a second FST. If A\n transduces string x to y with weight a and B transduces string w to v with\n weight b, then their concatenation transduces string xw to yv with weight a\n \\otimes b.\n\n Args:\n ifst: The second input FST.\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_9concat(PyObject *__pyx_v_self, PyObject *__pyx_v_ifst) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_11concat(PyObject *__pyx_v_self, PyObject *__pyx_v_ifst); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_10concat[] = "\n concat(self, ifst)\n\n Computes the concatenation (product) of two FSTs.\n\n This operation destructively concatenates the FST with a second FST. If A\n transduces string x to y with weight a and B transduces string w to v with\n weight b, then their concatenation transduces string xw to yv with weight a\n \\otimes b.\n\n Args:\n ifst: The second input FST.\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_11concat(PyObject *__pyx_v_self, PyObject *__pyx_v_ifst) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("concat (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 1922, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_8concat(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_ifst));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 1934, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_10concat(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_ifst));
/* function exit code */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_8concat(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_10concat(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("concat", 0);
- /* "pywrapfst.pyx":1939
+ /* "pywrapfst.pyx":1951
* self.
* """
* self._concat(ifst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_concat");
- __PYX_ERR(0, 1939, __pyx_L1_error)
+ __PYX_ERR(0, 1951, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_concat(__pyx_v_self, __pyx_v_ifst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1939, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_concat(__pyx_v_self, __pyx_v_ifst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1951, __pyx_L1_error)
- /* "pywrapfst.pyx":1940
+ /* "pywrapfst.pyx":1952
* """
* self._concat(ifst)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1922
+ /* "pywrapfst.pyx":1934
* self._check_mutating_imethod()
*
* def concat(self, _Fst ifst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1942
+/* "pywrapfst.pyx":1954
* return self
*
* cdef void _connect(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_connect", 0);
- /* "pywrapfst.pyx":1943
+ /* "pywrapfst.pyx":1955
*
* cdef void _connect(self) except *:
* fst.Connect(self._mfst.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 1943, __pyx_L1_error)
+ __PYX_ERR(0, 1955, __pyx_L1_error)
}
fst::script::Connect(__pyx_v_self->_mfst.get());
- /* "pywrapfst.pyx":1944
+ /* "pywrapfst.pyx":1956
* cdef void _connect(self) except *:
* fst.Connect(self._mfst.get())
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1944, __pyx_L1_error)
+ __PYX_ERR(0, 1956, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1944, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1956, __pyx_L1_error)
- /* "pywrapfst.pyx":1942
+ /* "pywrapfst.pyx":1954
* return self
*
* cdef void _connect(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1946
+/* "pywrapfst.pyx":1958
* self._check_mutating_imethod()
*
* def connect(self): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_11connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_10connect[] = "\n connect(self)\n\n Removes unsuccessful paths.\n\n This operation destructively trims the FST, removing states and arcs that\n are not part of any successful path.\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_11connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_13connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_12connect[] = "\n connect(self)\n\n Removes unsuccessful paths.\n\n This operation destructively trims the FST, removing states and arcs that\n are not part of any successful path.\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_13connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("connect (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_10connect(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_12connect(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_10connect(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_12connect(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("connect", 0);
- /* "pywrapfst.pyx":1958
+ /* "pywrapfst.pyx":1970
* self.
* """
* self._connect() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_connect");
- __PYX_ERR(0, 1958, __pyx_L1_error)
+ __PYX_ERR(0, 1970, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_connect(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1958, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_connect(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1970, __pyx_L1_error)
- /* "pywrapfst.pyx":1959
+ /* "pywrapfst.pyx":1971
* """
* self._connect()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1946
+ /* "pywrapfst.pyx":1958
* self._check_mutating_imethod()
*
* def connect(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1961
+/* "pywrapfst.pyx":1973
* return self
*
* cdef void _decode(self, EncodeMapper encoder) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_decode", 0);
- /* "pywrapfst.pyx":1962
+ /* "pywrapfst.pyx":1974
*
* cdef void _decode(self, EncodeMapper encoder) except *:
* fst.Decode(self._mfst.get(), deref(encoder._encoder)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 1962, __pyx_L1_error)
+ __PYX_ERR(0, 1974, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_encoder) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
- __PYX_ERR(0, 1962, __pyx_L1_error)
+ __PYX_ERR(0, 1974, __pyx_L1_error)
}
fst::script::Decode(__pyx_v_self->_mfst.get(), (*__pyx_v_encoder->_encoder));
- /* "pywrapfst.pyx":1963
+ /* "pywrapfst.pyx":1975
* cdef void _decode(self, EncodeMapper encoder) except *:
* fst.Decode(self._mfst.get(), deref(encoder._encoder))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1963, __pyx_L1_error)
+ __PYX_ERR(0, 1975, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1963, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1975, __pyx_L1_error)
- /* "pywrapfst.pyx":1961
+ /* "pywrapfst.pyx":1973
* return self
*
* cdef void _decode(self, EncodeMapper encoder) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1965
+/* "pywrapfst.pyx":1977
* self._check_mutating_imethod()
*
* def decode(self, EncodeMapper encoder): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_13decode(PyObject *__pyx_v_self, PyObject *__pyx_v_encoder); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_12decode[] = "\n decode(self, encoder)\n\n Decodes encoded labels and/or weights.\n\n This operation reverses the encoding performed by `encode`.\n\n Args:\n encoder: An EncodeMapper object used to encode the FST.\n\n Returns:\n self.\n\n See also: `encode`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_13decode(PyObject *__pyx_v_self, PyObject *__pyx_v_encoder) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_15decode(PyObject *__pyx_v_self, PyObject *__pyx_v_encoder); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_14decode[] = "\n decode(self, encoder)\n\n Decodes encoded labels and/or weights.\n\n This operation reverses the encoding performed by `encode`.\n\n Args:\n encoder: An EncodeMapper object used to encode the FST.\n\n Returns:\n self.\n\n See also: `encode`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_15decode(PyObject *__pyx_v_self, PyObject *__pyx_v_encoder) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("decode (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 1965, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_12decode(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_encoder));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 1977, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_14decode(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_encoder));
/* function exit code */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_12decode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_14decode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("decode", 0);
- /* "pywrapfst.pyx":1981
+ /* "pywrapfst.pyx":1993
* See also: `encode`.
* """
* self._decode(encoder) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_decode");
- __PYX_ERR(0, 1981, __pyx_L1_error)
+ __PYX_ERR(0, 1993, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_decode(__pyx_v_self, __pyx_v_encoder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1981, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_decode(__pyx_v_self, __pyx_v_encoder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1993, __pyx_L1_error)
- /* "pywrapfst.pyx":1982
+ /* "pywrapfst.pyx":1994
* """
* self._decode(encoder)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1965
+ /* "pywrapfst.pyx":1977
* self._check_mutating_imethod()
*
* def decode(self, EncodeMapper encoder): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1984
+/* "pywrapfst.pyx":1996
* return self
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1985
+ /* "pywrapfst.pyx":1997
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
* if not (self._mfst.get().DeleteArcs(state, n) if n else # <<<<<<<<<<<<<<
if ((__pyx_v_n != 0)) {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 1985, __pyx_L1_error)
+ __PYX_ERR(0, 1997, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state, __pyx_v_n);
} else {
- /* "pywrapfst.pyx":1986
+ /* "pywrapfst.pyx":1998
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
* if not (self._mfst.get().DeleteArcs(state, n) if n else
* self._mfst.get().DeleteArcs(state)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 1986, __pyx_L1_error)
+ __PYX_ERR(0, 1998, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state);
}
- /* "pywrapfst.pyx":1985
+ /* "pywrapfst.pyx":1997
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
* if not (self._mfst.get().DeleteArcs(state, n) if n else # <<<<<<<<<<<<<<
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1987
+ /* "pywrapfst.pyx":1999
* if not (self._mfst.get().DeleteArcs(state, n) if n else
* self._mfst.get().DeleteArcs(state)):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1987, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1999, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1987, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1999, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 1987, __pyx_L1_error)
+ __PYX_ERR(0, 1999, __pyx_L1_error)
- /* "pywrapfst.pyx":1985
+ /* "pywrapfst.pyx":1997
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
* if not (self._mfst.get().DeleteArcs(state, n) if n else # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1988
+ /* "pywrapfst.pyx":2000
* self._mfst.get().DeleteArcs(state)):
* raise FstIndexError("State index out of range")
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1988, __pyx_L1_error)
+ __PYX_ERR(0, 2000, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1988, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2000, __pyx_L1_error)
- /* "pywrapfst.pyx":1984
+ /* "pywrapfst.pyx":1996
* return self
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1990
+/* "pywrapfst.pyx":2002
* self._check_mutating_imethod()
*
* def delete_arcs(self, int64 state, size_t n=0): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_15delete_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_14delete_arcs[] = "\n delete_arcs(self, state, n=0)\n\n Deletes arcs leaving a particular state.\n\n Args:\n state: The integer index of a state.\n n: An optional argument indicating how many arcs to be deleted. If this\n argument is omitted or passed as zero, all arcs from this state are\n deleted.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n\n See also: `delete_states`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_15delete_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_17delete_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_16delete_arcs[] = "\n delete_arcs(self, state, n=0)\n\n Deletes arcs leaving a particular state.\n\n Args:\n state: The integer index of a state.\n n: An optional argument indicating how many arcs to be deleted. If this\n argument is omitted or passed as zero, all arcs from this state are\n deleted.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n\n See also: `delete_states`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_17delete_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__pyx_t_10basictypes_int64 __pyx_v_state;
size_t __pyx_v_n;
PyObject *__pyx_r = 0;
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_arcs") < 0)) __PYX_ERR(0, 1990, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_arcs") < 0)) __PYX_ERR(0, 2002, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1990, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2002, __pyx_L3_error)
if (values[1]) {
- __pyx_v_n = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1990, __pyx_L3_error)
+ __pyx_v_n = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2002, __pyx_L3_error)
} else {
__pyx_v_n = ((size_t)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("delete_arcs", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1990, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("delete_arcs", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2002, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.delete_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_14delete_arcs(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_n);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_16delete_arcs(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_n);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_14delete_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_16delete_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_arcs __pyx_t_1;
__Pyx_RefNannySetupContext("delete_arcs", 0);
- /* "pywrapfst.pyx":2010
+ /* "pywrapfst.pyx":2022
* See also: `delete_states`.
* """
* self._delete_arcs(state, n) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_delete_arcs");
- __PYX_ERR(0, 2010, __pyx_L1_error)
+ __PYX_ERR(0, 2022, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 1;
__pyx_t_1.n = __pyx_v_n;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_delete_arcs(__pyx_v_self, __pyx_v_state, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2010, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_delete_arcs(__pyx_v_self, __pyx_v_state, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L1_error)
- /* "pywrapfst.pyx":2011
+ /* "pywrapfst.pyx":2023
* """
* self._delete_arcs(state, n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1990
+ /* "pywrapfst.pyx":2002
* self._check_mutating_imethod()
*
* def delete_arcs(self, int64 state, size_t n=0): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2013
+/* "pywrapfst.pyx":2025
* return self
*
* cdef void _delete_states(self, states=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2015
+ /* "pywrapfst.pyx":2027
* cdef void _delete_states(self, states=None) except *:
* # Only the former signature has a possible indexing failure.
* if states: # <<<<<<<<<<<<<<
* if not self._mfst.get().DeleteStates(<const vector[int64]> states):
* raise FstIndexError("State index out of range")
*/
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_states); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2015, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_states); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2027, __pyx_L1_error)
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2016
+ /* "pywrapfst.pyx":2028
* # Only the former signature has a possible indexing failure.
* if states:
* if not self._mfst.get().DeleteStates(<const vector[int64]> states): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2016, __pyx_L1_error)
+ __PYX_ERR(0, 2028, __pyx_L1_error)
}
- __pyx_t_2 = __pyx_convert_vector_from_py___pyx_t_10basictypes_int64(__pyx_v_states); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2016, __pyx_L1_error)
+ __pyx_t_2 = __pyx_convert_vector_from_py___pyx_t_10basictypes_int64(__pyx_v_states); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2028, __pyx_L1_error)
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->DeleteStates(((std::vector<__pyx_t_10basictypes_int64> const )__pyx_t_2)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2017
+ /* "pywrapfst.pyx":2029
* if states:
* if not self._mfst.get().DeleteStates(<const vector[int64]> states):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* else:
* self._mfst.get().DeleteStates()
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2017, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2029, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2017, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2029, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2017, __pyx_L1_error)
+ __PYX_ERR(0, 2029, __pyx_L1_error)
- /* "pywrapfst.pyx":2016
+ /* "pywrapfst.pyx":2028
* # Only the former signature has a possible indexing failure.
* if states:
* if not self._mfst.get().DeleteStates(<const vector[int64]> states): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2015
+ /* "pywrapfst.pyx":2027
* cdef void _delete_states(self, states=None) except *:
* # Only the former signature has a possible indexing failure.
* if states: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":2019
+ /* "pywrapfst.pyx":2031
* raise FstIndexError("State index out of range")
* else:
* self._mfst.get().DeleteStates() # <<<<<<<<<<<<<<
/*else*/ {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2019, __pyx_L1_error)
+ __PYX_ERR(0, 2031, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->DeleteStates();
}
__pyx_L3:;
- /* "pywrapfst.pyx":2020
+ /* "pywrapfst.pyx":2032
* else:
* self._mfst.get().DeleteStates()
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2020, __pyx_L1_error)
+ __PYX_ERR(0, 2032, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2020, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2032, __pyx_L1_error)
- /* "pywrapfst.pyx":2013
+ /* "pywrapfst.pyx":2025
* return self
*
* cdef void _delete_states(self, states=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2022
+/* "pywrapfst.pyx":2034
* self._check_mutating_imethod()
*
* def delete_states(self, states=None): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_17delete_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_16delete_states[] = "\n delete_states(self, states=None)\n\n Deletes states.\n\n Args:\n states: An optional iterable of integer indices of the states to be\n deleted. If this argument is omitted, all states are deleted.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n\n See also: `delete_arcs`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_17delete_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_19delete_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_18delete_states[] = "\n delete_states(self, states=None)\n\n Deletes states.\n\n Args:\n states: An optional iterable of integer indices of the states to be\n deleted. If this argument is omitted, all states are deleted.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n\n See also: `delete_arcs`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_19delete_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_states = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_states") < 0)) __PYX_ERR(0, 2022, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_states") < 0)) __PYX_ERR(0, 2034, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("delete_states", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2022, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("delete_states", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2034, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.delete_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_16delete_states(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_states);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_18delete_states(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_states);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_16delete_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_states) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_18delete_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_states) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_states __pyx_t_1;
__Pyx_RefNannySetupContext("delete_states", 0);
- /* "pywrapfst.pyx":2040
+ /* "pywrapfst.pyx":2052
* See also: `delete_arcs`.
* """
* self._delete_states(states) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_delete_states");
- __PYX_ERR(0, 2040, __pyx_L1_error)
+ __PYX_ERR(0, 2052, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 1;
__pyx_t_1.states = __pyx_v_states;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_delete_states(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2040, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_delete_states(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2052, __pyx_L1_error)
- /* "pywrapfst.pyx":2041
+ /* "pywrapfst.pyx":2053
* """
* self._delete_states(states)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2022
+ /* "pywrapfst.pyx":2034
* self._check_mutating_imethod()
*
* def delete_states(self, states=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2043
+/* "pywrapfst.pyx":2055
* return self
*
* cdef void _encode(self, EncodeMapper encoder) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_encode", 0);
- /* "pywrapfst.pyx":2044
+ /* "pywrapfst.pyx":2056
*
* cdef void _encode(self, EncodeMapper encoder) except *:
* fst.Encode(self._mfst.get(), encoder._encoder.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2044, __pyx_L1_error)
+ __PYX_ERR(0, 2056, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_encoder) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
- __PYX_ERR(0, 2044, __pyx_L1_error)
+ __PYX_ERR(0, 2056, __pyx_L1_error)
}
fst::script::Encode(__pyx_v_self->_mfst.get(), __pyx_v_encoder->_encoder.get());
- /* "pywrapfst.pyx":2045
+ /* "pywrapfst.pyx":2057
* cdef void _encode(self, EncodeMapper encoder) except *:
* fst.Encode(self._mfst.get(), encoder._encoder.get())
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2045, __pyx_L1_error)
+ __PYX_ERR(0, 2057, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2045, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2057, __pyx_L1_error)
- /* "pywrapfst.pyx":2043
+ /* "pywrapfst.pyx":2055
* return self
*
* cdef void _encode(self, EncodeMapper encoder) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2047
+/* "pywrapfst.pyx":2059
* self._check_mutating_imethod()
*
* def encode(self, EncodeMapper encoder): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_19encode(PyObject *__pyx_v_self, PyObject *__pyx_v_encoder); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_18encode[] = "\n encode(self, encoder)\n\n Encodes labels and/or weights.\n\n This operation allows for the representation of a weighted transducer as a\n weighted acceptor, an unweighted transducer, or an unweighted acceptor by\n considering the pair (input label, output label), the pair (input label,\n weight), or the triple (input label, output label, weight) as a single\n label. Applying this operation mutates the EncodeMapper argument, which\n can then be used to decode.\n\n Args:\n encoder: An EncodeMapper object to be used as the encoder.\n\n Returns:\n self.\n\n See also: `decode`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_19encode(PyObject *__pyx_v_self, PyObject *__pyx_v_encoder) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_21encode(PyObject *__pyx_v_self, PyObject *__pyx_v_encoder); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_20encode[] = "\n encode(self, encoder)\n\n Encodes labels and/or weights.\n\n This operation allows for the representation of a weighted transducer as a\n weighted acceptor, an unweighted transducer, or an unweighted acceptor by\n considering the pair (input label, output label), the pair (input label,\n weight), or the triple (input label, output label, weight) as a single\n label. Applying this operation mutates the EncodeMapper argument, which\n can then be used to decode.\n\n Args:\n encoder: An EncodeMapper object to be used as the encoder.\n\n Returns:\n self.\n\n See also: `decode`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_21encode(PyObject *__pyx_v_self, PyObject *__pyx_v_encoder) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("encode (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 2047, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_18encode(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_encoder));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 2059, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_20encode(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_encoder));
/* function exit code */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_18encode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_20encode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("encode", 0);
- /* "pywrapfst.pyx":2068
+ /* "pywrapfst.pyx":2080
* See also: `decode`.
* """
* self._encode(encoder) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encode");
- __PYX_ERR(0, 2068, __pyx_L1_error)
+ __PYX_ERR(0, 2080, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_encode(__pyx_v_self, __pyx_v_encoder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2068, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_encode(__pyx_v_self, __pyx_v_encoder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2080, __pyx_L1_error)
- /* "pywrapfst.pyx":2069
+ /* "pywrapfst.pyx":2081
* """
* self._encode(encoder)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2047
+ /* "pywrapfst.pyx":2059
* self._check_mutating_imethod()
*
* def encode(self, EncodeMapper encoder): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2071
+/* "pywrapfst.pyx":2083
* return self
*
* cdef void _invert(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_invert", 0);
- /* "pywrapfst.pyx":2072
+ /* "pywrapfst.pyx":2084
*
* cdef void _invert(self) except *:
* fst.Invert(self._mfst.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2072, __pyx_L1_error)
+ __PYX_ERR(0, 2084, __pyx_L1_error)
}
fst::script::Invert(__pyx_v_self->_mfst.get());
- /* "pywrapfst.pyx":2073
+ /* "pywrapfst.pyx":2085
* cdef void _invert(self) except *:
* fst.Invert(self._mfst.get())
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2073, __pyx_L1_error)
+ __PYX_ERR(0, 2085, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2073, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2085, __pyx_L1_error)
- /* "pywrapfst.pyx":2071
+ /* "pywrapfst.pyx":2083
* return self
*
* cdef void _invert(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2075
+/* "pywrapfst.pyx":2087
* self._check_mutating_imethod()
*
* def invert(self): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_21invert(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_20invert[] = "\n invert(self)\n\n Inverts the FST's transduction.\n\n This operation destructively inverts the FST's transduction by exchanging\n input and output labels.\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_21invert(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_23invert(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_22invert[] = "\n invert(self)\n\n Inverts the FST's transduction.\n\n This operation destructively inverts the FST's transduction by exchanging\n input and output labels.\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_23invert(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("invert (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_20invert(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_22invert(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_20invert(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_22invert(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("invert", 0);
- /* "pywrapfst.pyx":2087
+ /* "pywrapfst.pyx":2099
* self.
* """
* self._invert() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_invert");
- __PYX_ERR(0, 2087, __pyx_L1_error)
+ __PYX_ERR(0, 2099, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_invert(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2087, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_invert(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2099, __pyx_L1_error)
- /* "pywrapfst.pyx":2088
+ /* "pywrapfst.pyx":2100
* """
* self._invert()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2075
+ /* "pywrapfst.pyx":2087
* self._check_mutating_imethod()
*
* def invert(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2090
+/* "pywrapfst.pyx":2102
* return self
*
* cdef void _minimize(self, float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_11_MutableFst__minimize(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__minimize *__pyx_optional_args) {
float __pyx_v_delta = __pyx_k__11;
- /* "pywrapfst.pyx":2091
+ /* "pywrapfst.pyx":2103
*
* cdef void _minimize(self, float delta=fst.kShortestDelta,
* bool allow_nondet=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2093
+ /* "pywrapfst.pyx":2105
* bool allow_nondet=False) except *:
* # This runs in-place when the second argument is null.
* fst.Minimize(self._mfst.get(), NULL, delta, allow_nondet) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2093, __pyx_L1_error)
+ __PYX_ERR(0, 2105, __pyx_L1_error)
}
fst::script::Minimize(__pyx_v_self->_mfst.get(), NULL, __pyx_v_delta, __pyx_v_allow_nondet);
- /* "pywrapfst.pyx":2094
+ /* "pywrapfst.pyx":2106
* # This runs in-place when the second argument is null.
* fst.Minimize(self._mfst.get(), NULL, delta, allow_nondet)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2094, __pyx_L1_error)
+ __PYX_ERR(0, 2106, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2094, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2106, __pyx_L1_error)
- /* "pywrapfst.pyx":2090
+ /* "pywrapfst.pyx":2102
* return self
*
* cdef void _minimize(self, float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2096
+/* "pywrapfst.pyx":2108
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_23minimize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_22minimize[] = "\n minimize(self, delta=1e-6, allow_nondet=False)\n\n Minimizes the FST.\n\n This operation destructively performs the minimization of deterministic\n weighted automata and transducers. If the input FST A is an acceptor, this\n operation produces the minimal acceptor B equivalent to A, i.e. the\n acceptor with a minimal number of states that is equivalent to A. If the\n input FST A is a transducer, this operation internally builds an equivalent\n transducer with a minimal number of states. However, this minimality is\n obtained by allowing transition having strings of symbols as output labels,\n this known in the litterature as a real-time transducer. Such transducers\n are not directly supported by the library. This function will convert such\n transducer by expanding each string-labeled transition into a sequence of\n transitions. This will results in the creation of new states, hence losing\n the minimality property.\n\n Args:\n delta: Comparison/quantization delta.\n allow_nondet: Attempt minimization of non-deterministic FST?\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_23minimize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_25minimize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_24minimize[] = "\n minimize(self, delta=1e-6, allow_nondet=False)\n\n Minimizes the FST.\n\n This operation destructively performs the minimization of deterministic\n weighted automata and transducers. If the input FST A is an acceptor, this\n operation produces the minimal acceptor B equivalent to A, i.e. the\n acceptor with a minimal number of states that is equivalent to A. If the\n input FST A is a transducer, this operation internally builds an equivalent\n transducer with a minimal number of states. However, this minimality is\n obtained by allowing transition having strings of symbols as output labels,\n this known in the litterature as a real-time transducer. Such transducers\n are not directly supported by the library. This function will convert such\n transducer by expanding each string-labeled transition into a sequence of\n transitions. This will results in the creation of new states, hence losing\n the minimality property.\n\n Args:\n delta: Comparison/quantization delta.\n allow_nondet: Attempt minimization of non-deterministic FST?\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_25minimize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
float __pyx_v_delta;
bool __pyx_v_allow_nondet;
PyObject *__pyx_r = 0;
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minimize") < 0)) __PYX_ERR(0, 2096, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minimize") < 0)) __PYX_ERR(0, 2108, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
}
if (values[0]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2096, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2108, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__12;
}
if (values[1]) {
- __pyx_v_allow_nondet = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_allow_nondet == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2096, __pyx_L3_error)
+ __pyx_v_allow_nondet = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_allow_nondet == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2108, __pyx_L3_error)
} else {
__pyx_v_allow_nondet = ((bool)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("minimize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2096, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("minimize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2108, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.minimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_22minimize(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_allow_nondet);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_24minimize(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_allow_nondet);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_22minimize(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_allow_nondet) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_24minimize(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_allow_nondet) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__minimize __pyx_t_1;
__Pyx_RefNannySetupContext("minimize", 0);
- /* "pywrapfst.pyx":2122
+ /* "pywrapfst.pyx":2134
* self.
* """
* self._minimize(delta, allow_nondet) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_minimize");
- __PYX_ERR(0, 2122, __pyx_L1_error)
+ __PYX_ERR(0, 2134, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 2;
__pyx_t_1.delta = __pyx_v_delta;
__pyx_t_1.allow_nondet = __pyx_v_allow_nondet;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_minimize(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2122, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_minimize(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2134, __pyx_L1_error)
- /* "pywrapfst.pyx":2123
+ /* "pywrapfst.pyx":2135
* """
* self._minimize(delta, allow_nondet)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2096
+ /* "pywrapfst.pyx":2108
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2125
+/* "pywrapfst.pyx":2137
* return self
*
* cpdef MutableArcIterator mutable_arcs(self, int64 state): # <<<<<<<<<<<<<<
* mutable_arcs(self, state)
*/
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_25mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_27mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_f_9pywrapfst_11_MutableFst_mutable_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, int __pyx_skip_dispatch) {
struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mutable_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2125, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mutable_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11_MutableFst_25mutable_arcs)) {
+ if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11_MutableFst_27mutable_arcs)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2125, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2125, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_MutableArcIterator))))) __PYX_ERR(0, 2125, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_MutableArcIterator))))) __PYX_ERR(0, 2137, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":2139
+ /* "pywrapfst.pyx":2151
* See also: `arcs`, `states`.
* """
* return MutableArcIterator(self, state) # <<<<<<<<<<<<<<
* def mutable_input_symbols(self):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2139, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2139, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_MutableArcIterator), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2139, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_MutableArcIterator), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2125
+ /* "pywrapfst.pyx":2137
* return self
*
* cpdef MutableArcIterator mutable_arcs(self, int64 state): # <<<<<<<<<<<<<<
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_25mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_24mutable_arcs[] = "\n mutable_arcs(self, state)\n\n Returns a mutable iterator over arcs leaving the specified state.\n\n Args:\n state: The source state ID.\n\n Returns:\n A MutableArcIterator.\n\n See also: `arcs`, `states`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_25mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_27mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_26mutable_arcs[] = "\n mutable_arcs(self, state)\n\n Returns a mutable iterator over arcs leaving the specified state.\n\n Args:\n state: The source state ID.\n\n Returns:\n A MutableArcIterator.\n\n See also: `arcs`, `states`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_27mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
__pyx_t_10basictypes_int64 __pyx_v_state;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("mutable_arcs (wrapper)", 0);
assert(__pyx_arg_state); {
- __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2125, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2137, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_24mutable_arcs(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_state));
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_26mutable_arcs(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_state));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_24mutable_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("mutable_arcs", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_11_MutableFst_mutable_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2125, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_11_MutableFst_mutable_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2141
+/* "pywrapfst.pyx":2153
* return MutableArcIterator(self, state)
*
* def mutable_input_symbols(self): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_27mutable_input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_26mutable_input_symbols[] = "\n mutable_input_symbols(self)\n\n Returns the FST's (mutable) input symbol table, or None if none is present.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_27mutable_input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_29mutable_input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_28mutable_input_symbols[] = "\n mutable_input_symbols(self)\n\n Returns the FST's (mutable) input symbol table, or None if none is present.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_29mutable_input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("mutable_input_symbols (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_26mutable_input_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_28mutable_input_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
fst::SymbolTable *__pyx_v_syms;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("mutable_input_symbols", 0);
- /* "pywrapfst.pyx":2147
+ /* "pywrapfst.pyx":2159
* Returns the FST's (mutable) input symbol table, or None if none is present.
* """
* cdef fst.SymbolTable *syms = self._mfst.get().MutableInputSymbols() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2147, __pyx_L1_error)
+ __PYX_ERR(0, 2159, __pyx_L1_error)
}
__pyx_v_syms = __pyx_v_self->_mfst.get()->MutableInputSymbols();
- /* "pywrapfst.pyx":2148
+ /* "pywrapfst.pyx":2160
* """
* cdef fst.SymbolTable *syms = self._mfst.get().MutableInputSymbols()
* if syms == NULL: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_syms == NULL) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2149
+ /* "pywrapfst.pyx":2161
* cdef fst.SymbolTable *syms = self._mfst.get().MutableInputSymbols()
* if syms == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":2148
+ /* "pywrapfst.pyx":2160
* """
* cdef fst.SymbolTable *syms = self._mfst.get().MutableInputSymbols()
* if syms == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2150
+ /* "pywrapfst.pyx":2162
* if syms == NULL:
* return
* return _init_MutableFstSymbolTable(syms, self._mfst) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2150, __pyx_L1_error)
+ __PYX_ERR(0, 2162, __pyx_L1_error)
}
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_syms, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2150, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_syms, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2141
+ /* "pywrapfst.pyx":2153
* return MutableArcIterator(self, state)
*
* def mutable_input_symbols(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2152
+/* "pywrapfst.pyx":2164
* return _init_MutableFstSymbolTable(syms, self._mfst)
*
* def mutable_output_symbols(self): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_29mutable_output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_28mutable_output_symbols[] = "\n mutable_output_symbols(self)\n\n Returns the FST's (mutable) output symbol table, or None if none is present.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_29mutable_output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_31mutable_output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_30mutable_output_symbols[] = "\n mutable_output_symbols(self)\n\n Returns the FST's (mutable) output symbol table, or None if none is present.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_31mutable_output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("mutable_output_symbols (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_28mutable_output_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_30mutable_output_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_30mutable_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
fst::SymbolTable *__pyx_v_syms;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("mutable_output_symbols", 0);
- /* "pywrapfst.pyx":2158
+ /* "pywrapfst.pyx":2170
* Returns the FST's (mutable) output symbol table, or None if none is present.
* """
* cdef fst.SymbolTable *syms = self._mfst.get().MutableOutputSymbols() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2158, __pyx_L1_error)
+ __PYX_ERR(0, 2170, __pyx_L1_error)
}
__pyx_v_syms = __pyx_v_self->_mfst.get()->MutableOutputSymbols();
- /* "pywrapfst.pyx":2159
+ /* "pywrapfst.pyx":2171
* """
* cdef fst.SymbolTable *syms = self._mfst.get().MutableOutputSymbols()
* if syms == NULL: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_syms == NULL) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2160
+ /* "pywrapfst.pyx":2172
* cdef fst.SymbolTable *syms = self._mfst.get().MutableOutputSymbols()
* if syms == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":2159
+ /* "pywrapfst.pyx":2171
* """
* cdef fst.SymbolTable *syms = self._mfst.get().MutableOutputSymbols()
* if syms == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2161
+ /* "pywrapfst.pyx":2173
* if syms == NULL:
* return
* return _init_MutableFstSymbolTable(syms, self._mfst) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2161, __pyx_L1_error)
+ __PYX_ERR(0, 2173, __pyx_L1_error)
}
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_syms, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2161, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_syms, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2152
+ /* "pywrapfst.pyx":2164
* return _init_MutableFstSymbolTable(syms, self._mfst)
*
* def mutable_output_symbols(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2163
+/* "pywrapfst.pyx":2175
* return _init_MutableFstSymbolTable(syms, self._mfst)
*
* cpdef int64 num_states(self): # <<<<<<<<<<<<<<
* num_states(self)
*/
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_31num_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_33num_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_num_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, int __pyx_skip_dispatch) {
__pyx_t_10basictypes_int64 __pyx_r;
__Pyx_RefNannyDeclarations
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2163, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11_MutableFst_31num_states)) {
+ if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11_MutableFst_33num_states)) {
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2163, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2163, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2175, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":2169
+ /* "pywrapfst.pyx":2181
* Returns the number of states.
* """
* return self._mfst.get().NumStates() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2169, __pyx_L1_error)
+ __PYX_ERR(0, 2181, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mfst.get()->NumStates();
goto __pyx_L0;
- /* "pywrapfst.pyx":2163
+ /* "pywrapfst.pyx":2175
* return _init_MutableFstSymbolTable(syms, self._mfst)
*
* cpdef int64 num_states(self): # <<<<<<<<<<<<<<
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_31num_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_30num_states[] = "\n num_states(self)\n\n Returns the number of states.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_31num_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_33num_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_32num_states[] = "\n num_states(self)\n\n Returns the number of states.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_33num_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("num_states (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_30num_states(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_32num_states(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_30num_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_32num_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("num_states", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_11_MutableFst_num_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2163, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_11_MutableFst_num_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2171
+/* "pywrapfst.pyx":2183
* return self._mfst.get().NumStates()
*
* cdef void _project(self, bool project_output=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2172
+ /* "pywrapfst.pyx":2184
*
* cdef void _project(self, bool project_output=False) except *:
* fst.Project(self._mfst.get(), fst.GetProjectType(project_output)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2172, __pyx_L1_error)
+ __PYX_ERR(0, 2184, __pyx_L1_error)
}
fst::script::Project(__pyx_v_self->_mfst.get(), fst::script::GetProjectType(__pyx_v_project_output));
- /* "pywrapfst.pyx":2173
+ /* "pywrapfst.pyx":2185
* cdef void _project(self, bool project_output=False) except *:
* fst.Project(self._mfst.get(), fst.GetProjectType(project_output))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2173, __pyx_L1_error)
+ __PYX_ERR(0, 2185, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2173, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2185, __pyx_L1_error)
- /* "pywrapfst.pyx":2171
+ /* "pywrapfst.pyx":2183
* return self._mfst.get().NumStates()
*
* cdef void _project(self, bool project_output=False) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2175
+/* "pywrapfst.pyx":2187
* self._check_mutating_imethod()
*
* def project(self, bool project_output=False): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_33project(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_32project[] = "\n project(self, project_output=False)\n\n Converts the FST to an acceptor using input or output labels.\n\n This operation destructively projects an FST onto its domain or range by\n either copying each arc's input label to its output label (the default) or\n vice versa.\n\n Args:\n project_output: Should the output labels be projected?\n\n Returns:\n self.\n\n See also: `decode`, `encode`, `relabel_pairs`, `relabel_symbols`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_33project(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35project(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_34project[] = "\n project(self, project_output=False)\n\n Converts the FST to an acceptor using input or output labels.\n\n This operation destructively projects an FST onto its domain or range by\n either copying each arc's input label to its output label (the default) or\n vice versa.\n\n Args:\n project_output: Should the output labels be projected?\n\n Returns:\n self.\n\n See also: `decode`, `encode`, `relabel_pairs`, `relabel_symbols`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35project(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
bool __pyx_v_project_output;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "project") < 0)) __PYX_ERR(0, 2175, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "project") < 0)) __PYX_ERR(0, 2187, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
}
if (values[0]) {
- __pyx_v_project_output = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_project_output == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2175, __pyx_L3_error)
+ __pyx_v_project_output = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_project_output == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2187, __pyx_L3_error)
} else {
__pyx_v_project_output = ((bool)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("project", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2175, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("project", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2187, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.project", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_32project(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_project_output);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_34project(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_project_output);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_32project(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_project_output) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_34project(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_project_output) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__project __pyx_t_1;
__Pyx_RefNannySetupContext("project", 0);
- /* "pywrapfst.pyx":2193
+ /* "pywrapfst.pyx":2205
* See also: `decode`, `encode`, `relabel_pairs`, `relabel_symbols`.
* """
* self._project(project_output) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_project");
- __PYX_ERR(0, 2193, __pyx_L1_error)
+ __PYX_ERR(0, 2205, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 1;
__pyx_t_1.project_output = __pyx_v_project_output;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_project(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2193, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_project(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2205, __pyx_L1_error)
- /* "pywrapfst.pyx":2194
+ /* "pywrapfst.pyx":2206
* """
* self._project(project_output)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2175
+ /* "pywrapfst.pyx":2187
* self._check_mutating_imethod()
*
* def project(self, bool project_output=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2196
+/* "pywrapfst.pyx":2208
* return self
*
* cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
float __pyx_v_delta = __pyx_k__13;
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__14;
- /* "pywrapfst.pyx":2197
+ /* "pywrapfst.pyx":2209
*
* cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId,
* weight=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2199
+ /* "pywrapfst.pyx":2211
* weight=None) except *:
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 2199, __pyx_L1_error)
+ __PYX_ERR(0, 2211, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2200
+ /* "pywrapfst.pyx":2212
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
* weight) # <<<<<<<<<<<<<<
* fst.Prune(self._mfst.get(), wc, nstate, delta)
* self._check_mutating_imethod()
*/
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2199, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2211, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":2201
+ /* "pywrapfst.pyx":2213
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
* weight)
* fst.Prune(self._mfst.get(), wc, nstate, delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2201, __pyx_L1_error)
+ __PYX_ERR(0, 2213, __pyx_L1_error)
}
fst::script::Prune(__pyx_v_self->_mfst.get(), __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":2202
+ /* "pywrapfst.pyx":2214
* weight)
* fst.Prune(self._mfst.get(), wc, nstate, delta)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2202, __pyx_L1_error)
+ __PYX_ERR(0, 2214, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2202, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2214, __pyx_L1_error)
- /* "pywrapfst.pyx":2196
+ /* "pywrapfst.pyx":2208
* return self
*
* cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2204
+/* "pywrapfst.pyx":2216
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_34prune[] = "\n prune(self, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)\n\n Removes paths with weights below a certain threshold.\n\n This operation deletes states and arcs in the input FST that do not belong\n to a successful path whose weight is no more (w.r.t the natural semiring\n order) than the threshold t \\otimes-times the weight of the shortest path in\n the input FST. Weights must be commutative and have the path property.\n\n Args:\n delta: Comparison/quantization delta.\n nstate: State number threshold.\n weight: A Weight or weight string indicating the desired weight threshold\n below which paths are pruned; if omitted, no paths are pruned.\n\n Returns:\n self.\n\n See also: The constructive variant.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_37prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_36prune[] = "\n prune(self, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)\n\n Removes paths with weights below a certain threshold.\n\n This operation deletes states and arcs in the input FST that do not belong\n to a successful path whose weight is no more (w.r.t the natural semiring\n order) than the threshold t \\otimes-times the weight of the shortest path in\n the input FST. Weights must be commutative and have the path property.\n\n Args:\n delta: Comparison/quantization delta.\n nstate: State number threshold.\n weight: A Weight or weight string indicating the desired weight threshold\n below which paths are pruned; if omitted, no paths are pruned.\n\n Returns:\n self.\n\n See also: The constructive variant.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_37prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
float __pyx_v_delta;
__pyx_t_10basictypes_int64 __pyx_v_nstate;
PyObject *__pyx_v_weight = 0;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_weight,0};
PyObject* values[3] = {0,0,0};
- /* "pywrapfst.pyx":2207
+ /* "pywrapfst.pyx":2219
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 2204, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 2216, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
}
if (values[0]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2205, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2217, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__15;
}
if (values[1]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2206, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2218, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__16;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2204, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2216, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_34prune(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_36prune(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);
- /* "pywrapfst.pyx":2204
+ /* "pywrapfst.pyx":2216
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_34prune(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_weight) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_36prune(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_weight) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune __pyx_t_1;
__Pyx_RefNannySetupContext("prune", 0);
- /* "pywrapfst.pyx":2229
+ /* "pywrapfst.pyx":2241
* See also: The constructive variant.
* """
* self._prune(delta, nstate, weight) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_prune");
- __PYX_ERR(0, 2229, __pyx_L1_error)
+ __PYX_ERR(0, 2241, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 3;
__pyx_t_1.delta = __pyx_v_delta;
__pyx_t_1.nstate = __pyx_v_nstate;
__pyx_t_1.weight = __pyx_v_weight;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_prune(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2229, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_prune(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2241, __pyx_L1_error)
- /* "pywrapfst.pyx":2230
+ /* "pywrapfst.pyx":2242
* """
* self._prune(delta, nstate, weight)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2204
+ /* "pywrapfst.pyx":2216
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2232
+/* "pywrapfst.pyx":2244
* return self
*
* cdef void _push(self, # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_11_MutableFst__push(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__push *__pyx_optional_args) {
float __pyx_v_delta = __pyx_k__17;
- /* "pywrapfst.pyx":2234
+ /* "pywrapfst.pyx":2246
* cdef void _push(self,
* float delta=fst.kDelta,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_total_weight = ((bool)0);
- /* "pywrapfst.pyx":2235
+ /* "pywrapfst.pyx":2247
* float delta=fst.kDelta,
* bool remove_total_weight=False,
* bool to_final=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2236
+ /* "pywrapfst.pyx":2248
* bool remove_total_weight=False,
* bool to_final=False) except *:
* fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2236, __pyx_L1_error)
+ __PYX_ERR(0, 2248, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2237
+ /* "pywrapfst.pyx":2249
* bool to_final=False) except *:
* fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,
* remove_total_weight) # <<<<<<<<<<<<<<
*/
fst::script::Push(__pyx_v_self->_mfst.get(), fst::script::GetReweightType(__pyx_v_to_final), __pyx_v_delta, __pyx_v_remove_total_weight);
- /* "pywrapfst.pyx":2238
+ /* "pywrapfst.pyx":2250
* fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,
* remove_total_weight)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2238, __pyx_L1_error)
+ __PYX_ERR(0, 2250, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2238, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2250, __pyx_L1_error)
- /* "pywrapfst.pyx":2232
+ /* "pywrapfst.pyx":2244
* return self
*
* cdef void _push(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2240
+/* "pywrapfst.pyx":2252
* self._check_mutating_imethod()
*
* def push(self, # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_37push(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_36push[] = "\n push(self, delta=0.0009765625, remove_total_weight=False, to_final=False)\n\n Pushes weights towards the initial or final states.\n\n This operation destructively produces an equivalent transducer by pushing\n the weights towards the initial state or toward the final states. When\n pushing weights towards the initial state, the sum of the weight of the\n outgoing transitions and final weight at any non-initial state is equal to\n one in the resulting machine. When pushing weights towards the final states,\n the sum of the weight of the incoming transitions at any state is equal to\n one. Weights need to be left distributive when pushing towards the initial\n state and right distributive when pushing towards the final states.\n\n Args:\n delta: Comparison/quantization delta.\n remove_total_weight: If pushing weights, should the total weight be\n removed?\n to_final: Push towards final states?\n\n Returns:\n self.\n\n See also: The constructive variant, which also supports label pushing.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_37push(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_39push(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_38push[] = "\n push(self, delta=0.0009765625, remove_total_weight=False, to_final=False)\n\n Pushes weights towards the initial or final states.\n\n This operation destructively produces an equivalent transducer by pushing\n the weights towards the initial state or toward the final states. When\n pushing weights towards the initial state, the sum of the weight of the\n outgoing transitions and final weight at any non-initial state is equal to\n one in the resulting machine. When pushing weights towards the final states,\n the sum of the weight of the incoming transitions at any state is equal to\n one. Weights need to be left distributive when pushing towards the initial\n state and right distributive when pushing towards the final states.\n\n Args:\n delta: Comparison/quantization delta.\n remove_total_weight: If pushing weights, should the total weight be\n removed?\n to_final: Push towards final states?\n\n Returns:\n self.\n\n See also: The constructive variant, which also supports label pushing.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_39push(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
float __pyx_v_delta;
bool __pyx_v_remove_total_weight;
bool __pyx_v_to_final;
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 2240, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 2252, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
}
if (values[0]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2241, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2253, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__18;
}
if (values[1]) {
- __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2242, __pyx_L3_error)
+ __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2254, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2242
+ /* "pywrapfst.pyx":2254
* def push(self,
* float delta=fst.kDelta,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
__pyx_v_remove_total_weight = ((bool)0);
}
if (values[2]) {
- __pyx_v_to_final = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_to_final == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2243, __pyx_L3_error)
+ __pyx_v_to_final = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_to_final == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2255, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2243
+ /* "pywrapfst.pyx":2255
* float delta=fst.kDelta,
* bool remove_total_weight=False,
* bool to_final=False): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("push", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2240, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("push", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2252, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_36push(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_remove_total_weight, __pyx_v_to_final);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_38push(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_remove_total_weight, __pyx_v_to_final);
- /* "pywrapfst.pyx":2240
+ /* "pywrapfst.pyx":2252
* self._check_mutating_imethod()
*
* def push(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_36push(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_remove_total_weight, bool __pyx_v_to_final) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_38push(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_remove_total_weight, bool __pyx_v_to_final) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__push __pyx_t_1;
__Pyx_RefNannySetupContext("push", 0);
- /* "pywrapfst.pyx":2269
+ /* "pywrapfst.pyx":2281
* See also: The constructive variant, which also supports label pushing.
* """
* self._push(delta, remove_total_weight, to_final) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_push");
- __PYX_ERR(0, 2269, __pyx_L1_error)
+ __PYX_ERR(0, 2281, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 3;
__pyx_t_1.delta = __pyx_v_delta;
__pyx_t_1.remove_total_weight = __pyx_v_remove_total_weight;
__pyx_t_1.to_final = __pyx_v_to_final;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_push(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2269, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_push(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2281, __pyx_L1_error)
- /* "pywrapfst.pyx":2270
+ /* "pywrapfst.pyx":2282
* """
* self._push(delta, remove_total_weight, to_final)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2240
+ /* "pywrapfst.pyx":2252
* self._check_mutating_imethod()
*
* def push(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2272
+/* "pywrapfst.pyx":2284
* return self
*
* cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2274
+ /* "pywrapfst.pyx":2286
* cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:
* cdef unique_ptr[vector[fst.LabelPair]] _ipairs
* _ipairs.reset(new vector[fst.LabelPair]()) # <<<<<<<<<<<<<<
__pyx_t_1 = new std::vector<__pyx_t_3fst_LabelPair> ();
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2274, __pyx_L1_error)
+ __PYX_ERR(0, 2286, __pyx_L1_error)
}
__pyx_v__ipairs.reset(__pyx_t_1);
- /* "pywrapfst.pyx":2276
+ /* "pywrapfst.pyx":2288
* _ipairs.reset(new vector[fst.LabelPair]())
* cdef unique_ptr[vector[fst.LabelPair]] _opairs
* _opairs.reset(new vector[fst.LabelPair]()) # <<<<<<<<<<<<<<
__pyx_t_1 = new std::vector<__pyx_t_3fst_LabelPair> ();
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2276, __pyx_L1_error)
+ __PYX_ERR(0, 2288, __pyx_L1_error)
}
__pyx_v__opairs.reset(__pyx_t_1);
- /* "pywrapfst.pyx":2279
+ /* "pywrapfst.pyx":2291
* cdef int64 before
* cdef int64 after
* if ipairs: # <<<<<<<<<<<<<<
* for (before, after) in ipairs:
* _ipairs.get().push_back(fst.LabelPair(before, after))
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2279, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2291, __pyx_L1_error)
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2280
+ /* "pywrapfst.pyx":2292
* cdef int64 after
* if ipairs:
* for (before, after) in ipairs: # <<<<<<<<<<<<<<
__pyx_t_3 = __pyx_v_ipairs; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ipairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2280, __pyx_L1_error)
+ __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ipairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2280, __pyx_L1_error)
+ __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2292, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_5)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2280, __pyx_L1_error)
+ __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2292, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2280, __pyx_L1_error)
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2280, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2292, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2280, __pyx_L1_error)
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2280, __pyx_L1_error)
+ else __PYX_ERR(0, 2292, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 2280, __pyx_L1_error)
+ __PYX_ERR(0, 2292, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
#else
- __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2280, __pyx_L1_error)
+ __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2280, __pyx_L1_error)
+ __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2280, __pyx_L1_error)
+ __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
__Pyx_GOTREF(__pyx_t_7);
index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_8);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2280, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2292, __pyx_L1_error)
__pyx_t_10 = NULL;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L7_unpacking_done;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 2280, __pyx_L1_error)
+ __PYX_ERR(0, 2292, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
- __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2280, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2292, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2280, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2292, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_before = __pyx_t_11;
__pyx_v_after = __pyx_t_12;
- /* "pywrapfst.pyx":2281
+ /* "pywrapfst.pyx":2293
* if ipairs:
* for (before, after) in ipairs:
* _ipairs.get().push_back(fst.LabelPair(before, after)) # <<<<<<<<<<<<<<
__pyx_t_13 = __pyx_t_3fst_LabelPair(__pyx_v_before, __pyx_v_after);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2281, __pyx_L1_error)
+ __PYX_ERR(0, 2293, __pyx_L1_error)
}
try {
__pyx_v__ipairs.get()->push_back(__pyx_t_13);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2281, __pyx_L1_error)
+ __PYX_ERR(0, 2293, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2280
+ /* "pywrapfst.pyx":2292
* cdef int64 after
* if ipairs:
* for (before, after) in ipairs: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "pywrapfst.pyx":2279
+ /* "pywrapfst.pyx":2291
* cdef int64 before
* cdef int64 after
* if ipairs: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2282
+ /* "pywrapfst.pyx":2294
* for (before, after) in ipairs:
* _ipairs.get().push_back(fst.LabelPair(before, after))
* if opairs: # <<<<<<<<<<<<<<
* for (before, after) in opairs:
* _opairs.get().push_back(fst.LabelPair(before, after))
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2282, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2294, __pyx_L1_error)
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2283
+ /* "pywrapfst.pyx":2295
* _ipairs.get().push_back(fst.LabelPair(before, after))
* if opairs:
* for (before, after) in opairs: # <<<<<<<<<<<<<<
__pyx_t_3 = __pyx_v_opairs; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_opairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2283, __pyx_L1_error)
+ __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_opairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2283, __pyx_L1_error)
+ __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2295, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_5)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2283, __pyx_L1_error)
+ __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2295, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2283, __pyx_L1_error)
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2283, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2295, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2283, __pyx_L1_error)
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2283, __pyx_L1_error)
+ else __PYX_ERR(0, 2295, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 2283, __pyx_L1_error)
+ __PYX_ERR(0, 2295, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_7);
#else
- __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2283, __pyx_L1_error)
+ __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2283, __pyx_L1_error)
+ __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2283, __pyx_L1_error)
+ __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
__Pyx_GOTREF(__pyx_t_8);
index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2283, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2295, __pyx_L1_error)
__pyx_t_10 = NULL;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L12_unpacking_done;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 2283, __pyx_L1_error)
+ __PYX_ERR(0, 2295, __pyx_L1_error)
__pyx_L12_unpacking_done:;
}
- __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2283, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2295, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2283, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2295, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_before = __pyx_t_12;
__pyx_v_after = __pyx_t_11;
- /* "pywrapfst.pyx":2284
+ /* "pywrapfst.pyx":2296
* if opairs:
* for (before, after) in opairs:
* _opairs.get().push_back(fst.LabelPair(before, after)) # <<<<<<<<<<<<<<
__pyx_t_13 = __pyx_t_3fst_LabelPair(__pyx_v_before, __pyx_v_after);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2284, __pyx_L1_error)
+ __PYX_ERR(0, 2296, __pyx_L1_error)
}
try {
__pyx_v__opairs.get()->push_back(__pyx_t_13);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2284, __pyx_L1_error)
+ __PYX_ERR(0, 2296, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2283
+ /* "pywrapfst.pyx":2295
* _ipairs.get().push_back(fst.LabelPair(before, after))
* if opairs:
* for (before, after) in opairs: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "pywrapfst.pyx":2282
+ /* "pywrapfst.pyx":2294
* for (before, after) in ipairs:
* _ipairs.get().push_back(fst.LabelPair(before, after))
* if opairs: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2285
+ /* "pywrapfst.pyx":2297
* for (before, after) in opairs:
* _opairs.get().push_back(fst.LabelPair(before, after))
* if _ipairs.get().empty() and _opairs.get().empty(): # <<<<<<<<<<<<<<
__pyx_L14_bool_binop_done:;
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":2286
+ /* "pywrapfst.pyx":2298
* _opairs.get().push_back(fst.LabelPair(before, after))
* if _ipairs.get().empty() and _opairs.get().empty():
* raise FstArgError("No relabeling pairs specified.") # <<<<<<<<<<<<<<
* fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
* self._check_mutating_imethod()
*/
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2286, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
}
__pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_kp_u_No_relabeling_pairs_specified) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_u_No_relabeling_pairs_specified);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2286, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2286, __pyx_L1_error)
+ __PYX_ERR(0, 2298, __pyx_L1_error)
- /* "pywrapfst.pyx":2285
+ /* "pywrapfst.pyx":2297
* for (before, after) in opairs:
* _opairs.get().push_back(fst.LabelPair(before, after))
* if _ipairs.get().empty() and _opairs.get().empty(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2287
+ /* "pywrapfst.pyx":2299
* if _ipairs.get().empty() and _opairs.get().empty():
* raise FstArgError("No relabeling pairs specified.")
* fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2287, __pyx_L1_error)
+ __PYX_ERR(0, 2299, __pyx_L1_error)
}
fst::script::Relabel(__pyx_v_self->_mfst.get(), (*__pyx_v__ipairs), (*__pyx_v__opairs));
- /* "pywrapfst.pyx":2288
+ /* "pywrapfst.pyx":2300
* raise FstArgError("No relabeling pairs specified.")
* fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2288, __pyx_L1_error)
+ __PYX_ERR(0, 2300, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2288, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2300, __pyx_L1_error)
- /* "pywrapfst.pyx":2272
+ /* "pywrapfst.pyx":2284
* return self
*
* cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2290
+/* "pywrapfst.pyx":2302
* self._check_mutating_imethod()
*
* def relabel_pairs(self, ipairs=None, opairs=None): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_39relabel_pairs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_38relabel_pairs[] = "\n relabel_pairs(self, ipairs=None, opairs=None)\n\n Replaces input and/or output labels using pairs of labels.\n\n This operation destructively relabels the input and/or output labels of the\n FST using pairs of the form (old_ID, new_ID); omitted indices are\n identity-mapped.\n\n Args:\n ipairs: An iterable containing (older index, newer index) integer pairs.\n opairs: An iterable containing (older index, newer index) integer pairs.\n\n Returns:\n self.\n\n Raises:\n FstArgError: No relabeling pairs specified.\n\n See also: `decode`, `encode`, `project`, `relabel_tables`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_39relabel_pairs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_41relabel_pairs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_40relabel_pairs[] = "\n relabel_pairs(self, ipairs=None, opairs=None)\n\n Replaces input and/or output labels using pairs of labels.\n\n This operation destructively relabels the input and/or output labels of the\n FST using pairs of the form (old_ID, new_ID); omitted indices are\n identity-mapped.\n\n Args:\n ipairs: An iterable containing (older index, newer index) integer pairs.\n opairs: An iterable containing (older index, newer index) integer pairs.\n\n Returns:\n self.\n\n Raises:\n FstArgError: No relabeling pairs specified.\n\n See also: `decode`, `encode`, `project`, `relabel_tables`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_41relabel_pairs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ipairs = 0;
PyObject *__pyx_v_opairs = 0;
PyObject *__pyx_r = 0;
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_pairs") < 0)) __PYX_ERR(0, 2290, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_pairs") < 0)) __PYX_ERR(0, 2302, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("relabel_pairs", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2290, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("relabel_pairs", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2302, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_38relabel_pairs(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_ipairs, __pyx_v_opairs);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_40relabel_pairs(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_ipairs, __pyx_v_opairs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_38relabel_pairs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_ipairs, PyObject *__pyx_v_opairs) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_40relabel_pairs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_ipairs, PyObject *__pyx_v_opairs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_pairs __pyx_t_1;
__Pyx_RefNannySetupContext("relabel_pairs", 0);
- /* "pywrapfst.pyx":2312
+ /* "pywrapfst.pyx":2324
* See also: `decode`, `encode`, `project`, `relabel_tables`.
* """
* self._relabel_pairs(ipairs, opairs) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_relabel_pairs");
- __PYX_ERR(0, 2312, __pyx_L1_error)
+ __PYX_ERR(0, 2324, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 2;
__pyx_t_1.ipairs = __pyx_v_ipairs;
__pyx_t_1.opairs = __pyx_v_opairs;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_relabel_pairs(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2312, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_relabel_pairs(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2324, __pyx_L1_error)
- /* "pywrapfst.pyx":2313
+ /* "pywrapfst.pyx":2325
* """
* self._relabel_pairs(ipairs, opairs)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2290
+ /* "pywrapfst.pyx":2302
* self._check_mutating_imethod()
*
* def relabel_pairs(self, ipairs=None, opairs=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2315
+/* "pywrapfst.pyx":2327
* return self
*
* cdef void _relabel_tables(self, # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_tables *__pyx_optional_args) {
- /* "pywrapfst.pyx":2316
+ /* "pywrapfst.pyx":2328
*
* cdef void _relabel_tables(self,
* _SymbolTable old_isymbols=None, # <<<<<<<<<<<<<<
*/
struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":2317
+ /* "pywrapfst.pyx":2329
* cdef void _relabel_tables(self,
* _SymbolTable old_isymbols=None,
* _SymbolTable new_isymbols=None, # <<<<<<<<<<<<<<
struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
PyObject *__pyx_v_unknown_isymbol = ((PyObject *)__pyx_kp_b__10);
- /* "pywrapfst.pyx":2319
+ /* "pywrapfst.pyx":2331
* _SymbolTable new_isymbols=None,
* unknown_isymbol=b"",
* bool attach_new_isymbols=True, # <<<<<<<<<<<<<<
*/
bool __pyx_v_attach_new_isymbols = ((bool)1);
- /* "pywrapfst.pyx":2320
+ /* "pywrapfst.pyx":2332
* unknown_isymbol=b"",
* bool attach_new_isymbols=True,
* _SymbolTable old_osymbols=None, # <<<<<<<<<<<<<<
*/
struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":2321
+ /* "pywrapfst.pyx":2333
* bool attach_new_isymbols=True,
* _SymbolTable old_osymbols=None,
* _SymbolTable new_osymbols=None, # <<<<<<<<<<<<<<
struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
PyObject *__pyx_v_unknown_osymbol = ((PyObject *)__pyx_kp_b__10);
- /* "pywrapfst.pyx":2323
+ /* "pywrapfst.pyx":2335
* _SymbolTable new_osymbols=None,
* unknown_osymbol=b"",
* bool attach_new_osymbols=True) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2324
+ /* "pywrapfst.pyx":2336
* unknown_osymbol=b"",
* bool attach_new_osymbols=True) except *:
* if new_isymbols is None and new_osymbols is None: # <<<<<<<<<<<<<<
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2325
+ /* "pywrapfst.pyx":2337
* bool attach_new_osymbols=True) except *:
* if new_isymbols is None and new_osymbols is None:
* raise FstArgError("No new SymbolTables specified") # <<<<<<<<<<<<<<
* cdef fst.SymbolTable *new_isymbols_ptr = NULL
* if new_isymbols is not None:
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2325, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_u_No_new_SymbolTables_specified) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_No_new_SymbolTables_specified);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2325, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 2325, __pyx_L1_error)
+ __PYX_ERR(0, 2337, __pyx_L1_error)
- /* "pywrapfst.pyx":2324
+ /* "pywrapfst.pyx":2336
* unknown_osymbol=b"",
* bool attach_new_osymbols=True) except *:
* if new_isymbols is None and new_osymbols is None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2326
+ /* "pywrapfst.pyx":2338
* if new_isymbols is None and new_osymbols is None:
* raise FstArgError("No new SymbolTables specified")
* cdef fst.SymbolTable *new_isymbols_ptr = NULL # <<<<<<<<<<<<<<
*/
__pyx_v_new_isymbols_ptr = NULL;
- /* "pywrapfst.pyx":2327
+ /* "pywrapfst.pyx":2339
* raise FstArgError("No new SymbolTables specified")
* cdef fst.SymbolTable *new_isymbols_ptr = NULL
* if new_isymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2328
+ /* "pywrapfst.pyx":2340
* cdef fst.SymbolTable *new_isymbols_ptr = NULL
* if new_isymbols is not None:
* new_isymbols_ptr = new_isymbols._table # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_new_isymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 2328, __pyx_L1_error)
+ __PYX_ERR(0, 2340, __pyx_L1_error)
}
__pyx_t_7 = __pyx_v_new_isymbols->_table;
__pyx_v_new_isymbols_ptr = __pyx_t_7;
- /* "pywrapfst.pyx":2327
+ /* "pywrapfst.pyx":2339
* raise FstArgError("No new SymbolTables specified")
* cdef fst.SymbolTable *new_isymbols_ptr = NULL
* if new_isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2329
+ /* "pywrapfst.pyx":2341
* if new_isymbols is not None:
* new_isymbols_ptr = new_isymbols._table
* cdef fst.SymbolTable *new_osymbols_ptr = NULL # <<<<<<<<<<<<<<
*/
__pyx_v_new_osymbols_ptr = NULL;
- /* "pywrapfst.pyx":2330
+ /* "pywrapfst.pyx":2342
* new_isymbols_ptr = new_isymbols._table
* cdef fst.SymbolTable *new_osymbols_ptr = NULL
* if new_osymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2331
+ /* "pywrapfst.pyx":2343
* cdef fst.SymbolTable *new_osymbols_ptr = NULL
* if new_osymbols is not None:
* new_osymbols_ptr = new_osymbols._table # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_new_osymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 2331, __pyx_L1_error)
+ __PYX_ERR(0, 2343, __pyx_L1_error)
}
__pyx_t_7 = __pyx_v_new_osymbols->_table;
__pyx_v_new_osymbols_ptr = __pyx_t_7;
- /* "pywrapfst.pyx":2330
+ /* "pywrapfst.pyx":2342
* new_isymbols_ptr = new_isymbols._table
* cdef fst.SymbolTable *new_osymbols_ptr = NULL
* if new_osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2332
+ /* "pywrapfst.pyx":2344
* if new_osymbols is not None:
* new_osymbols_ptr = new_osymbols._table
* fst.Relabel(self._mfst.get(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2332, __pyx_L1_error)
+ __PYX_ERR(0, 2344, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2333
+ /* "pywrapfst.pyx":2345
* new_osymbols_ptr = new_osymbols._table
* fst.Relabel(self._mfst.get(),
* self._fst.get().InputSymbols() if old_isymbols is None else # <<<<<<<<<<<<<<
if ((__pyx_t_1 != 0)) {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2333, __pyx_L1_error)
+ __PYX_ERR(0, 2345, __pyx_L1_error)
}
__pyx_t_8 = __pyx_v_self->__pyx_base._fst.get()->InputSymbols();
} else {
- /* "pywrapfst.pyx":2334
+ /* "pywrapfst.pyx":2346
* fst.Relabel(self._mfst.get(),
* self._fst.get().InputSymbols() if old_isymbols is None else
* old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_old_isymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 2334, __pyx_L1_error)
+ __PYX_ERR(0, 2346, __pyx_L1_error)
}
__pyx_t_8 = __pyx_v_old_isymbols->_table;
}
- __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_isymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2334, __pyx_L1_error)
+ __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_isymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2346, __pyx_L1_error)
- /* "pywrapfst.pyx":2336
+ /* "pywrapfst.pyx":2348
* old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol),
* attach_new_isymbols,
* self._fst.get().OutputSymbols() if old_osymbols is None else # <<<<<<<<<<<<<<
if ((__pyx_t_1 != 0)) {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2336, __pyx_L1_error)
+ __PYX_ERR(0, 2348, __pyx_L1_error)
}
__pyx_t_10 = __pyx_v_self->__pyx_base._fst.get()->OutputSymbols();
} else {
- /* "pywrapfst.pyx":2337
+ /* "pywrapfst.pyx":2349
* attach_new_isymbols,
* self._fst.get().OutputSymbols() if old_osymbols is None else
* old_osymbols._table, new_osymbols_ptr, tostring(unknown_osymbol), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_old_osymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 2337, __pyx_L1_error)
+ __PYX_ERR(0, 2349, __pyx_L1_error)
}
__pyx_t_10 = __pyx_v_old_osymbols->_table;
}
- __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_osymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2337, __pyx_L1_error)
+ __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_osymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2349, __pyx_L1_error)
- /* "pywrapfst.pyx":2332
+ /* "pywrapfst.pyx":2344
* if new_osymbols is not None:
* new_osymbols_ptr = new_osymbols._table
* fst.Relabel(self._mfst.get(), # <<<<<<<<<<<<<<
*/
fst::script::Relabel(__pyx_v_self->_mfst.get(), __pyx_t_8, __pyx_v_new_isymbols_ptr, __pyx_t_9, __pyx_v_attach_new_isymbols, __pyx_t_10, __pyx_v_new_osymbols_ptr, __pyx_t_11, __pyx_v_attach_new_osymbols);
- /* "pywrapfst.pyx":2339
+ /* "pywrapfst.pyx":2351
* old_osymbols._table, new_osymbols_ptr, tostring(unknown_osymbol),
* attach_new_osymbols)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2339, __pyx_L1_error)
+ __PYX_ERR(0, 2351, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2339, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2351, __pyx_L1_error)
- /* "pywrapfst.pyx":2315
+ /* "pywrapfst.pyx":2327
* return self
*
* cdef void _relabel_tables(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2341
+/* "pywrapfst.pyx":2353
* self._check_mutating_imethod()
*
* def relabel_tables(self, # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_41relabel_tables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_40relabel_tables[] = "\n relabel_tables(self, old_isymbols=None, new_isymbols=None,\n unknown_isymbol=\"\", attach_new_isymbols=True,\n old_osymbols=None, new_osymbols=None,\n unknown_osymbol=\"\", attach_new_osymbols=True)\n\n Replaces input and/or output labels using SymbolTables.\n\n This operation destructively relabels the input and/or output labels of the\n FST using user-specified symbol tables; omitted symbols are identity-mapped.\n\n Args:\n old_isymbols: The old SymbolTable for input labels, defaulting to the\n FST's input symbol table.\n new_isymbols: A SymbolTable used to relabel the input labels\n unknown_isymbol: Input symbol to use to relabel OOVs (if empty,\n OOVs raise an exception)\n attach_new_isymbols: Should new_isymbols be made the FST's input symbol\n table?\n old_osymbols: The old SymbolTable for output labels, defaulting to the\n FST's output symbol table.\n new_osymbols: A SymbolTable used to relabel the output labels.\n unknown_osymbol: Outnput symbol to use to relabel OOVs (if empty,\n OOVs raise an exception)\n attach_new_isymbols: Should new_osymbols be made the FST's output symbol\n table?\n\n Returns:\n self.\n\n Raises:\n FstArgError: No SymbolTable specified.\n\n See also: `decode`, `encode`, `project`, `relabel_pairs`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_41relabel_tables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_43relabel_tables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_42relabel_tables[] = "\n relabel_tables(self, old_isymbols=None, new_isymbols=None,\n unknown_isymbol=\"\", attach_new_isymbols=True,\n old_osymbols=None, new_osymbols=None,\n unknown_osymbol=\"\", attach_new_osymbols=True)\n\n Replaces input and/or output labels using SymbolTables.\n\n This operation destructively relabels the input and/or output labels of the\n FST using user-specified symbol tables; omitted symbols are identity-mapped.\n\n Args:\n old_isymbols: The old SymbolTable for input labels, defaulting to the\n FST's input symbol table.\n new_isymbols: A SymbolTable used to relabel the input labels\n unknown_isymbol: Input symbol to use to relabel OOVs (if empty,\n OOVs raise an exception)\n attach_new_isymbols: Should new_isymbols be made the FST's input symbol\n table?\n old_osymbols: The old SymbolTable for output labels, defaulting to the\n FST's output symbol table.\n new_osymbols: A SymbolTable used to relabel the output labels.\n unknown_osymbol: Outnput symbol to use to relabel OOVs (if empty,\n OOVs raise an exception)\n attach_new_isymbols: Should new_osymbols be made the FST's output symbol\n table?\n\n Returns:\n self.\n\n Raises:\n FstArgError: No SymbolTable specified.\n\n See also: `decode`, `encode`, `project`, `relabel_pairs`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_43relabel_tables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols = 0;
struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols = 0;
PyObject *__pyx_v_unknown_isymbol = 0;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old_isymbols,&__pyx_n_s_new_isymbols,&__pyx_n_s_unknown_isymbol,&__pyx_n_s_attach_new_isymbols,&__pyx_n_s_old_osymbols,&__pyx_n_s_new_osymbols,&__pyx_n_s_unknown_osymbol,&__pyx_n_s_attach_new_osymbols,0};
PyObject* values[8] = {0,0,0,0,0,0,0,0};
- /* "pywrapfst.pyx":2342
+ /* "pywrapfst.pyx":2354
*
* def relabel_tables(self,
* _SymbolTable old_isymbols=None, # <<<<<<<<<<<<<<
*/
values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":2343
+ /* "pywrapfst.pyx":2355
* def relabel_tables(self,
* _SymbolTable old_isymbols=None,
* _SymbolTable new_isymbols=None, # <<<<<<<<<<<<<<
values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
values[2] = ((PyObject *)__pyx_kp_b__10);
- /* "pywrapfst.pyx":2346
+ /* "pywrapfst.pyx":2358
* unknown_isymbol=b"",
* bool attach_new_isymbols=True,
* _SymbolTable old_osymbols=None, # <<<<<<<<<<<<<<
*/
values[4] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":2347
+ /* "pywrapfst.pyx":2359
* bool attach_new_isymbols=True,
* _SymbolTable old_osymbols=None,
* _SymbolTable new_osymbols=None, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_tables") < 0)) __PYX_ERR(0, 2341, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_tables") < 0)) __PYX_ERR(0, 2353, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_new_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[1]);
__pyx_v_unknown_isymbol = values[2];
if (values[3]) {
- __pyx_v_attach_new_isymbols = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_attach_new_isymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2345, __pyx_L3_error)
+ __pyx_v_attach_new_isymbols = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_attach_new_isymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2357, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2345
+ /* "pywrapfst.pyx":2357
* _SymbolTable new_isymbols=None,
* unknown_isymbol=b"",
* bool attach_new_isymbols=True, # <<<<<<<<<<<<<<
__pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[5]);
__pyx_v_unknown_osymbol = values[6];
if (values[7]) {
- __pyx_v_attach_new_osymbols = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_attach_new_osymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2349, __pyx_L3_error)
+ __pyx_v_attach_new_osymbols = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_attach_new_osymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2361, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2349
+ /* "pywrapfst.pyx":2361
* _SymbolTable new_osymbols=None,
* unknown_osymbol=b"",
* bool attach_new_osymbols=True): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("relabel_tables", 0, 0, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2341, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("relabel_tables", 0, 0, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2353, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.relabel_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_isymbols", 0))) __PYX_ERR(0, 2342, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_isymbols", 0))) __PYX_ERR(0, 2343, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_osymbols", 0))) __PYX_ERR(0, 2346, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_osymbols", 0))) __PYX_ERR(0, 2347, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_old_isymbols, __pyx_v_new_isymbols, __pyx_v_unknown_isymbol, __pyx_v_attach_new_isymbols, __pyx_v_old_osymbols, __pyx_v_new_osymbols, __pyx_v_unknown_osymbol, __pyx_v_attach_new_osymbols);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_isymbols", 0))) __PYX_ERR(0, 2354, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_isymbols", 0))) __PYX_ERR(0, 2355, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_osymbols", 0))) __PYX_ERR(0, 2358, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_osymbols", 0))) __PYX_ERR(0, 2359, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_42relabel_tables(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_old_isymbols, __pyx_v_new_isymbols, __pyx_v_unknown_isymbol, __pyx_v_attach_new_isymbols, __pyx_v_old_osymbols, __pyx_v_new_osymbols, __pyx_v_unknown_osymbol, __pyx_v_attach_new_osymbols);
- /* "pywrapfst.pyx":2341
+ /* "pywrapfst.pyx":2353
* self._check_mutating_imethod()
*
* def relabel_tables(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_42relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_tables __pyx_t_1;
__Pyx_RefNannySetupContext("relabel_tables", 0);
- /* "pywrapfst.pyx":2385
+ /* "pywrapfst.pyx":2397
* See also: `decode`, `encode`, `project`, `relabel_pairs`.
* """
* self._relabel_tables(old_isymbols, new_isymbols, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_relabel_tables");
- __PYX_ERR(0, 2385, __pyx_L1_error)
+ __PYX_ERR(0, 2397, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2388
+ /* "pywrapfst.pyx":2400
* unknown_isymbol, attach_new_isymbols,
* old_osymbols, new_osymbols,
* unknown_osymbol, attach_new_osymbols) # <<<<<<<<<<<<<<
__pyx_t_1.new_osymbols = __pyx_v_new_osymbols;
__pyx_t_1.unknown_osymbol = __pyx_v_unknown_osymbol;
__pyx_t_1.attach_new_osymbols = __pyx_v_attach_new_osymbols;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_relabel_tables(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2385, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_relabel_tables(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2397, __pyx_L1_error)
- /* "pywrapfst.pyx":2389
+ /* "pywrapfst.pyx":2401
* old_osymbols, new_osymbols,
* unknown_osymbol, attach_new_osymbols)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2341
+ /* "pywrapfst.pyx":2353
* self._check_mutating_imethod()
*
* def relabel_tables(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2391
+/* "pywrapfst.pyx":2403
* return self
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("_reserve_arcs", 0);
- /* "pywrapfst.pyx":2392
+ /* "pywrapfst.pyx":2404
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *:
* if not self._mfst.get().ReserveArcs(state, n): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2392, __pyx_L1_error)
+ __PYX_ERR(0, 2404, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ReserveArcs(__pyx_v_state, __pyx_v_n) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2393
+ /* "pywrapfst.pyx":2405
* cdef void _reserve_arcs(self, int64 state, size_t n) except *:
* if not self._mfst.get().ReserveArcs(state, n):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2393, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2393, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 2393, __pyx_L1_error)
+ __PYX_ERR(0, 2405, __pyx_L1_error)
- /* "pywrapfst.pyx":2392
+ /* "pywrapfst.pyx":2404
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *:
* if not self._mfst.get().ReserveArcs(state, n): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2394
+ /* "pywrapfst.pyx":2406
* if not self._mfst.get().ReserveArcs(state, n):
* raise FstIndexError("State index out of range")
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2394, __pyx_L1_error)
+ __PYX_ERR(0, 2406, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2394, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2406, __pyx_L1_error)
- /* "pywrapfst.pyx":2391
+ /* "pywrapfst.pyx":2403
* return self
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2396
+/* "pywrapfst.pyx":2408
* self._check_mutating_imethod()
*
* def reserve_arcs(self, int64 state, size_t n): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_43reserve_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_42reserve_arcs[] = "\n reserve_arcs(self, state, n)\n\n Reserve n arcs at a particular state (best effort).\n\n Args:\n state: The integer index of a state.\n n: The number of arcs to reserve.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n\n See also: `reserve_states`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_43reserve_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_45reserve_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_44reserve_arcs[] = "\n reserve_arcs(self, state, n)\n\n Reserve n arcs at a particular state (best effort).\n\n Args:\n state: The integer index of a state.\n n: The number of arcs to reserve.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n\n See also: `reserve_states`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_45reserve_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__pyx_t_10basictypes_int64 __pyx_v_state;
size_t __pyx_v_n;
PyObject *__pyx_r = 0;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2396, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2408, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reserve_arcs") < 0)) __PYX_ERR(0, 2396, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reserve_arcs") < 0)) __PYX_ERR(0, 2408, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
- __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2396, __pyx_L3_error)
- __pyx_v_n = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2396, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2408, __pyx_L3_error)
+ __pyx_v_n = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2408, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2396, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2408, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.reserve_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_42reserve_arcs(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_n);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_44reserve_arcs(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_n);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_42reserve_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_44reserve_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reserve_arcs", 0);
- /* "pywrapfst.pyx":2414
+ /* "pywrapfst.pyx":2426
* See also: `reserve_states`.
* """
* self._reserve_arcs(state, n) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reserve_arcs");
- __PYX_ERR(0, 2414, __pyx_L1_error)
+ __PYX_ERR(0, 2426, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reserve_arcs(__pyx_v_self, __pyx_v_state, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2414, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reserve_arcs(__pyx_v_self, __pyx_v_state, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2426, __pyx_L1_error)
- /* "pywrapfst.pyx":2415
+ /* "pywrapfst.pyx":2427
* """
* self._reserve_arcs(state, n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2396
+ /* "pywrapfst.pyx":2408
* self._check_mutating_imethod()
*
* def reserve_arcs(self, int64 state, size_t n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2417
+/* "pywrapfst.pyx":2429
* return self
*
* cdef void _reserve_states(self, int64 n) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_reserve_states", 0);
- /* "pywrapfst.pyx":2418
+ /* "pywrapfst.pyx":2430
*
* cdef void _reserve_states(self, int64 n) except *:
* self._mfst.get().ReserveStates(n) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2418, __pyx_L1_error)
+ __PYX_ERR(0, 2430, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->ReserveStates(__pyx_v_n);
- /* "pywrapfst.pyx":2419
+ /* "pywrapfst.pyx":2431
* cdef void _reserve_states(self, int64 n) except *:
* self._mfst.get().ReserveStates(n)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2419, __pyx_L1_error)
+ __PYX_ERR(0, 2431, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2419, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2431, __pyx_L1_error)
- /* "pywrapfst.pyx":2417
+ /* "pywrapfst.pyx":2429
* return self
*
* cdef void _reserve_states(self, int64 n) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2421
+/* "pywrapfst.pyx":2433
* self._check_mutating_imethod()
*
* def reserve_states(self, int64 n): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_45reserve_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_44reserve_states[] = "\n reserve_states(self, n)\n\n Reserve n states (best effort).\n\n Args:\n n: The number of states to reserve.\n\n Returns:\n self.\n\n See also: `reserve_arcs`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_45reserve_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_47reserve_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_46reserve_states[] = "\n reserve_states(self, n)\n\n Reserve n states (best effort).\n\n Args:\n n: The number of states to reserve.\n\n Returns:\n self.\n\n See also: `reserve_arcs`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_47reserve_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
__pyx_t_10basictypes_int64 __pyx_v_n;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reserve_states (wrapper)", 0);
assert(__pyx_arg_n); {
- __pyx_v_n = __Pyx_PyInt_As_int64_t(__pyx_arg_n); if (unlikely((__pyx_v_n == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2421, __pyx_L3_error)
+ __pyx_v_n = __Pyx_PyInt_As_int64_t(__pyx_arg_n); if (unlikely((__pyx_v_n == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2433, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_44reserve_states(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_n));
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_46reserve_states(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_n));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_44reserve_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_n) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reserve_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_n) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reserve_states", 0);
- /* "pywrapfst.pyx":2435
+ /* "pywrapfst.pyx":2447
* See also: `reserve_arcs`.
* """
* self._reserve_states(n) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reserve_states");
- __PYX_ERR(0, 2435, __pyx_L1_error)
+ __PYX_ERR(0, 2447, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reserve_states(__pyx_v_self, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2435, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reserve_states(__pyx_v_self, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2447, __pyx_L1_error)
- /* "pywrapfst.pyx":2436
+ /* "pywrapfst.pyx":2448
* """
* self._reserve_states(n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2421
+ /* "pywrapfst.pyx":2433
* self._check_mutating_imethod()
*
* def reserve_states(self, int64 n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2438
+/* "pywrapfst.pyx":2450
* return self
*
* cdef void _reweight(self, potentials, bool to_final=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2440
+ /* "pywrapfst.pyx":2452
* cdef void _reweight(self, potentials, bool to_final=False) except *:
* cdef unique_ptr[vector[fst.WeightClass]] _potentials
* _potentials.reset(new vector[fst.WeightClass]()) # <<<<<<<<<<<<<<
__pyx_t_1 = new std::vector<fst::script::WeightClass> ();
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2440, __pyx_L1_error)
+ __PYX_ERR(0, 2452, __pyx_L1_error)
}
__pyx_v__potentials.reset(__pyx_t_1);
- /* "pywrapfst.pyx":2441
+ /* "pywrapfst.pyx":2453
* cdef unique_ptr[vector[fst.WeightClass]] _potentials
* _potentials.reset(new vector[fst.WeightClass]())
* cdef string weight_type = self.weight_type() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 2441, __pyx_L1_error)
+ __PYX_ERR(0, 2453, __pyx_L1_error)
}
__pyx_v_weight_type = ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0);
- /* "pywrapfst.pyx":2442
+ /* "pywrapfst.pyx":2454
* _potentials.reset(new vector[fst.WeightClass]())
* cdef string weight_type = self.weight_type()
* for weight in potentials: # <<<<<<<<<<<<<<
__pyx_t_2 = __pyx_v_potentials; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_potentials); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2442, __pyx_L1_error)
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_potentials); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2442, __pyx_L1_error)
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2454, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_4)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2442, __pyx_L1_error)
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2454, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2442, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
} else {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2442, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2454, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2442, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2442, __pyx_L1_error)
+ else __PYX_ERR(0, 2454, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_weight, __pyx_t_5);
__pyx_t_5 = 0;
- /* "pywrapfst.pyx":2443
+ /* "pywrapfst.pyx":2455
* cdef string weight_type = self.weight_type()
* for weight in potentials:
* _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 2443, __pyx_L1_error)
+ __PYX_ERR(0, 2455, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2444
+ /* "pywrapfst.pyx":2456
* for weight in potentials:
* _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),
* weight)) # <<<<<<<<<<<<<<
* fst.Reweight(self._mfst.get(), deref(_potentials),
* fst.GetReweightType(to_final))
*/
- __pyx_t_6 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2443, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2455, __pyx_L1_error)
- /* "pywrapfst.pyx":2443
+ /* "pywrapfst.pyx":2455
* cdef string weight_type = self.weight_type()
* for weight in potentials:
* _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(), # <<<<<<<<<<<<<<
__pyx_v__potentials.get()->push_back(__pyx_t_6);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2443, __pyx_L1_error)
+ __PYX_ERR(0, 2455, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2442
+ /* "pywrapfst.pyx":2454
* _potentials.reset(new vector[fst.WeightClass]())
* cdef string weight_type = self.weight_type()
* for weight in potentials: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2445
+ /* "pywrapfst.pyx":2457
* _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),
* weight))
* fst.Reweight(self._mfst.get(), deref(_potentials), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2445, __pyx_L1_error)
+ __PYX_ERR(0, 2457, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2446
+ /* "pywrapfst.pyx":2458
* weight))
* fst.Reweight(self._mfst.get(), deref(_potentials),
* fst.GetReweightType(to_final)) # <<<<<<<<<<<<<<
*/
fst::script::Reweight(__pyx_v_self->_mfst.get(), (*__pyx_v__potentials), fst::script::GetReweightType(__pyx_v_to_final));
- /* "pywrapfst.pyx":2447
+ /* "pywrapfst.pyx":2459
* fst.Reweight(self._mfst.get(), deref(_potentials),
* fst.GetReweightType(to_final))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2447, __pyx_L1_error)
+ __PYX_ERR(0, 2459, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2447, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2459, __pyx_L1_error)
- /* "pywrapfst.pyx":2438
+ /* "pywrapfst.pyx":2450
* return self
*
* cdef void _reweight(self, potentials, bool to_final=False) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2449
+/* "pywrapfst.pyx":2461
* self._check_mutating_imethod()
*
* def reweight(self, potentials, bool to_final=False): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_47reweight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_46reweight[] = "\n reweight(self, potentials, to_final=False)\n\n Reweights an FST using an iterable of potentials.\n\n This operation destructively reweights an FST according to the potentials\n and in the direction specified by the user. An arc of weight w, with an\n origin state of potential p and destination state of potential q, is\n reweighted by p^{-1} \\otimes (w \\otimes q) when reweighting towards the\n initial state, and by (p \\otimes w) \\otimes q^{-1} when reweighting towards\n the final states. The weights must be left distributive when reweighting\n towards the initial state and right distributive when reweighting towards\n the final states (e.g., TropicalWeight and LogWeight).\n\n Args:\n potentials: An iterable of Weight or weight strings.\n to_final: Push towards final states?\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_47reweight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49reweight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_48reweight[] = "\n reweight(self, potentials, to_final=False)\n\n Reweights an FST using an iterable of potentials.\n\n This operation destructively reweights an FST according to the potentials\n and in the direction specified by the user. An arc of weight w, with an\n origin state of potential p and destination state of potential q, is\n reweighted by p^{-1} \\otimes (w \\otimes q) when reweighting towards the\n initial state, and by (p \\otimes w) \\otimes q^{-1} when reweighting towards\n the final states. The weights must be left distributive when reweighting\n towards the initial state and right distributive when reweighting towards\n the final states (e.g., TropicalWeight and LogWeight).\n\n Args:\n potentials: An iterable of Weight or weight strings.\n to_final: Push towards final states?\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49reweight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_potentials = 0;
bool __pyx_v_to_final;
PyObject *__pyx_r = 0;
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reweight") < 0)) __PYX_ERR(0, 2449, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reweight") < 0)) __PYX_ERR(0, 2461, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_potentials = values[0];
if (values[1]) {
- __pyx_v_to_final = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_to_final == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2449, __pyx_L3_error)
+ __pyx_v_to_final = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_to_final == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2461, __pyx_L3_error)
} else {
__pyx_v_to_final = ((bool)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("reweight", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2449, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reweight", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2461, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.reweight", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_46reweight(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_potentials, __pyx_v_to_final);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_48reweight(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_potentials, __pyx_v_to_final);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reweight(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, bool __pyx_v_to_final) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48reweight(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, bool __pyx_v_to_final) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__reweight __pyx_t_1;
__Pyx_RefNannySetupContext("reweight", 0);
- /* "pywrapfst.pyx":2471
+ /* "pywrapfst.pyx":2483
* self.
* """
* self._reweight(potentials, to_final) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reweight");
- __PYX_ERR(0, 2471, __pyx_L1_error)
+ __PYX_ERR(0, 2483, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 1;
__pyx_t_1.to_final = __pyx_v_to_final;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reweight(__pyx_v_self, __pyx_v_potentials, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2471, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reweight(__pyx_v_self, __pyx_v_potentials, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2483, __pyx_L1_error)
- /* "pywrapfst.pyx":2472
+ /* "pywrapfst.pyx":2484
* """
* self._reweight(potentials, to_final)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2449
+ /* "pywrapfst.pyx":2461
* self._check_mutating_imethod()
*
* def reweight(self, potentials, bool to_final=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2474
+/* "pywrapfst.pyx":2486
* return self
*
* cdef void _rmepsilon(self, # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_11_MutableFst__rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon *__pyx_optional_args) {
PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":2476
+ /* "pywrapfst.pyx":2488
* cdef void _rmepsilon(self,
* queue_type=b"auto",
* bool connect=True, # <<<<<<<<<<<<<<
*/
bool __pyx_v_connect = ((bool)1);
- /* "pywrapfst.pyx":2477
+ /* "pywrapfst.pyx":2489
* queue_type=b"auto",
* bool connect=True,
* weight=None, # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2480
+ /* "pywrapfst.pyx":2492
* int64 nstate=fst.kNoStateId,
* float delta=fst.kShortestDelta) except *:
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 2480, __pyx_L1_error)
+ __PYX_ERR(0, 2492, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2481
+ /* "pywrapfst.pyx":2493
* float delta=fst.kShortestDelta) except *:
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
* weight) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.RmEpsilonOptions] opts
* opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
*/
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2480, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2492, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":2483
+ /* "pywrapfst.pyx":2495
* weight)
* cdef unique_ptr[fst.RmEpsilonOptions] opts
* opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
* connect, wc, nstate, delta))
* fst.RmEpsilon(self._mfst.get(), deref(opts))
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2483, __pyx_L1_error)
- __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2483, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2495, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2495, __pyx_L1_error)
- /* "pywrapfst.pyx":2484
+ /* "pywrapfst.pyx":2496
* cdef unique_ptr[fst.RmEpsilonOptions] opts
* opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
* connect, wc, nstate, delta)) # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::script::RmEpsilonOptions(__pyx_t_3, __pyx_v_connect, __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta));
- /* "pywrapfst.pyx":2485
+ /* "pywrapfst.pyx":2497
* opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
* connect, wc, nstate, delta))
* fst.RmEpsilon(self._mfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2485, __pyx_L1_error)
+ __PYX_ERR(0, 2497, __pyx_L1_error)
}
fst::script::RmEpsilon(__pyx_v_self->_mfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":2486
+ /* "pywrapfst.pyx":2498
* connect, wc, nstate, delta))
* fst.RmEpsilon(self._mfst.get(), deref(opts))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2486, __pyx_L1_error)
+ __PYX_ERR(0, 2498, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2486, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2498, __pyx_L1_error)
- /* "pywrapfst.pyx":2474
+ /* "pywrapfst.pyx":2486
* return self
*
* cdef void _rmepsilon(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2488
+/* "pywrapfst.pyx":2500
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_48rmepsilon[] = "\n rmepsilon(self, queue_type=\"auto\", connect=True, weight=None,\n nstate=NO_STATE_ID, delta=1e-6):\n\n Removes epsilon transitions.\n\n This operation destructively removes epsilon transitions, i.e., those where\n both input and output labels are epsilon) from an FST.\n\n Args:\n queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n \"lifo\", \"shortest\", \"state\", \"top\".\n connect: Should output be trimmed?\n weight: A Weight or weight string indicating the desired weight threshold\n below which paths are pruned; if omitted, no paths are pruned.\n nstate: State number threshold.\n delta: Comparison/quantization delta.\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_51rmepsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_50rmepsilon[] = "\n rmepsilon(self, queue_type=\"auto\", connect=True, weight=None,\n nstate=NO_STATE_ID, delta=1e-6):\n\n Removes epsilon transitions.\n\n This operation destructively removes epsilon transitions, i.e., those where\n both input and output labels are epsilon) from an FST.\n\n Args:\n queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n \"lifo\", \"shortest\", \"state\", \"top\".\n connect: Should output be trimmed?\n weight: A Weight or weight string indicating the desired weight threshold\n below which paths are pruned; if omitted, no paths are pruned.\n nstate: State number threshold.\n delta: Comparison/quantization delta.\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_51rmepsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_queue_type = 0;
bool __pyx_v_connect;
PyObject *__pyx_v_weight = 0;
PyObject* values[5] = {0,0,0,0,0};
values[0] = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":2491
+ /* "pywrapfst.pyx":2503
* queue_type=b"auto",
* bool connect=True,
* weight=None, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 2488, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 2500, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_queue_type = values[0];
if (values[1]) {
- __pyx_v_connect = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2490, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2502, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2490
+ /* "pywrapfst.pyx":2502
* def rmepsilon(self,
* queue_type=b"auto",
* bool connect=True, # <<<<<<<<<<<<<<
}
__pyx_v_weight = values[2];
if (values[3]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2492, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2504, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__21;
}
if (values[4]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2493, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2505, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__22;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2488, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2500, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_queue_type, __pyx_v_connect, __pyx_v_weight, __pyx_v_nstate, __pyx_v_delta);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_50rmepsilon(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_queue_type, __pyx_v_connect, __pyx_v_weight, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":2488
+ /* "pywrapfst.pyx":2500
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, __pyx_t_10basictypes_int64 __pyx_v_nstate, float __pyx_v_delta) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_50rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, __pyx_t_10basictypes_int64 __pyx_v_nstate, float __pyx_v_delta) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon __pyx_t_1;
__Pyx_RefNannySetupContext("rmepsilon", 0);
- /* "pywrapfst.pyx":2515
+ /* "pywrapfst.pyx":2527
* self.
* """
* self._rmepsilon(queue_type, connect, weight, nstate, delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_rmepsilon");
- __PYX_ERR(0, 2515, __pyx_L1_error)
+ __PYX_ERR(0, 2527, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 5;
__pyx_t_1.queue_type = __pyx_v_queue_type;
__pyx_t_1.weight = __pyx_v_weight;
__pyx_t_1.nstate = __pyx_v_nstate;
__pyx_t_1.delta = __pyx_v_delta;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_rmepsilon(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2515, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_rmepsilon(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L1_error)
- /* "pywrapfst.pyx":2516
+ /* "pywrapfst.pyx":2528
* """
* self._rmepsilon(queue_type, connect, weight, nstate, delta)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2488
+ /* "pywrapfst.pyx":2500
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2518
+/* "pywrapfst.pyx":2530
* return self
*
* cdef void _set_final(self, int64 state, weight=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2519
+ /* "pywrapfst.pyx":2531
*
* cdef void _set_final(self, int64 state, weight=None) except *:
* if not self._mfst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2519, __pyx_L1_error)
+ __PYX_ERR(0, 2531, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2520
+ /* "pywrapfst.pyx":2532
* cdef void _set_final(self, int64 state, weight=None) except *:
* if not self._mfst.get().ValidStateId(state):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
* weight)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2520, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2520, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 2520, __pyx_L1_error)
+ __PYX_ERR(0, 2532, __pyx_L1_error)
- /* "pywrapfst.pyx":2519
+ /* "pywrapfst.pyx":2531
*
* cdef void _set_final(self, int64 state, weight=None) except *:
* if not self._mfst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2521
+ /* "pywrapfst.pyx":2533
* if not self._mfst.get().ValidStateId(state):
* raise FstIndexError("State index out of range")
* cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 2521, __pyx_L1_error)
+ __PYX_ERR(0, 2533, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2522
+ /* "pywrapfst.pyx":2534
* raise FstIndexError("State index out of range")
* cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
* weight) # <<<<<<<<<<<<<<
* if not self._mfst.get().SetFinal(state, wc):
* raise FstOpError("Incompatible or invalid weight")
*/
- __pyx_t_5 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2521, __pyx_L1_error)
+ __pyx_t_5 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2533, __pyx_L1_error)
__pyx_v_wc = __pyx_t_5;
- /* "pywrapfst.pyx":2523
+ /* "pywrapfst.pyx":2535
* cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
* weight)
* if not self._mfst.get().SetFinal(state, wc): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2523, __pyx_L1_error)
+ __PYX_ERR(0, 2535, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetFinal(__pyx_v_state, __pyx_v_wc) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2524
+ /* "pywrapfst.pyx":2536
* weight)
* if not self._mfst.get().SetFinal(state, wc):
* raise FstOpError("Incompatible or invalid weight") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2524, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2536, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Incompatible_or_invalid_weight) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Incompatible_or_invalid_weight);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2524, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2536, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 2524, __pyx_L1_error)
+ __PYX_ERR(0, 2536, __pyx_L1_error)
- /* "pywrapfst.pyx":2523
+ /* "pywrapfst.pyx":2535
* cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
* weight)
* if not self._mfst.get().SetFinal(state, wc): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2525
+ /* "pywrapfst.pyx":2537
* if not self._mfst.get().SetFinal(state, wc):
* raise FstOpError("Incompatible or invalid weight")
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2525, __pyx_L1_error)
+ __PYX_ERR(0, 2537, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2525, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2537, __pyx_L1_error)
- /* "pywrapfst.pyx":2518
+ /* "pywrapfst.pyx":2530
* return self
*
* cdef void _set_final(self, int64 state, weight=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2527
+/* "pywrapfst.pyx":2539
* self._check_mutating_imethod()
*
* def set_final(self, int64 state, weight=None): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_51set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_50set_final[] = "\n set_final(self, state, weight)\n\n Sets the final weight for a state.\n\n Args:\n state: The integer index of a state.\n weight: A Weight or weight string indicating the desired final weight; if\n omitted, it is set to semiring One.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n FstOpError: Incompatible or invalid weight.\n\n See also: `set_start`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_51set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_53set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_52set_final[] = "\n set_final(self, state, weight)\n\n Sets the final weight for a state.\n\n Args:\n state: The integer index of a state.\n weight: A Weight or weight string indicating the desired final weight; if\n omitted, it is set to semiring One.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n FstOpError: Incompatible or invalid weight.\n\n See also: `set_start`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_53set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__pyx_t_10basictypes_int64 __pyx_v_state;
PyObject *__pyx_v_weight = 0;
PyObject *__pyx_r = 0;
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2527, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2539, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2539, __pyx_L3_error)
__pyx_v_weight = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("set_final", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2527, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_final", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2539, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.set_final", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_50set_final(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_weight);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_52set_final(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_weight);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_50set_final(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, PyObject *__pyx_v_weight) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_52set_final(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, PyObject *__pyx_v_weight) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__set_final __pyx_t_1;
__Pyx_RefNannySetupContext("set_final", 0);
- /* "pywrapfst.pyx":2547
+ /* "pywrapfst.pyx":2559
* See also: `set_start`.
* """
* self._set_final(state, weight) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_final");
- __PYX_ERR(0, 2547, __pyx_L1_error)
+ __PYX_ERR(0, 2559, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 1;
__pyx_t_1.weight = __pyx_v_weight;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_final(__pyx_v_self, __pyx_v_state, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2547, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_final(__pyx_v_self, __pyx_v_state, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L1_error)
- /* "pywrapfst.pyx":2548
+ /* "pywrapfst.pyx":2560
* """
* self._set_final(state, weight)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2527
+ /* "pywrapfst.pyx":2539
* self._check_mutating_imethod()
*
* def set_final(self, int64 state, weight=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2550
+/* "pywrapfst.pyx":2562
* return self
*
* cdef void _set_input_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
int __pyx_t_2;
__Pyx_RefNannySetupContext("_set_input_symbols", 0);
- /* "pywrapfst.pyx":2551
+ /* "pywrapfst.pyx":2563
*
* cdef void _set_input_symbols(self, _SymbolTable syms) except *:
* if syms is None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2552
+ /* "pywrapfst.pyx":2564
* cdef void _set_input_symbols(self, _SymbolTable syms) except *:
* if syms is None:
* self._mfst.get().SetInputSymbols(NULL) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2552, __pyx_L1_error)
+ __PYX_ERR(0, 2564, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetInputSymbols(NULL);
- /* "pywrapfst.pyx":2553
+ /* "pywrapfst.pyx":2565
* if syms is None:
* self._mfst.get().SetInputSymbols(NULL)
* return # <<<<<<<<<<<<<<
*/
goto __pyx_L0;
- /* "pywrapfst.pyx":2551
+ /* "pywrapfst.pyx":2563
*
* cdef void _set_input_symbols(self, _SymbolTable syms) except *:
* if syms is None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2554
+ /* "pywrapfst.pyx":2566
* self._mfst.get().SetInputSymbols(NULL)
* return
* self._mfst.get().SetInputSymbols(syms._table) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2554, __pyx_L1_error)
+ __PYX_ERR(0, 2566, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 2554, __pyx_L1_error)
+ __PYX_ERR(0, 2566, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetInputSymbols(__pyx_v_syms->_table);
- /* "pywrapfst.pyx":2555
+ /* "pywrapfst.pyx":2567
* return
* self._mfst.get().SetInputSymbols(syms._table)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2555, __pyx_L1_error)
+ __PYX_ERR(0, 2567, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2555, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2567, __pyx_L1_error)
- /* "pywrapfst.pyx":2550
+ /* "pywrapfst.pyx":2562
* return self
*
* cdef void _set_input_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2557
+/* "pywrapfst.pyx":2569
* self._check_mutating_imethod()
*
* def set_input_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_53set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_52set_input_symbols[] = "\n set_input_symbols(self, syms)\n\n Sets the input symbol table.\n\n Passing None as a value will delete the input symbol table.\n\n Args:\n syms: A SymbolTable.\n\n Returns:\n self.\n\n See also: `set_output_symbols`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_53set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_55set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_54set_input_symbols[] = "\n set_input_symbols(self, syms)\n\n Sets the input symbol table.\n\n Passing None as a value will delete the input symbol table.\n\n Args:\n syms: A SymbolTable.\n\n Returns:\n self.\n\n See also: `set_output_symbols`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_55set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_input_symbols (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 2557, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_52set_input_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 2569, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_54set_input_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
/* function exit code */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_52set_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_54set_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_input_symbols", 0);
- /* "pywrapfst.pyx":2573
+ /* "pywrapfst.pyx":2585
* See also: `set_output_symbols`.
* """
* self._set_input_symbols(syms) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_input_symbols");
- __PYX_ERR(0, 2573, __pyx_L1_error)
+ __PYX_ERR(0, 2585, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2573, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2585, __pyx_L1_error)
- /* "pywrapfst.pyx":2574
+ /* "pywrapfst.pyx":2586
* """
* self._set_input_symbols(syms)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2557
+ /* "pywrapfst.pyx":2569
* self._check_mutating_imethod()
*
* def set_input_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2576
+/* "pywrapfst.pyx":2588
* return self
*
* cdef void _set_output_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
int __pyx_t_2;
__Pyx_RefNannySetupContext("_set_output_symbols", 0);
- /* "pywrapfst.pyx":2577
+ /* "pywrapfst.pyx":2589
*
* cdef void _set_output_symbols(self, _SymbolTable syms) except *:
* if syms is None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2578
+ /* "pywrapfst.pyx":2590
* cdef void _set_output_symbols(self, _SymbolTable syms) except *:
* if syms is None:
* self._mfst.get().SetOutputSymbols(NULL) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2578, __pyx_L1_error)
+ __PYX_ERR(0, 2590, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetOutputSymbols(NULL);
- /* "pywrapfst.pyx":2579
+ /* "pywrapfst.pyx":2591
* if syms is None:
* self._mfst.get().SetOutputSymbols(NULL)
* return # <<<<<<<<<<<<<<
*/
goto __pyx_L0;
- /* "pywrapfst.pyx":2577
+ /* "pywrapfst.pyx":2589
*
* cdef void _set_output_symbols(self, _SymbolTable syms) except *:
* if syms is None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2580
+ /* "pywrapfst.pyx":2592
* self._mfst.get().SetOutputSymbols(NULL)
* return
* self._mfst.get().SetOutputSymbols(syms._table) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2580, __pyx_L1_error)
+ __PYX_ERR(0, 2592, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 2580, __pyx_L1_error)
+ __PYX_ERR(0, 2592, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetOutputSymbols(__pyx_v_syms->_table);
- /* "pywrapfst.pyx":2581
+ /* "pywrapfst.pyx":2593
* return
* self._mfst.get().SetOutputSymbols(syms._table)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2581, __pyx_L1_error)
+ __PYX_ERR(0, 2593, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2581, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2593, __pyx_L1_error)
- /* "pywrapfst.pyx":2576
+ /* "pywrapfst.pyx":2588
* return self
*
* cdef void _set_output_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2583
+/* "pywrapfst.pyx":2595
* self._check_mutating_imethod()
*
* def set_output_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_55set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_54set_output_symbols[] = "\n set_output_symbols(self, syms)\n\n Sets the output symbol table.\n\n Passing None as a value will delete the output symbol table.\n\n Args:\n syms: A SymbolTable.\n\n Returns:\n self.\n\n See also: `set_input_symbols`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_55set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_57set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_56set_output_symbols[] = "\n set_output_symbols(self, syms)\n\n Sets the output symbol table.\n\n Passing None as a value will delete the output symbol table.\n\n Args:\n syms: A SymbolTable.\n\n Returns:\n self.\n\n See also: `set_input_symbols`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_57set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_output_symbols (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 2583, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_54set_output_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 2595, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_56set_output_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
/* function exit code */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_54set_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_56set_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_output_symbols", 0);
- /* "pywrapfst.pyx":2599
+ /* "pywrapfst.pyx":2611
* See also: `set_input_symbols`.
* """
* self._set_output_symbols(syms) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_output_symbols");
- __PYX_ERR(0, 2599, __pyx_L1_error)
+ __PYX_ERR(0, 2611, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2599, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2611, __pyx_L1_error)
- /* "pywrapfst.pyx":2600
+ /* "pywrapfst.pyx":2612
* """
* self._set_output_symbols(syms)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2583
+ /* "pywrapfst.pyx":2595
* self._check_mutating_imethod()
*
* def set_output_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2602
+/* "pywrapfst.pyx":2614
* return self
*
* cdef void _set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_set_properties", 0);
- /* "pywrapfst.pyx":2603
+ /* "pywrapfst.pyx":2615
*
* cdef void _set_properties(self, uint64 props, uint64 mask):
* self._mfst.get().SetProperties(props, mask) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2603, __pyx_L1_error)
+ __PYX_ERR(0, 2615, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetProperties(__pyx_v_props, __pyx_v_mask);
- /* "pywrapfst.pyx":2602
+ /* "pywrapfst.pyx":2614
* return self
*
* cdef void _set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2605
+/* "pywrapfst.pyx":2617
* self._mfst.get().SetProperties(props, mask)
*
* def set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_57set_properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_56set_properties[] = "\n set_properties(self, props, mask)\n\n Sets the properties bits.\n\n Args:\n props: The properties to be set.\n mask: A mask to be applied to the `props` argument before setting the\n FST's properties.\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_57set_properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_59set_properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_58set_properties[] = "\n set_properties(self, props, mask)\n\n Sets the properties bits.\n\n Args:\n props: The properties to be set.\n mask: A mask to be applied to the `props` argument before setting the\n FST's properties.\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_59set_properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__pyx_t_10basictypes_uint64 __pyx_v_props;
__pyx_t_10basictypes_uint64 __pyx_v_mask;
PyObject *__pyx_r = 0;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, 1); __PYX_ERR(0, 2605, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, 1); __PYX_ERR(0, 2617, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_properties") < 0)) __PYX_ERR(0, 2605, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_properties") < 0)) __PYX_ERR(0, 2617, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
- __pyx_v_props = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_props == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2605, __pyx_L3_error)
- __pyx_v_mask = __Pyx_PyInt_As_uint64_t(values[1]); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2605, __pyx_L3_error)
+ __pyx_v_props = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_props == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2617, __pyx_L3_error)
+ __pyx_v_mask = __Pyx_PyInt_As_uint64_t(values[1]); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2617, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2605, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2617, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.set_properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_56set_properties(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_props, __pyx_v_mask);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_58set_properties(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_props, __pyx_v_mask);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_56set_properties(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_props, __pyx_t_10basictypes_uint64 __pyx_v_mask) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_58set_properties(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_props, __pyx_t_10basictypes_uint64 __pyx_v_mask) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_properties", 0);
- /* "pywrapfst.pyx":2619
+ /* "pywrapfst.pyx":2631
* self.
* """
* self._set_properties(props, mask) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_properties");
- __PYX_ERR(0, 2619, __pyx_L1_error)
+ __PYX_ERR(0, 2631, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_properties(__pyx_v_self, __pyx_v_props, __pyx_v_mask);
- /* "pywrapfst.pyx":2620
+ /* "pywrapfst.pyx":2632
* """
* self._set_properties(props, mask)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2605
+ /* "pywrapfst.pyx":2617
* self._mfst.get().SetProperties(props, mask)
*
* def set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2622
+/* "pywrapfst.pyx":2634
* return self
*
* cdef void _set_start(self, int64 state) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("_set_start", 0);
- /* "pywrapfst.pyx":2623
+ /* "pywrapfst.pyx":2635
*
* cdef void _set_start(self, int64 state) except *:
* if not self._mfst.get().SetStart(state): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2623, __pyx_L1_error)
+ __PYX_ERR(0, 2635, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetStart(__pyx_v_state) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2624
+ /* "pywrapfst.pyx":2636
* cdef void _set_start(self, int64 state) except *:
* if not self._mfst.get().SetStart(state):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2624, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2636, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2624, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2636, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 2624, __pyx_L1_error)
+ __PYX_ERR(0, 2636, __pyx_L1_error)
- /* "pywrapfst.pyx":2623
+ /* "pywrapfst.pyx":2635
*
* cdef void _set_start(self, int64 state) except *:
* if not self._mfst.get().SetStart(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2625
+ /* "pywrapfst.pyx":2637
* if not self._mfst.get().SetStart(state):
* raise FstIndexError("State index out of range")
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2625, __pyx_L1_error)
+ __PYX_ERR(0, 2637, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2625, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2637, __pyx_L1_error)
- /* "pywrapfst.pyx":2622
+ /* "pywrapfst.pyx":2634
* return self
*
* cdef void _set_start(self, int64 state) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2627
+/* "pywrapfst.pyx":2639
* self._check_mutating_imethod()
*
* def set_start(self, int64 state): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_59set_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_58set_start[] = "\n set_start(self, state)\n\n Sets a state to be the initial state state.\n\n Args:\n state: The integer index of a state.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n\n See also: `set_final`.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_59set_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_61set_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_60set_start[] = "\n set_start(self, state)\n\n Sets a state to be the initial state state.\n\n Args:\n state: The integer index of a state.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n\n See also: `set_final`.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_61set_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
__pyx_t_10basictypes_int64 __pyx_v_state;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_start (wrapper)", 0);
assert(__pyx_arg_state); {
- __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2627, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2639, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_58set_start(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_state));
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_60set_start(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_state));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_58set_start(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_60set_start(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_start", 0);
- /* "pywrapfst.pyx":2644
+ /* "pywrapfst.pyx":2656
* See also: `set_final`.
* """
* self._set_start(state) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_start");
- __PYX_ERR(0, 2644, __pyx_L1_error)
+ __PYX_ERR(0, 2656, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_start(__pyx_v_self, __pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2644, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_start(__pyx_v_self, __pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2656, __pyx_L1_error)
- /* "pywrapfst.pyx":2645
+ /* "pywrapfst.pyx":2657
* """
* self._set_start(state)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2627
+ /* "pywrapfst.pyx":2639
* self._check_mutating_imethod()
*
* def set_start(self, int64 state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2647
+/* "pywrapfst.pyx":2659
* return self
*
* cdef void _topsort(self) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("_topsort", 0);
- /* "pywrapfst.pyx":2649
+ /* "pywrapfst.pyx":2661
* cdef void _topsort(self) except *:
* # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
* if not fst.TopSort(self._mfst.get()): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2649, __pyx_L1_error)
+ __PYX_ERR(0, 2661, __pyx_L1_error)
}
__pyx_t_1 = ((!(fst::script::TopSort(__pyx_v_self->_mfst.get()) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2650
+ /* "pywrapfst.pyx":2662
* # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
* if not fst.TopSort(self._mfst.get()):
* logging.warning("Cannot topsort cyclic FST") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logging); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2650, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logging); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warning); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2650, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warning); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
}
__pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_u_Cannot_topsort_cyclic_FST) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Cannot_topsort_cyclic_FST);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2650, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2649
+ /* "pywrapfst.pyx":2661
* cdef void _topsort(self) except *:
* # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
* if not fst.TopSort(self._mfst.get()): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2651
+ /* "pywrapfst.pyx":2663
* if not fst.TopSort(self._mfst.get()):
* logging.warning("Cannot topsort cyclic FST")
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2651, __pyx_L1_error)
+ __PYX_ERR(0, 2663, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2651, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2663, __pyx_L1_error)
- /* "pywrapfst.pyx":2647
+ /* "pywrapfst.pyx":2659
* return self
*
* cdef void _topsort(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2653
+/* "pywrapfst.pyx":2665
* self._check_mutating_imethod()
*
* def topsort(self): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_61topsort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_60topsort[] = "\n topsort(self)\n\n Sorts transitions by state IDs.\n\n This operation destructively topologically sorts the FST, if it is acyclic;\n otherwise it remains unchanged. Once sorted, all transitions are from lower\n state IDs to higher state IDs\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_61topsort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_63topsort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_62topsort[] = "\n topsort(self)\n\n Sorts transitions by state IDs.\n\n This operation destructively topologically sorts the FST, if it is acyclic;\n otherwise it remains unchanged. Once sorted, all transitions are from lower\n state IDs to higher state IDs\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_63topsort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("topsort (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_60topsort(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_62topsort(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_60topsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_62topsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("topsort", 0);
- /* "pywrapfst.pyx":2666
+ /* "pywrapfst.pyx":2678
* self.
* """
* self._topsort() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_topsort");
- __PYX_ERR(0, 2666, __pyx_L1_error)
+ __PYX_ERR(0, 2678, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_topsort(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2666, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_topsort(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2678, __pyx_L1_error)
- /* "pywrapfst.pyx":2667
+ /* "pywrapfst.pyx":2679
* """
* self._topsort()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2653
+ /* "pywrapfst.pyx":2665
* self._check_mutating_imethod()
*
* def topsort(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2669
+/* "pywrapfst.pyx":2681
* return self
*
* cdef void _union(self, _Fst ifst) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_union", 0);
- /* "pywrapfst.pyx":2670
+ /* "pywrapfst.pyx":2682
*
* cdef void _union(self, _Fst ifst) except *:
* fst.Union(self._mfst.get(), deref(ifst._fst)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2670, __pyx_L1_error)
+ __PYX_ERR(0, 2682, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2670, __pyx_L1_error)
+ __PYX_ERR(0, 2682, __pyx_L1_error)
}
fst::script::Union(__pyx_v_self->_mfst.get(), (*__pyx_v_ifst->_fst));
- /* "pywrapfst.pyx":2671
+ /* "pywrapfst.pyx":2683
* cdef void _union(self, _Fst ifst) except *:
* fst.Union(self._mfst.get(), deref(ifst._fst))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2671, __pyx_L1_error)
+ __PYX_ERR(0, 2683, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2671, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2683, __pyx_L1_error)
- /* "pywrapfst.pyx":2669
+ /* "pywrapfst.pyx":2681
* return self
*
* cdef void _union(self, _Fst ifst) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2673
+/* "pywrapfst.pyx":2685
* self._check_mutating_imethod()
*
* def union(self, _Fst ifst): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_63union(PyObject *__pyx_v_self, PyObject *__pyx_v_ifst); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_62union[] = "\n union(self, ifst)\n\n Computes the union (sum) of two FSTs.\n\n This operation computes the union (sum) of two FSTs. If A transduces string\n x to y with weight a and B transduces string w to v with weight b, then\n their union transduces x to y with weight a and w to v with weight b.\n\n Args:\n ifst: The second input FST.\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_63union(PyObject *__pyx_v_self, PyObject *__pyx_v_ifst) {
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_65union(PyObject *__pyx_v_self, PyObject *__pyx_v_ifst); /*proto*/
+static char __pyx_doc_9pywrapfst_11_MutableFst_64union[] = "\n union(self, ifst)\n\n Computes the union (sum) of two FSTs.\n\n This operation computes the union (sum) of two FSTs. If A transduces string\n x to y with weight a and B transduces string w to v with weight b, then\n their union transduces x to y with weight a and w to v with weight b.\n\n Args:\n ifst: The second input FST.\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_65union(PyObject *__pyx_v_self, PyObject *__pyx_v_ifst) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("union (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 2673, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_62union(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_ifst));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 2685, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_64union(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_ifst));
/* function exit code */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_62union(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_64union(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("union", 0);
- /* "pywrapfst.pyx":2689
+ /* "pywrapfst.pyx":2701
* self.
* """
* self._union(ifst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_union");
- __PYX_ERR(0, 2689, __pyx_L1_error)
+ __PYX_ERR(0, 2701, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_union(__pyx_v_self, __pyx_v_ifst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2689, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_union(__pyx_v_self, __pyx_v_ifst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2701, __pyx_L1_error)
- /* "pywrapfst.pyx":2690
+ /* "pywrapfst.pyx":2702
* """
* self._union(ifst)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2673
+ /* "pywrapfst.pyx":2685
* self._check_mutating_imethod()
*
* def union(self, _Fst ifst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2715
+/* "pywrapfst.pyx":2727
*
*
* cdef _Fst _init_Fst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("_init_Fst", 0);
- /* "pywrapfst.pyx":2716
+ /* "pywrapfst.pyx":2728
*
* cdef _Fst _init_Fst(FstClass_ptr tfst):
* if tfst.Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_tfst->Properties(fst::kError, 1) == fst::kError) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2717
+ /* "pywrapfst.pyx":2729
* cdef _Fst _init_Fst(FstClass_ptr tfst):
* if tfst.Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed") # <<<<<<<<<<<<<<
* cdef _Fst ofst = _Fst.__new__(_Fst)
* ofst._fst.reset(tfst)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2717, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2729, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Operation_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Operation_failed);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2717, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2729, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 2717, __pyx_L1_error)
+ __PYX_ERR(0, 2729, __pyx_L1_error)
- /* "pywrapfst.pyx":2716
+ /* "pywrapfst.pyx":2728
*
* cdef _Fst _init_Fst(FstClass_ptr tfst):
* if tfst.Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2718
+ /* "pywrapfst.pyx":2730
* if tfst.Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed")
* cdef _Fst ofst = _Fst.__new__(_Fst) # <<<<<<<<<<<<<<
* ofst._fst.reset(tfst)
* return ofst
*/
- __pyx_t_2 = ((PyObject *)__pyx_tp_new_9pywrapfst__Fst(((PyTypeObject *)__pyx_ptype_9pywrapfst__Fst), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2718, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_tp_new_9pywrapfst__Fst(((PyTypeObject *)__pyx_ptype_9pywrapfst__Fst), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2730, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__pyx_v_ofst = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":2719
+ /* "pywrapfst.pyx":2731
* raise FstOpError("Operation failed")
* cdef _Fst ofst = _Fst.__new__(_Fst)
* ofst._fst.reset(tfst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2719, __pyx_L1_error)
+ __PYX_ERR(0, 2731, __pyx_L1_error)
}
__pyx_v_ofst->_fst.reset(__pyx_v_tfst);
- /* "pywrapfst.pyx":2720
+ /* "pywrapfst.pyx":2732
* cdef _Fst ofst = _Fst.__new__(_Fst)
* ofst._fst.reset(tfst)
* return ofst # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_ofst;
goto __pyx_L0;
- /* "pywrapfst.pyx":2715
+ /* "pywrapfst.pyx":2727
*
*
* cdef _Fst _init_Fst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2723
+/* "pywrapfst.pyx":2735
*
*
* cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("_init_MutableFst", 0);
- /* "pywrapfst.pyx":2724
+ /* "pywrapfst.pyx":2736
*
* cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
* if tfst.Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_tfst->Properties(fst::kError, 1) == fst::kError) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2725
+ /* "pywrapfst.pyx":2737
* cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
* if tfst.Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed") # <<<<<<<<<<<<<<
* cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
* ofst._fst.reset(tfst)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2725, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2737, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Operation_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Operation_failed);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2725, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2737, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 2725, __pyx_L1_error)
+ __PYX_ERR(0, 2737, __pyx_L1_error)
- /* "pywrapfst.pyx":2724
+ /* "pywrapfst.pyx":2736
*
* cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
* if tfst.Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2726
+ /* "pywrapfst.pyx":2738
* if tfst.Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed")
* cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst) # <<<<<<<<<<<<<<
* ofst._fst.reset(tfst)
* # Makes a copy of it as the derived type! Cool.
*/
- __pyx_t_2 = ((PyObject *)__pyx_tp_new_9pywrapfst__MutableFst(((PyTypeObject *)__pyx_ptype_9pywrapfst__MutableFst), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2726, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_tp_new_9pywrapfst__MutableFst(((PyTypeObject *)__pyx_ptype_9pywrapfst__MutableFst), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2738, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__pyx_v_ofst = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":2727
+ /* "pywrapfst.pyx":2739
* raise FstOpError("Operation failed")
* cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
* ofst._fst.reset(tfst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2727, __pyx_L1_error)
+ __PYX_ERR(0, 2739, __pyx_L1_error)
}
__pyx_v_ofst->__pyx_base._fst.reset(__pyx_v_tfst);
- /* "pywrapfst.pyx":2729
+ /* "pywrapfst.pyx":2741
* ofst._fst.reset(tfst)
* # Makes a copy of it as the derived type! Cool.
* ofst._mfst = static_pointer_cast[fst.MutableFstClass, fst.FstClass](ofst._fst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2729, __pyx_L1_error)
+ __PYX_ERR(0, 2741, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2729, __pyx_L1_error)
+ __PYX_ERR(0, 2741, __pyx_L1_error)
}
__pyx_v_ofst->_mfst = std::static_pointer_cast<fst::script::MutableFstClass,fst::script::FstClass>(__pyx_v_ofst->__pyx_base._fst);
- /* "pywrapfst.pyx":2730
+ /* "pywrapfst.pyx":2742
* # Makes a copy of it as the derived type! Cool.
* ofst._mfst = static_pointer_cast[fst.MutableFstClass, fst.FstClass](ofst._fst)
* return ofst # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_ofst;
goto __pyx_L0;
- /* "pywrapfst.pyx":2723
+ /* "pywrapfst.pyx":2735
*
*
* cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2733
+/* "pywrapfst.pyx":2745
*
*
* cdef _Fst _init_XFst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("_init_XFst", 0);
- /* "pywrapfst.pyx":2734
+ /* "pywrapfst.pyx":2746
*
* cdef _Fst _init_XFst(FstClass_ptr tfst):
* if tfst.Properties(fst.kMutable, True) == fst.kMutable: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_tfst->Properties(fst::kMutable, 1) == fst::kMutable) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2735
+ /* "pywrapfst.pyx":2747
* cdef _Fst _init_XFst(FstClass_ptr tfst):
* if tfst.Properties(fst.kMutable, True) == fst.kMutable:
* return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst)) # <<<<<<<<<<<<<<
* return _init_Fst(tfst)
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(static_cast<__pyx_t_9pywrapfst_MutableFstClass_ptr>(__pyx_v_tfst))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(static_cast<__pyx_t_9pywrapfst_MutableFstClass_ptr>(__pyx_v_tfst))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2734
+ /* "pywrapfst.pyx":2746
*
* cdef _Fst _init_XFst(FstClass_ptr tfst):
* if tfst.Properties(fst.kMutable, True) == fst.kMutable: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2737
+ /* "pywrapfst.pyx":2749
* return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
* else:
* return _init_Fst(tfst) # <<<<<<<<<<<<<<
*/
/*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_Fst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2737, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_Fst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2749, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "pywrapfst.pyx":2733
+ /* "pywrapfst.pyx":2745
*
*
* cdef _Fst _init_XFst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2740
+/* "pywrapfst.pyx":2752
*
*
* cdef _MutableFst _create_Fst(arc_type=b"standard"): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2742
+ /* "pywrapfst.pyx":2754
* cdef _MutableFst _create_Fst(arc_type=b"standard"):
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(tostring(arc_type))) # <<<<<<<<<<<<<<
* if tfst.get() == NULL:
* raise FstOpError("Unknown arc type: {!r}".format(arc_type))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2742, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2754, __pyx_L1_error)
__pyx_v_tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));
- /* "pywrapfst.pyx":2743
+ /* "pywrapfst.pyx":2755
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_tfst.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":2744
+ /* "pywrapfst.pyx":2756
* tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
* if tfst.get() == NULL:
* raise FstOpError("Unknown arc type: {!r}".format(arc_type)) # <<<<<<<<<<<<<<
* return _init_MutableFst(tfst.release())
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2744, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_arc_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2744, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_arc_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
__pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_arc_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_arc_type);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2744, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
__pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2744, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2744, __pyx_L1_error)
+ __PYX_ERR(0, 2756, __pyx_L1_error)
- /* "pywrapfst.pyx":2743
+ /* "pywrapfst.pyx":2755
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2745
+ /* "pywrapfst.pyx":2757
* if tfst.get() == NULL:
* raise FstOpError("Unknown arc type: {!r}".format(arc_type))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2745, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2740
+ /* "pywrapfst.pyx":2752
*
*
* cdef _MutableFst _create_Fst(arc_type=b"standard"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2748
+/* "pywrapfst.pyx":2760
*
*
* cpdef _Fst _read(filename): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("_read", 0);
- /* "pywrapfst.pyx":2750
+ /* "pywrapfst.pyx":2762
* cpdef _Fst _read(filename):
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.FstClass.Read(tostring(filename))) # <<<<<<<<<<<<<<
* if tfst.get() == NULL:
* raise FstIOError("Read failed: {!r}".format(filename))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2750, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2762, __pyx_L1_error)
__pyx_v_tfst.reset(fst::script::FstClass::Read(__pyx_t_1));
- /* "pywrapfst.pyx":2751
+ /* "pywrapfst.pyx":2763
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.FstClass.Read(tostring(filename)))
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_tfst.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":2752
+ /* "pywrapfst.pyx":2764
* tfst.reset(fst.FstClass.Read(tostring(filename)))
* if tfst.get() == NULL:
* raise FstIOError("Read failed: {!r}".format(filename)) # <<<<<<<<<<<<<<
* return _init_XFst(tfst.release())
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2752, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2764, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2752, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2764, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
__pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_filename) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2752, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2764, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
__pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2752, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2764, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2752, __pyx_L1_error)
+ __PYX_ERR(0, 2764, __pyx_L1_error)
- /* "pywrapfst.pyx":2751
+ /* "pywrapfst.pyx":2763
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.FstClass.Read(tostring(filename)))
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2753
+ /* "pywrapfst.pyx":2765
* if tfst.get() == NULL:
* raise FstIOError("Read failed: {!r}".format(filename))
* return _init_XFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2753, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2765, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2748
+ /* "pywrapfst.pyx":2760
*
*
* cpdef _Fst _read(filename): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_read", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read(__pyx_v_filename, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2748, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read(__pyx_v_filename, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2760, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2756
+/* "pywrapfst.pyx":2768
*
*
* cpdef _Fst _read_Fst_from_string(state): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("_read_Fst_from_string", 0);
- /* "pywrapfst.pyx":2758
+ /* "pywrapfst.pyx":2770
* cpdef _Fst _read_Fst_from_string(state):
* cdef stringstream sstrm
* sstrm << tostring(state) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.FstClass.ReadStream(sstrm, b"<pywrapfst>"))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2758, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2770, __pyx_L1_error)
(void)((__pyx_v_sstrm << __pyx_t_1));
- /* "pywrapfst.pyx":2760
+ /* "pywrapfst.pyx":2772
* sstrm << tostring(state)
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.FstClass.ReadStream(sstrm, b"<pywrapfst>")) # <<<<<<<<<<<<<<
*/
__pyx_v_tfst.reset(fst::script::FstClass::Read(__pyx_v_sstrm, __pyx_k_pywrapfst));
- /* "pywrapfst.pyx":2761
+ /* "pywrapfst.pyx":2773
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.FstClass.ReadStream(sstrm, b"<pywrapfst>"))
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_tfst.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":2762
+ /* "pywrapfst.pyx":2774
* tfst.reset(fst.FstClass.ReadStream(sstrm, b"<pywrapfst>"))
* if tfst.get() == NULL:
* raise FstIOError("Read failed") # <<<<<<<<<<<<<<
* return _init_XFst(tfst.release())
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2762, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2774, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_Read_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Read_failed);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2762, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2774, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2762, __pyx_L1_error)
+ __PYX_ERR(0, 2774, __pyx_L1_error)
- /* "pywrapfst.pyx":2761
+ /* "pywrapfst.pyx":2773
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.FstClass.ReadStream(sstrm, b"<pywrapfst>"))
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2763
+ /* "pywrapfst.pyx":2775
* if tfst.get() == NULL:
* raise FstIOError("Read failed")
* return _init_XFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2763, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2775, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2756
+ /* "pywrapfst.pyx":2768
*
*
* cpdef _Fst _read_Fst_from_string(state): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_read_Fst_from_string", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2756, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2783
+/* "pywrapfst.pyx":2795
* """
*
* def __new__(cls, arc_type=b"standard"): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 2783, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 2795, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2783, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2795, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Fst.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
struct __pyx_opt_args_9pywrapfst__create_Fst __pyx_t_2;
__Pyx_RefNannySetupContext("__new__", 0);
- /* "pywrapfst.pyx":2784
+ /* "pywrapfst.pyx":2796
*
* def __new__(cls, arc_type=b"standard"):
* return _create_Fst(arc_type) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.arc_type = __pyx_v_arc_type;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__create_Fst(&__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2784, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__create_Fst(&__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2796, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2783
+ /* "pywrapfst.pyx":2795
* """
*
* def __new__(cls, arc_type=b"standard"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2787
+/* "pywrapfst.pyx":2799
*
* @staticmethod
* def read(filename): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("read", 0);
- /* "pywrapfst.pyx":2802
+ /* "pywrapfst.pyx":2814
* FstIOError: Read failed.
* """
* return _read(filename) # <<<<<<<<<<<<<<
* @staticmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read(__pyx_v_filename, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2802, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read(__pyx_v_filename, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2814, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2787
+ /* "pywrapfst.pyx":2799
*
* @staticmethod
* def read(filename): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2805
+/* "pywrapfst.pyx":2817
*
* @staticmethod
* def read_from_string(state): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("read_from_string", 0);
- /* "pywrapfst.pyx":2823
+ /* "pywrapfst.pyx":2835
* See also: `write_to_string`.
* """
* return _read_Fst_from_string(state) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2823, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2835, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2805
+ /* "pywrapfst.pyx":2817
*
* @staticmethod
* def read_from_string(state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2936
+/* "pywrapfst.pyx":2948
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":2937
+ /* "pywrapfst.pyx":2949
*
* def __repr__(self):
* return "<Arc at 0x{:x}>".format(id(self)) # <<<<<<<<<<<<<<
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Arc_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2937, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Arc_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2949, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2937, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2949, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2937, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2949, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2936
+ /* "pywrapfst.pyx":2948
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2939
+/* "pywrapfst.pyx":2951
* return "<Arc at 0x{:x}>".format(id(self))
*
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_olabel)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 2939, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 2951, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 2939, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 2951, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nextstate)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 2939, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 2951, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2939, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2951, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
}
- __pyx_v_ilabel = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_ilabel == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2939, __pyx_L3_error)
- __pyx_v_olabel = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_olabel == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2939, __pyx_L3_error)
+ __pyx_v_ilabel = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_ilabel == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2951, __pyx_L3_error)
+ __pyx_v_olabel = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_olabel == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2951, __pyx_L3_error)
__pyx_v_weight = values[2];
- __pyx_v_nextstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nextstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2939, __pyx_L3_error)
+ __pyx_v_nextstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nextstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2951, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2939, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2951, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Arc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
fst::script::WeightClass __pyx_t_1;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":2940
+ /* "pywrapfst.pyx":2952
*
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
* cdef fst.WeightClass wc = _get_WeightClass_or_One(b"tropical", weight) # <<<<<<<<<<<<<<
* self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
*
*/
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2940, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2952, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":2941
+ /* "pywrapfst.pyx":2953
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
* cdef fst.WeightClass wc = _get_WeightClass_or_One(b"tropical", weight)
* self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 2941, __pyx_L1_error)
+ __PYX_ERR(0, 2953, __pyx_L1_error)
}
__pyx_v_self->_arc.reset(new fst::script::ArcClass(__pyx_v_ilabel, __pyx_v_olabel, __pyx_v_wc, __pyx_v_nextstate));
- /* "pywrapfst.pyx":2939
+ /* "pywrapfst.pyx":2951
* return "<Arc at 0x{:x}>".format(id(self))
*
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2943
+/* "pywrapfst.pyx":2955
* self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
*
* cpdef Arc copy(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2943, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2955, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Arc_5copy)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2943, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2955, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Arc))))) __PYX_ERR(0, 2943, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Arc))))) __PYX_ERR(0, 2955, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":2944
+ /* "pywrapfst.pyx":2956
*
* cpdef Arc copy(self):
* return Arc(self.ilabel, self.olabel, self.weight, self.nextstate) # <<<<<<<<<<<<<<
* property ilabel:
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2944, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_olabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2944, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_olabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2944, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nextstate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2944, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nextstate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2944, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Arc), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2944, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Arc), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2943
+ /* "pywrapfst.pyx":2955
* self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
*
* cpdef Arc copy(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("copy", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Arc_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2943, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Arc_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2955, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2948
+/* "pywrapfst.pyx":2960
* property ilabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":2949
+ /* "pywrapfst.pyx":2961
*
* def __get__(self):
* return deref(self._arc).ilabel # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 2949, __pyx_L1_error)
+ __PYX_ERR(0, 2961, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2949, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2961, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2948
+ /* "pywrapfst.pyx":2960
* property ilabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2951
+/* "pywrapfst.pyx":2963
* return deref(self._arc).ilabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
assert(__pyx_arg_value); {
- __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2951, __pyx_L3_error)
+ __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2963, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":2952
+ /* "pywrapfst.pyx":2964
*
* def __set__(self, int64 value):
* deref(self._arc).ilabel = value # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 2952, __pyx_L1_error)
+ __PYX_ERR(0, 2964, __pyx_L1_error)
}
(*__pyx_v_self->_arc).ilabel = __pyx_v_value;
- /* "pywrapfst.pyx":2951
+ /* "pywrapfst.pyx":2963
* return deref(self._arc).ilabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2956
+/* "pywrapfst.pyx":2968
* property olabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":2957
+ /* "pywrapfst.pyx":2969
*
* def __get__(self):
* return deref(self._arc).olabel # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 2957, __pyx_L1_error)
+ __PYX_ERR(0, 2969, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2957, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2956
+ /* "pywrapfst.pyx":2968
* property olabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2959
+/* "pywrapfst.pyx":2971
* return deref(self._arc).olabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
assert(__pyx_arg_value); {
- __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2959, __pyx_L3_error)
+ __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2971, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":2960
+ /* "pywrapfst.pyx":2972
*
* def __set__(self, int64 value):
* deref(self._arc).olabel = value # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 2960, __pyx_L1_error)
+ __PYX_ERR(0, 2972, __pyx_L1_error)
}
(*__pyx_v_self->_arc).olabel = __pyx_v_value;
- /* "pywrapfst.pyx":2959
+ /* "pywrapfst.pyx":2971
* return deref(self._arc).olabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2964
+/* "pywrapfst.pyx":2976
* property weight:
*
* def __get__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":2965
+ /* "pywrapfst.pyx":2977
*
* def __get__(self):
* cdef Weight weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
* return weight
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2965, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2977, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":2966
+ /* "pywrapfst.pyx":2978
* def __get__(self):
* cdef Weight weight = Weight.__new__(Weight)
* weight._weight.reset(new fst.WeightClass(deref(self._arc).weight)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 2966, __pyx_L1_error)
+ __PYX_ERR(0, 2978, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 2966, __pyx_L1_error)
+ __PYX_ERR(0, 2978, __pyx_L1_error)
}
__pyx_v_weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_arc).weight));
- /* "pywrapfst.pyx":2967
+ /* "pywrapfst.pyx":2979
* cdef Weight weight = Weight.__new__(Weight)
* weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
* return weight # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_weight);
goto __pyx_L0;
- /* "pywrapfst.pyx":2964
+ /* "pywrapfst.pyx":2976
* property weight:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2969
+/* "pywrapfst.pyx":2981
* return weight
*
* def __set__(self, weight): # <<<<<<<<<<<<<<
fst::script::WeightClass __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":2970
+ /* "pywrapfst.pyx":2982
*
* def __set__(self, weight):
* deref(self._arc).weight = _get_WeightClass_or_One(b"tropical", weight) # <<<<<<<<<<<<<<
*
* property nextstate:
*/
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2970, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2982, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 2970, __pyx_L1_error)
+ __PYX_ERR(0, 2982, __pyx_L1_error)
}
(*__pyx_v_self->_arc).weight = __pyx_t_1;
- /* "pywrapfst.pyx":2969
+ /* "pywrapfst.pyx":2981
* return weight
*
* def __set__(self, weight): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2974
+/* "pywrapfst.pyx":2986
* property nextstate:
*
* def __get__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":2975
+ /* "pywrapfst.pyx":2987
*
* def __get__(self):
* return deref(self._arc).nextstate # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 2975, __pyx_L1_error)
+ __PYX_ERR(0, 2987, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2975, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2987, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2974
+ /* "pywrapfst.pyx":2986
* property nextstate:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2977
+/* "pywrapfst.pyx":2989
* return deref(self._arc).nextstate
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
assert(__pyx_arg_value); {
- __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2977, __pyx_L3_error)
+ __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2989, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":2978
+ /* "pywrapfst.pyx":2990
*
* def __set__(self, int64 value):
* deref(self._arc).nextstate = value # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 2978, __pyx_L1_error)
+ __PYX_ERR(0, 2990, __pyx_L1_error)
}
(*__pyx_v_self->_arc).nextstate = __pyx_v_value;
- /* "pywrapfst.pyx":2977
+ /* "pywrapfst.pyx":2989
* return deref(self._arc).nextstate
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2981
+/* "pywrapfst.pyx":2993
*
*
* cdef Arc _init_Arc(const fst.ArcClass &arc): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("_init_Arc", 0);
- /* "pywrapfst.pyx":2982
+ /* "pywrapfst.pyx":2994
*
* cdef Arc _init_Arc(const fst.ArcClass &arc):
* cdef Weight weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* weight._weight.reset(new fst.WeightClass(arc.weight))
* return Arc(arc.ilabel, arc.olabel, weight, arc.nextstate)
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2982, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2994, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":2983
+ /* "pywrapfst.pyx":2995
* cdef Arc _init_Arc(const fst.ArcClass &arc):
* cdef Weight weight = Weight.__new__(Weight)
* weight._weight.reset(new fst.WeightClass(arc.weight)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 2983, __pyx_L1_error)
+ __PYX_ERR(0, 2995, __pyx_L1_error)
}
__pyx_v_weight->_weight.reset(new fst::script::WeightClass(__pyx_v_arc.weight));
- /* "pywrapfst.pyx":2984
+ /* "pywrapfst.pyx":2996
* cdef Weight weight = Weight.__new__(Weight)
* weight._weight.reset(new fst.WeightClass(arc.weight))
* return Arc(arc.ilabel, arc.olabel, weight, arc.nextstate) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2984, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2996, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.olabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2984, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.olabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2996, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.nextstate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2984, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.nextstate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2996, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2984, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2996, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Arc), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2984, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Arc), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2996, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2981
+ /* "pywrapfst.pyx":2993
*
*
* cdef Arc _init_Arc(const fst.ArcClass &arc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2995
+/* "pywrapfst.pyx":3007
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":2996
+ /* "pywrapfst.pyx":3008
*
* def __repr__(self):
* return "<ArcIterator at 0x{:x}>".format(id(self)) # <<<<<<<<<<<<<<
* def __init__(self, _Fst ifst, int64 state):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_ArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2996, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_ArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3008, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2996, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3008, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2996, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3008, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2995
+ /* "pywrapfst.pyx":3007
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2998
+/* "pywrapfst.pyx":3010
* return "<ArcIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _Fst ifst, int64 state): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2998, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3010, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2998, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3010, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
- __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2998, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3010, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2998, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3010, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.ArcIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 2998, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3010, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_11ArcIterator_2__init__(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self), __pyx_v_ifst, __pyx_v_state);
/* function exit code */
std::shared_ptr<fst::script::FstClass> __pyx_t_5;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":2999
+ /* "pywrapfst.pyx":3011
*
* def __init__(self, _Fst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2999, __pyx_L1_error)
+ __PYX_ERR(0, 3011, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_ifst->_fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":3000
+ /* "pywrapfst.pyx":3012
* def __init__(self, _Fst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._fst = ifst._fst
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3000, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3012, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3000, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3012, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 3000, __pyx_L1_error)
+ __PYX_ERR(0, 3012, __pyx_L1_error)
- /* "pywrapfst.pyx":2999
+ /* "pywrapfst.pyx":3011
*
* def __init__(self, _Fst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3002
+ /* "pywrapfst.pyx":3014
* raise FstIndexError("State index out of range")
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._fst = ifst._fst # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3002, __pyx_L1_error)
+ __PYX_ERR(0, 3014, __pyx_L1_error)
}
__pyx_t_5 = __pyx_v_ifst->_fst;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3002, __pyx_L1_error)
+ __PYX_ERR(0, 3014, __pyx_L1_error)
}
__pyx_v_self->_fst = __pyx_t_5;
- /* "pywrapfst.pyx":3003
+ /* "pywrapfst.pyx":3015
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._fst = ifst._fst
* self._aiter.reset(new fst.ArcIteratorClass(deref(self._fst), state)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3003, __pyx_L1_error)
+ __PYX_ERR(0, 3015, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3003, __pyx_L1_error)
+ __PYX_ERR(0, 3015, __pyx_L1_error)
}
__pyx_v_self->_aiter.reset(new fst::script::ArcIteratorClass((*__pyx_v_self->_fst), __pyx_v_state));
- /* "pywrapfst.pyx":2998
+ /* "pywrapfst.pyx":3010
* return "<ArcIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _Fst ifst, int64 state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3006
+/* "pywrapfst.pyx":3018
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":3007
+ /* "pywrapfst.pyx":3019
* # This just registers this class as a possible iterator.
* def __iter__(self):
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":3006
+ /* "pywrapfst.pyx":3018
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3010
+/* "pywrapfst.pyx":3022
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "pywrapfst.pyx":3011
+ /* "pywrapfst.pyx":3023
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
- __PYX_ERR(0, 3011, __pyx_L1_error)
+ __PYX_ERR(0, 3023, __pyx_L1_error)
}
__pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":3012
+ /* "pywrapfst.pyx":3024
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* self.next()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 3012, __pyx_L1_error)
+ __PYX_ERR(0, 3024, __pyx_L1_error)
- /* "pywrapfst.pyx":3011
+ /* "pywrapfst.pyx":3023
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3013
+ /* "pywrapfst.pyx":3025
* if self.done():
* raise StopIteration
* result = self.value() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "value");
- __PYX_ERR(0, 3013, __pyx_L1_error)
+ __PYX_ERR(0, 3025, __pyx_L1_error)
}
- __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3013, __pyx_L1_error)
+ __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3025, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":3014
+ /* "pywrapfst.pyx":3026
* raise StopIteration
* result = self.value()
* self.next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
- __PYX_ERR(0, 3014, __pyx_L1_error)
+ __PYX_ERR(0, 3026, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3015
+ /* "pywrapfst.pyx":3027
* result = self.value()
* self.next()
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":3010
+ /* "pywrapfst.pyx":3022
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3017
+/* "pywrapfst.pyx":3029
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3017, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3029, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_9done)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3017, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3029, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3017, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3029, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3026
+ /* "pywrapfst.pyx":3038
* True if the iterator is exhausted, False otherwise.
* """
* return self._aiter.get().Done() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3026, __pyx_L1_error)
+ __PYX_ERR(0, 3038, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3017
+ /* "pywrapfst.pyx":3029
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("done", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_11ArcIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3017, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_11ArcIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3029, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3028
+/* "pywrapfst.pyx":3040
* return self._aiter.get().Done()
*
* cpdef uint32 flags(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3028, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3040, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_11flags)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3028, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3040, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3028, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3040, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3037
+ /* "pywrapfst.pyx":3049
* The current iterator behavioral flags as an integer.
* """
* return self._aiter.get().Flags() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3037, __pyx_L1_error)
+ __PYX_ERR(0, 3049, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":3028
+ /* "pywrapfst.pyx":3040
* return self._aiter.get().Done()
*
* cpdef uint32 flags(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("flags", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_f_9pywrapfst_11ArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3028, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_f_9pywrapfst_11ArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3040, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3039
+/* "pywrapfst.pyx":3051
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3039, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3051, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_13next)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3039, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3051, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3045
+ /* "pywrapfst.pyx":3057
* Advances the iterator.
* """
* self._aiter.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3045, __pyx_L1_error)
+ __PYX_ERR(0, 3057, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Next();
- /* "pywrapfst.pyx":3039
+ /* "pywrapfst.pyx":3051
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("next", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3039, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3051, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3047
+/* "pywrapfst.pyx":3059
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3047, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3059, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_15position)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3047, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3059, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3047, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3059, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3056
+ /* "pywrapfst.pyx":3068
* The iterator's position, expressed as an integer.
* """
* return self._aiter.get().Position() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3056, __pyx_L1_error)
+ __PYX_ERR(0, 3068, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Position();
goto __pyx_L0;
- /* "pywrapfst.pyx":3047
+ /* "pywrapfst.pyx":3059
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("position", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_9pywrapfst_11ArcIterator_position(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3047, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_9pywrapfst_11ArcIterator_position(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3059, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3058
+/* "pywrapfst.pyx":3070
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3058, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3070, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_17reset)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3058, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3070, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3064
+ /* "pywrapfst.pyx":3076
* Resets the iterator to the initial position.
* """
* self._aiter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3064, __pyx_L1_error)
+ __PYX_ERR(0, 3076, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Reset();
- /* "pywrapfst.pyx":3058
+ /* "pywrapfst.pyx":3070
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("reset", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3058, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3070, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3066
+/* "pywrapfst.pyx":3078
* self._aiter.get().Reset()
*
* cpdef void seek(self, size_t a): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3066, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3078, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_19seek)) {
- __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3066, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3078, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3066, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3078, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3075
+ /* "pywrapfst.pyx":3087
* a: The position to seek to.
* """
* self._aiter.get().Seek(a) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3075, __pyx_L1_error)
+ __PYX_ERR(0, 3087, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Seek(__pyx_v_a);
- /* "pywrapfst.pyx":3066
+ /* "pywrapfst.pyx":3078
* self._aiter.get().Reset()
*
* cpdef void seek(self, size_t a): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("seek (wrapper)", 0);
assert(__pyx_arg_a); {
- __pyx_v_a = __Pyx_PyInt_As_size_t(__pyx_arg_a); if (unlikely((__pyx_v_a == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3066, __pyx_L3_error)
+ __pyx_v_a = __Pyx_PyInt_As_size_t(__pyx_arg_a); if (unlikely((__pyx_v_a == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3078, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("seek", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_seek(__pyx_v_self, __pyx_v_a, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3066, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_seek(__pyx_v_self, __pyx_v_a, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3078, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3077
+/* "pywrapfst.pyx":3089
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint32 flags, uint32 mask): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3077, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3089, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_21set_flags)) {
- __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3077, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3089, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3077, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3089, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3077, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3089, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3077, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3089, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3077, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3089, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (__pyx_t_6) {
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3077, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3089, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
#endif
}
- /* "pywrapfst.pyx":3087
+ /* "pywrapfst.pyx":3099
* mask: A mask to be applied to the `flags` argument before setting them.
* """
* self._aiter.get().SetFlags(flags, mask) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3087, __pyx_L1_error)
+ __PYX_ERR(0, 3099, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);
- /* "pywrapfst.pyx":3077
+ /* "pywrapfst.pyx":3089
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint32 flags, uint32 mask): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3077, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3089, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3077, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3089, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
- __pyx_v_flags = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_flags == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3077, __pyx_L3_error)
- __pyx_v_mask = __Pyx_PyInt_As_uint32_t(values[1]); if (unlikely((__pyx_v_mask == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3077, __pyx_L3_error)
+ __pyx_v_flags = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_flags == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3089, __pyx_L3_error)
+ __pyx_v_mask = __Pyx_PyInt_As_uint32_t(values[1]); if (unlikely((__pyx_v_mask == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3089, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3077, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3089, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.ArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("set_flags", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_set_flags(__pyx_v_self, __pyx_v_flags, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3077, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_set_flags(__pyx_v_self, __pyx_v_flags, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3089, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3089
+/* "pywrapfst.pyx":3101
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef object value(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3089, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_23value)) {
__Pyx_XDECREF(__pyx_r);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3089, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
#endif
}
- /* "pywrapfst.pyx":3095
+ /* "pywrapfst.pyx":3107
* Returns the current arc.
* """
* return _init_Arc(self._aiter.get().Value()) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3095, __pyx_L1_error)
+ __PYX_ERR(0, 3107, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_aiter.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3095, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_aiter.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3089
+ /* "pywrapfst.pyx":3101
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef object value(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("value", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_11ArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3089, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_11ArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3107
+/* "pywrapfst.pyx":3119
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3108
+ /* "pywrapfst.pyx":3120
*
* def __repr__(self):
* return "<MutableArcIterator at 0x{:x}>".format(id(self)) # <<<<<<<<<<<<<<
* def __init__(self, _MutableFst ifst, int64 state):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_MutableArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3108, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_MutableArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3108, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3108, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3107
+ /* "pywrapfst.pyx":3119
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3110
+/* "pywrapfst.pyx":3122
* return "<MutableArcIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _MutableFst ifst, int64 state): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3110, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3122, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3110, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3122, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__MutableFst *)values[0]);
- __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3110, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3122, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3110, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3122, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableArcIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__MutableFst, 1, "ifst", 0))) __PYX_ERR(0, 3110, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__MutableFst, 1, "ifst", 0))) __PYX_ERR(0, 3122, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_2__init__(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self), __pyx_v_ifst, __pyx_v_state);
/* function exit code */
std::shared_ptr<fst::script::MutableFstClass> __pyx_t_5;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":3111
+ /* "pywrapfst.pyx":3123
*
* def __init__(self, _MutableFst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3111, __pyx_L1_error)
+ __PYX_ERR(0, 3123, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_ifst->__pyx_base._fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":3112
+ /* "pywrapfst.pyx":3124
* def __init__(self, _MutableFst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._mfst = ifst._mfst
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3112, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3112, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 3112, __pyx_L1_error)
+ __PYX_ERR(0, 3124, __pyx_L1_error)
- /* "pywrapfst.pyx":3111
+ /* "pywrapfst.pyx":3123
*
* def __init__(self, _MutableFst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3114
+ /* "pywrapfst.pyx":3126
* raise FstIndexError("State index out of range")
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._mfst = ifst._mfst # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 3114, __pyx_L1_error)
+ __PYX_ERR(0, 3126, __pyx_L1_error)
}
__pyx_t_5 = __pyx_v_ifst->_mfst;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 3114, __pyx_L1_error)
+ __PYX_ERR(0, 3126, __pyx_L1_error)
}
__pyx_v_self->_mfst = __pyx_t_5;
- /* "pywrapfst.pyx":3115
+ /* "pywrapfst.pyx":3127
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._mfst = ifst._mfst
* self._aiter.reset(new fst.MutableArcIteratorClass(ifst._mfst.get(), state)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3115, __pyx_L1_error)
+ __PYX_ERR(0, 3127, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 3115, __pyx_L1_error)
+ __PYX_ERR(0, 3127, __pyx_L1_error)
}
__pyx_v_self->_aiter.reset(new fst::script::MutableArcIteratorClass(__pyx_v_ifst->_mfst.get(), __pyx_v_state));
- /* "pywrapfst.pyx":3110
+ /* "pywrapfst.pyx":3122
* return "<MutableArcIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _MutableFst ifst, int64 state): # <<<<<<<<<<<<<<
}
static PyObject *__pyx_gb_9pywrapfst_18MutableArcIterator_6generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
-/* "pywrapfst.pyx":3118
+/* "pywrapfst.pyx":3130
*
* # Magic method used to get a Pythonic Iterator API out of the C++ API
* def __iter__(self): # <<<<<<<<<<<<<<
if (unlikely(!__pyx_cur_scope)) {
__pyx_cur_scope = ((struct __pyx_obj_9pywrapfst___pyx_scope_struct____iter__ *)Py_None);
__Pyx_INCREF(Py_None);
- __PYX_ERR(0, 3118, __pyx_L1_error)
+ __PYX_ERR(0, 3130, __pyx_L1_error)
} else {
__Pyx_GOTREF(__pyx_cur_scope);
}
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_9pywrapfst_18MutableArcIterator_6generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_MutableArcIterator___iter, __pyx_n_s_pywrapfst_2); if (unlikely(!gen)) __PYX_ERR(0, 3118, __pyx_L1_error)
+ __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_9pywrapfst_18MutableArcIterator_6generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_MutableArcIterator___iter, __pyx_n_s_pywrapfst_2); if (unlikely(!gen)) __PYX_ERR(0, 3130, __pyx_L1_error)
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3118, __pyx_L1_error)
+ if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3130, __pyx_L1_error)
- /* "pywrapfst.pyx":3119
+ /* "pywrapfst.pyx":3131
* # Magic method used to get a Pythonic Iterator API out of the C++ API
* def __iter__(self):
* while not self.done(): # <<<<<<<<<<<<<<
while (1) {
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
- __PYX_ERR(0, 3119, __pyx_L1_error)
+ __PYX_ERR(0, 3131, __pyx_L1_error)
}
__pyx_t_1 = ((!(((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->done(__pyx_cur_scope->__pyx_v_self, 0) != 0)) != 0);
if (!__pyx_t_1) break;
- /* "pywrapfst.pyx":3120
+ /* "pywrapfst.pyx":3132
* def __iter__(self):
* while not self.done():
* yield self.value() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "value");
- __PYX_ERR(0, 3120, __pyx_L1_error)
+ __PYX_ERR(0, 3132, __pyx_L1_error)
}
- __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->value(__pyx_cur_scope->__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3120, __pyx_L1_error)
+ __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->value(__pyx_cur_scope->__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_generator->resume_label = 1;
return __pyx_r;
__pyx_L6_resume_from_yield:;
- if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3120, __pyx_L1_error)
+ if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3132, __pyx_L1_error)
- /* "pywrapfst.pyx":3121
+ /* "pywrapfst.pyx":3133
* while not self.done():
* yield self.value()
* self.next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
- __PYX_ERR(0, 3121, __pyx_L1_error)
+ __PYX_ERR(0, 3133, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->next(__pyx_cur_scope->__pyx_v_self, 0);
}
CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
- /* "pywrapfst.pyx":3118
+ /* "pywrapfst.pyx":3130
*
* # Magic method used to get a Pythonic Iterator API out of the C++ API
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3123
+/* "pywrapfst.pyx":3135
* self.next()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3123, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_8done)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3123, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3123, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3135, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3132
+ /* "pywrapfst.pyx":3144
* True if the iterator is exhausted, False otherwise.
* """
* return self._aiter.get().Done() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3132, __pyx_L1_error)
+ __PYX_ERR(0, 3144, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3123
+ /* "pywrapfst.pyx":3135
* self.next()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("done", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_18MutableArcIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3123, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_18MutableArcIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3134
+/* "pywrapfst.pyx":3146
* return self._aiter.get().Done()
*
* cpdef uint32 flags(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3134, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_10flags)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3134, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3134, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3146, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3143
+ /* "pywrapfst.pyx":3155
* The current iterator behavioral flags as an integer.
* """
* return self._aiter.get().Flags() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3143, __pyx_L1_error)
+ __PYX_ERR(0, 3155, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":3134
+ /* "pywrapfst.pyx":3146
* return self._aiter.get().Done()
*
* cpdef uint32 flags(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("flags", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_f_9pywrapfst_18MutableArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3134, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_f_9pywrapfst_18MutableArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3145
+/* "pywrapfst.pyx":3157
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3145, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_12next)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3145, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3151
+ /* "pywrapfst.pyx":3163
* Advances the iterator.
* """
* self._aiter.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3151, __pyx_L1_error)
+ __PYX_ERR(0, 3163, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Next();
- /* "pywrapfst.pyx":3145
+ /* "pywrapfst.pyx":3157
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("next", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3145, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3153
+/* "pywrapfst.pyx":3165
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3153, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_14position)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3153, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3153, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3165, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3162
+ /* "pywrapfst.pyx":3174
* The iterator's position, expressed as an integer.
* """
* return self._aiter.get().Position() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3162, __pyx_L1_error)
+ __PYX_ERR(0, 3174, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Position();
goto __pyx_L0;
- /* "pywrapfst.pyx":3153
+ /* "pywrapfst.pyx":3165
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("position", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_9pywrapfst_18MutableArcIterator_position(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3153, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_9pywrapfst_18MutableArcIterator_position(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3164
+/* "pywrapfst.pyx":3176
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3164, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_16reset)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3164, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3170
+ /* "pywrapfst.pyx":3182
* Resets the iterator to the initial position.
* """
* self._aiter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3170, __pyx_L1_error)
+ __PYX_ERR(0, 3182, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Reset();
- /* "pywrapfst.pyx":3164
+ /* "pywrapfst.pyx":3176
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("reset", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3164, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3172
+/* "pywrapfst.pyx":3184
* self._aiter.get().Reset()
*
* cpdef void seek(self, size_t a): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3172, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_18seek)) {
- __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3172, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3172, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3181
+ /* "pywrapfst.pyx":3193
* a: The position to seek to.
* """
* self._aiter.get().Seek(a) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3181, __pyx_L1_error)
+ __PYX_ERR(0, 3193, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Seek(__pyx_v_a);
- /* "pywrapfst.pyx":3172
+ /* "pywrapfst.pyx":3184
* self._aiter.get().Reset()
*
* cpdef void seek(self, size_t a): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("seek (wrapper)", 0);
assert(__pyx_arg_a); {
- __pyx_v_a = __Pyx_PyInt_As_size_t(__pyx_arg_a); if (unlikely((__pyx_v_a == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3172, __pyx_L3_error)
+ __pyx_v_a = __Pyx_PyInt_As_size_t(__pyx_arg_a); if (unlikely((__pyx_v_a == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3184, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("seek", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_seek(__pyx_v_self, __pyx_v_a, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3172, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_seek(__pyx_v_self, __pyx_v_a, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3183
+/* "pywrapfst.pyx":3195
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint32 flags, uint32 mask): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3183, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_20set_flags)) {
- __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3183, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3183, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3183, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3195, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3183, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3195, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3183, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (__pyx_t_6) {
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3183, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
#endif
}
- /* "pywrapfst.pyx":3193
+ /* "pywrapfst.pyx":3205
* mask: A mask to be applied to the `flags` argument before setting them.
* """
* self._aiter.get().SetFlags(flags, mask) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3193, __pyx_L1_error)
+ __PYX_ERR(0, 3205, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);
- /* "pywrapfst.pyx":3183
+ /* "pywrapfst.pyx":3195
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint32 flags, uint32 mask): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3183, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3195, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3183, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3195, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
- __pyx_v_flags = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_flags == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3183, __pyx_L3_error)
- __pyx_v_mask = __Pyx_PyInt_As_uint32_t(values[1]); if (unlikely((__pyx_v_mask == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3183, __pyx_L3_error)
+ __pyx_v_flags = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_flags == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3195, __pyx_L3_error)
+ __pyx_v_mask = __Pyx_PyInt_As_uint32_t(values[1]); if (unlikely((__pyx_v_mask == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3195, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3183, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3195, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("set_flags", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_set_flags(__pyx_v_self, __pyx_v_flags, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3183, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_set_flags(__pyx_v_self, __pyx_v_flags, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3195
+/* "pywrapfst.pyx":3207
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef void set_value(self, Arc arc): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3195, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_22set_value)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_arc)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_arc));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3195, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3204
+ /* "pywrapfst.pyx":3216
* arc: The arc to replace the current arc with.
* """
* self._aiter.get().SetValue(deref(arc._arc)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3204, __pyx_L1_error)
+ __PYX_ERR(0, 3216, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 3204, __pyx_L1_error)
+ __PYX_ERR(0, 3216, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetValue((*__pyx_v_arc->_arc));
- /* "pywrapfst.pyx":3195
+ /* "pywrapfst.pyx":3207
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef void set_value(self, Arc arc): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_value (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 3195, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 3207, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_21set_value(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_arc));
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("set_value", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_set_value(__pyx_v_self, __pyx_v_arc, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3195, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_set_value(__pyx_v_self, __pyx_v_arc, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3206
+/* "pywrapfst.pyx":3218
* self._aiter.get().SetValue(deref(arc._arc))
*
* cpdef object value(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3206, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_24value)) {
__Pyx_XDECREF(__pyx_r);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3206, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
#endif
}
- /* "pywrapfst.pyx":3212
+ /* "pywrapfst.pyx":3224
* Returns the current arc.
* """
* return _init_Arc(self._aiter.get().Value()) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3212, __pyx_L1_error)
+ __PYX_ERR(0, 3224, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_aiter.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3212, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_aiter.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3206
+ /* "pywrapfst.pyx":3218
* self._aiter.get().SetValue(deref(arc._arc))
*
* cpdef object value(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("value", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_18MutableArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3206, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_18MutableArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3226
+/* "pywrapfst.pyx":3238
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3227
+ /* "pywrapfst.pyx":3239
*
* def __repr__(self):
* return "<StateIterator at 0x{:x}>".format(id(self)) # <<<<<<<<<<<<<<
* def __init__(self, _Fst ifst):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_StateIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3227, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_StateIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3227, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3227, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3226
+ /* "pywrapfst.pyx":3238
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3229
+/* "pywrapfst.pyx":3241
* return "<StateIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _Fst ifst): # <<<<<<<<<<<<<<
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3229, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3241, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3229, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3241, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.StateIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3229, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3241, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_13StateIterator_2__init__(((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_v_self), __pyx_v_ifst);
/* function exit code */
std::shared_ptr<fst::script::FstClass> __pyx_t_1;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":3231
+ /* "pywrapfst.pyx":3243
* def __init__(self, _Fst ifst):
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._fst = ifst._fst # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3231, __pyx_L1_error)
+ __PYX_ERR(0, 3243, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_ifst->_fst;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3231, __pyx_L1_error)
+ __PYX_ERR(0, 3243, __pyx_L1_error)
}
__pyx_v_self->_fst = __pyx_t_1;
- /* "pywrapfst.pyx":3232
+ /* "pywrapfst.pyx":3244
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._fst = ifst._fst
* self._siter.reset(new fst.StateIteratorClass(deref(self._fst))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 3232, __pyx_L1_error)
+ __PYX_ERR(0, 3244, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3232, __pyx_L1_error)
+ __PYX_ERR(0, 3244, __pyx_L1_error)
}
__pyx_v_self->_siter.reset(new fst::script::StateIteratorClass((*__pyx_v_self->_fst)));
- /* "pywrapfst.pyx":3229
+ /* "pywrapfst.pyx":3241
* return "<StateIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _Fst ifst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3235
+/* "pywrapfst.pyx":3247
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":3236
+ /* "pywrapfst.pyx":3248
* # This just registers this class as a possible iterator.
* def __iter__(self):
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":3235
+ /* "pywrapfst.pyx":3247
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3239
+/* "pywrapfst.pyx":3251
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "pywrapfst.pyx":3240
+ /* "pywrapfst.pyx":3252
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
- __PYX_ERR(0, 3240, __pyx_L1_error)
+ __PYX_ERR(0, 3252, __pyx_L1_error)
}
__pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":3241
+ /* "pywrapfst.pyx":3253
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* self.next()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 3241, __pyx_L1_error)
+ __PYX_ERR(0, 3253, __pyx_L1_error)
- /* "pywrapfst.pyx":3240
+ /* "pywrapfst.pyx":3252
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3242
+ /* "pywrapfst.pyx":3254
* if self.done():
* raise StopIteration
* cdef int64 result = self.value() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "value");
- __PYX_ERR(0, 3242, __pyx_L1_error)
+ __PYX_ERR(0, 3254, __pyx_L1_error)
}
__pyx_v_result = ((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3243
+ /* "pywrapfst.pyx":3255
* raise StopIteration
* cdef int64 result = self.value()
* self.next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
- __PYX_ERR(0, 3243, __pyx_L1_error)
+ __PYX_ERR(0, 3255, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3244
+ /* "pywrapfst.pyx":3256
* cdef int64 result = self.value()
* self.next()
* return result # <<<<<<<<<<<<<<
* cpdef bool done(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3244, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3239
+ /* "pywrapfst.pyx":3251
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3246
+/* "pywrapfst.pyx":3258
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3246, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_13StateIterator_9done)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3246, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3246, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3258, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3255
+ /* "pywrapfst.pyx":3267
* True if the iterator is exhausted, False otherwise.
* """
* return self._siter.get().Done() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 3255, __pyx_L1_error)
+ __PYX_ERR(0, 3267, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3246
+ /* "pywrapfst.pyx":3258
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("done", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_13StateIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3246, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_13StateIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3257
+/* "pywrapfst.pyx":3269
* return self._siter.get().Done()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3257, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_13StateIterator_11next)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3257, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3263
+ /* "pywrapfst.pyx":3275
* Advances the iterator.
* """
* self._siter.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 3263, __pyx_L1_error)
+ __PYX_ERR(0, 3275, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Next();
- /* "pywrapfst.pyx":3257
+ /* "pywrapfst.pyx":3269
* return self._siter.get().Done()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("next", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_13StateIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3257, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_13StateIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3265
+/* "pywrapfst.pyx":3277
* self._siter.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3265, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_13StateIterator_13reset)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3265, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3271
+ /* "pywrapfst.pyx":3283
* Resets the iterator to the initial position.
* """
* self._siter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 3271, __pyx_L1_error)
+ __PYX_ERR(0, 3283, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Reset();
- /* "pywrapfst.pyx":3265
+ /* "pywrapfst.pyx":3277
* self._siter.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("reset", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_13StateIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3265, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_13StateIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3273
+/* "pywrapfst.pyx":3285
* self._siter.get().Reset()
*
* cpdef int64 value(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3273, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_13StateIterator_15value)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3273, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3273, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3285, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3279
+ /* "pywrapfst.pyx":3291
* Returns the current state index.
* """
* return self._siter.get().Value() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 3279, __pyx_L1_error)
+ __PYX_ERR(0, 3291, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Value();
goto __pyx_L0;
- /* "pywrapfst.pyx":3273
+ /* "pywrapfst.pyx":3285
* self._siter.get().Reset()
*
* cpdef int64 value(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("value", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_13StateIterator_value(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3273, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_13StateIterator_value(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3285
+/* "pywrapfst.pyx":3297
*
*
* cdef _Fst _map(_Fst ifst, # <<<<<<<<<<<<<<
PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_b_identity);
double __pyx_v_power = ((double)1.);
- /* "pywrapfst.pyx":3289
+ /* "pywrapfst.pyx":3301
* map_type=b"identity",
* double power=1.,
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3291
+ /* "pywrapfst.pyx":3303
* weight=None):
* cdef fst.MapType map_type_enum
* if not fst.GetMapType(tostring(map_type), addr(map_type_enum)): # <<<<<<<<<<<<<<
* raise FstArgError("Unknown map type: {!r}".format(map_type))
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_map_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3291, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_map_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3303, __pyx_L1_error)
__pyx_t_2 = ((!(fst::script::GetMapType(__pyx_t_1, (&__pyx_v_map_type_enum)) != 0)) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":3292
+ /* "pywrapfst.pyx":3304
* cdef fst.MapType map_type_enum
* if not fst.GetMapType(tostring(map_type), addr(map_type_enum)):
* raise FstArgError("Unknown map type: {!r}".format(map_type)) # <<<<<<<<<<<<<<
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
* weight) if map_type_enum == fst.TIMES_MAPPER else
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3292, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3304, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_map_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3292, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_map_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3304, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
__pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_map_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_map_type);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3292, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3304, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
__pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3292, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3304, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 3292, __pyx_L1_error)
+ __PYX_ERR(0, 3304, __pyx_L1_error)
- /* "pywrapfst.pyx":3291
+ /* "pywrapfst.pyx":3303
* weight=None):
* cdef fst.MapType map_type_enum
* if not fst.GetMapType(tostring(map_type), addr(map_type_enum)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3294
+ /* "pywrapfst.pyx":3306
* raise FstArgError("Unknown map type: {!r}".format(map_type))
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
* weight) if map_type_enum == fst.TIMES_MAPPER else # <<<<<<<<<<<<<<
*/
if (((__pyx_v_map_type_enum == fst::script::TIMES_MAPPER) != 0)) {
- /* "pywrapfst.pyx":3293
+ /* "pywrapfst.pyx":3305
* if not fst.GetMapType(tostring(map_type), addr(map_type_enum)):
* raise FstArgError("Unknown map type: {!r}".format(map_type))
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 3293, __pyx_L1_error)
+ __PYX_ERR(0, 3305, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3294
+ /* "pywrapfst.pyx":3306
* raise FstArgError("Unknown map type: {!r}".format(map_type))
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
* weight) if map_type_enum == fst.TIMES_MAPPER else # <<<<<<<<<<<<<<
* _get_WeightClass_or_Zero(ifst.weight_type(), weight))
* return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, power, wc))
*/
- __pyx_t_9 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3293, __pyx_L1_error)
+ __pyx_t_9 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3305, __pyx_L1_error)
__pyx_t_8 = __pyx_t_9;
} else {
- /* "pywrapfst.pyx":3295
+ /* "pywrapfst.pyx":3307
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
* weight) if map_type_enum == fst.TIMES_MAPPER else
* _get_WeightClass_or_Zero(ifst.weight_type(), weight)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 3295, __pyx_L1_error)
+ __PYX_ERR(0, 3307, __pyx_L1_error)
}
- __pyx_t_9 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3295, __pyx_L1_error)
+ __pyx_t_9 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3307, __pyx_L1_error)
__pyx_t_8 = __pyx_t_9;
}
__pyx_v_wc = __pyx_t_8;
- /* "pywrapfst.pyx":3296
+ /* "pywrapfst.pyx":3308
* weight) if map_type_enum == fst.TIMES_MAPPER else
* _get_WeightClass_or_Zero(ifst.weight_type(), weight))
* return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, power, wc)) # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3296, __pyx_L1_error)
+ __PYX_ERR(0, 3308, __pyx_L1_error)
}
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(fst::script::Map((*__pyx_v_ifst->_fst), __pyx_v_map_type_enum, __pyx_v_delta, __pyx_v_power, __pyx_v_wc))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3296, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(fst::script::Map((*__pyx_v_ifst->_fst), __pyx_v_map_type_enum, __pyx_v_delta, __pyx_v_power, __pyx_v_wc))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3308, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3285
+ /* "pywrapfst.pyx":3297
*
*
* cdef _Fst _map(_Fst ifst, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3299
+/* "pywrapfst.pyx":3311
*
*
* cpdef _Fst arcmap(_Fst ifst, # <<<<<<<<<<<<<<
PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_b_identity);
double __pyx_v_power = ((double)1.);
- /* "pywrapfst.pyx":3303
+ /* "pywrapfst.pyx":3315
* map_type=b"identity",
* double power=1.,
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3346
+ /* "pywrapfst.pyx":3358
* See also: `statemap`.
* """
* return _map(ifst, delta, map_type, power, weight) # <<<<<<<<<<<<<<
__pyx_t_2.map_type = __pyx_v_map_type;
__pyx_t_2.power = __pyx_v_power;
__pyx_t_2.weight = __pyx_v_weight;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__map(__pyx_v_ifst, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3346, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__map(__pyx_v_ifst, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3358, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3299
+ /* "pywrapfst.pyx":3311
*
*
* cpdef _Fst arcmap(_Fst ifst, # <<<<<<<<<<<<<<
PyObject* values[5] = {0,0,0,0,0};
values[2] = ((PyObject *)__pyx_n_b_identity);
- /* "pywrapfst.pyx":3303
+ /* "pywrapfst.pyx":3315
* map_type=b"identity",
* double power=1.,
* weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcmap") < 0)) __PYX_ERR(0, 3299, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcmap") < 0)) __PYX_ERR(0, 3311, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
if (values[1]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3300, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3312, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__32;
}
__pyx_v_map_type = values[2];
if (values[3]) {
- __pyx_v_power = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_power == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3302, __pyx_L3_error)
+ __pyx_v_power = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_power == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3314, __pyx_L3_error)
} else {
__pyx_v_power = ((double)1.);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3299, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3311, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.arcmap", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3299, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3311, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_18arcmap(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_map_type, __pyx_v_power, __pyx_v_weight);
- /* "pywrapfst.pyx":3299
+ /* "pywrapfst.pyx":3311
*
*
* cpdef _Fst arcmap(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_2.map_type = __pyx_v_map_type;
__pyx_t_2.power = __pyx_v_power;
__pyx_t_2.weight = __pyx_v_weight;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_arcmap(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3299, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_arcmap(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3349
+/* "pywrapfst.pyx":3361
*
*
* cpdef _MutableFst compose(_Fst ifst1, # <<<<<<<<<<<<<<
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_compose(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_compose *__pyx_optional_args) {
PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3352
+ /* "pywrapfst.pyx":3364
* _Fst ifst2,
* compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3378
+ /* "pywrapfst.pyx":3390
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3378, __pyx_L1_error)
+ __PYX_ERR(0, 3390, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0)));
- /* "pywrapfst.pyx":3381
+ /* "pywrapfst.pyx":3393
* cdef unique_ptr[fst.ComposeOptions] opts
* opts.reset(new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter)))) # <<<<<<<<<<<<<<
* fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release())
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3381, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3381, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3393, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3393, __pyx_L1_error)
- /* "pywrapfst.pyx":3380
+ /* "pywrapfst.pyx":3392
* tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
* cdef unique_ptr[fst.ComposeOptions] opts
* opts.reset(new fst.ComposeOptions(connect, # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
- /* "pywrapfst.pyx":3382
+ /* "pywrapfst.pyx":3394
* opts.reset(new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter))))
* fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3382, __pyx_L1_error)
+ __PYX_ERR(0, 3394, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3382, __pyx_L1_error)
+ __PYX_ERR(0, 3394, __pyx_L1_error)
}
fst::script::Compose((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3383
+ /* "pywrapfst.pyx":3395
* _get_compose_filter(tostring(compose_filter))))
* fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3383, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3395, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3349
+ /* "pywrapfst.pyx":3361
*
*
* cpdef _MutableFst compose(_Fst ifst1, # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, 1); __PYX_ERR(0, 3349, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, 1); __PYX_ERR(0, 3361, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(0, 3349, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(0, 3361, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
__pyx_v_compose_filter = values[2];
if (values[3]) {
- __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3352, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3364, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3352
+ /* "pywrapfst.pyx":3364
* _Fst ifst2,
* compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3349, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3361, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.compose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3349, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3350, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3361, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3362, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_20compose(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);
- /* "pywrapfst.pyx":3349
+ /* "pywrapfst.pyx":3361
*
*
* cpdef _MutableFst compose(_Fst ifst1, # <<<<<<<<<<<<<<
__pyx_t_2.__pyx_n = 2;
__pyx_t_2.compose_filter = __pyx_v_compose_filter;
__pyx_t_2.connect = __pyx_v_connect;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_compose(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3349, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_compose(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3386
+/* "pywrapfst.pyx":3398
*
*
* cpdef _Fst convert(_Fst ifst, fst_type=b""): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3403
+ /* "pywrapfst.pyx":3415
* FstOpError: Conversion failed.
* """
* cdef string fst_type_string = tostring(fst_type) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3403, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3415, __pyx_L1_error)
__pyx_v_fst_type_string = __pyx_t_1;
- /* "pywrapfst.pyx":3405
+ /* "pywrapfst.pyx":3417
* cdef string fst_type_string = tostring(fst_type)
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3405, __pyx_L1_error)
+ __PYX_ERR(0, 3417, __pyx_L1_error)
}
__pyx_v_tfst.reset(fst::script::Convert((*__pyx_v_ifst->_fst), __pyx_v_fst_type_string));
- /* "pywrapfst.pyx":3407
+ /* "pywrapfst.pyx":3419
* tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))
* # Script-land Convert returns a null pointer to signal failure.
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_tfst.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":3408
+ /* "pywrapfst.pyx":3420
* # Script-land Convert returns a null pointer to signal failure.
* if tfst.get() == NULL:
* raise FstOpError("Conversion to {!r} failed".format(fst_type)) # <<<<<<<<<<<<<<
* return _init_XFst(tfst.release())
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3408, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3420, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Conversion_to_r_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3408, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Conversion_to_r_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3420, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
__pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_fst_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_fst_type);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3408, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3420, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
__pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3408, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3420, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 3408, __pyx_L1_error)
+ __PYX_ERR(0, 3420, __pyx_L1_error)
- /* "pywrapfst.pyx":3407
+ /* "pywrapfst.pyx":3419
* tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))
* # Script-land Convert returns a null pointer to signal failure.
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3409
+ /* "pywrapfst.pyx":3421
* if tfst.get() == NULL:
* raise FstOpError("Conversion to {!r} failed".format(fst_type))
* return _init_XFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3409, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3386
+ /* "pywrapfst.pyx":3398
*
*
* cpdef _Fst convert(_Fst ifst, fst_type=b""): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 3386, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 3398, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("convert", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3386, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("convert", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3398, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3386, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3398, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_22convert(__pyx_self, __pyx_v_ifst, __pyx_v_fst_type);
/* function exit code */
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.fst_type = __pyx_v_fst_type;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_convert(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3386, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_convert(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3398, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3412
+/* "pywrapfst.pyx":3424
*
*
* cpdef _MutableFst determinize(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__34;
__pyx_t_10basictypes_int64 __pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);
- /* "pywrapfst.pyx":3417
+ /* "pywrapfst.pyx":3429
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None, # <<<<<<<<<<<<<<
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- /* "pywrapfst.pyx":3418
+ /* "pywrapfst.pyx":3430
* int64 subsequential_label=0,
* weight=None,
* bool increment_subsequential_label=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3454
+ /* "pywrapfst.pyx":3466
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3454, __pyx_L1_error)
+ __PYX_ERR(0, 3466, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3456
+ /* "pywrapfst.pyx":3468
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* # Threshold is set to semiring Zero (no pruning) if weight unspecified.
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 3456, __pyx_L1_error)
+ __PYX_ERR(0, 3468, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3457
+ /* "pywrapfst.pyx":3469
* # Threshold is set to semiring Zero (no pruning) if weight unspecified.
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(),
* weight) # <<<<<<<<<<<<<<
* cdef fst.DeterminizeType determinize_type_enum
* if not fst.GetDeterminizeType(tostring(det_type),
*/
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3456, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3468, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":3459
+ /* "pywrapfst.pyx":3471
* weight)
* cdef fst.DeterminizeType determinize_type_enum
* if not fst.GetDeterminizeType(tostring(det_type), # <<<<<<<<<<<<<<
* addr(determinize_type_enum)):
* raise FstArgError("Unknown determinization type: {!r}".format(det_type))
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_det_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3459, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_det_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3471, __pyx_L1_error)
- /* "pywrapfst.pyx":3460
+ /* "pywrapfst.pyx":3472
* cdef fst.DeterminizeType determinize_type_enum
* if not fst.GetDeterminizeType(tostring(det_type),
* addr(determinize_type_enum)): # <<<<<<<<<<<<<<
*/
__pyx_t_3 = ((!(fst::script::GetDeterminizeType(__pyx_t_2, (&__pyx_v_determinize_type_enum)) != 0)) != 0);
- /* "pywrapfst.pyx":3459
+ /* "pywrapfst.pyx":3471
* weight)
* cdef fst.DeterminizeType determinize_type_enum
* if not fst.GetDeterminizeType(tostring(det_type), # <<<<<<<<<<<<<<
*/
if (unlikely(__pyx_t_3)) {
- /* "pywrapfst.pyx":3461
+ /* "pywrapfst.pyx":3473
* if not fst.GetDeterminizeType(tostring(det_type),
* addr(determinize_type_enum)):
* raise FstArgError("Unknown determinization type: {!r}".format(det_type)) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.DeterminizeOptions] opts
* opts.reset(new fst.DeterminizeOptions(delta, wc, nstate, subsequential_label,
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3461, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_determinization_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3461, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_determinization_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
}
__pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_det_type) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_det_type);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3461, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = NULL;
__pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3461, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 3461, __pyx_L1_error)
+ __PYX_ERR(0, 3473, __pyx_L1_error)
- /* "pywrapfst.pyx":3459
+ /* "pywrapfst.pyx":3471
* weight)
* cdef fst.DeterminizeType determinize_type_enum
* if not fst.GetDeterminizeType(tostring(det_type), # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3463
+ /* "pywrapfst.pyx":3475
* raise FstArgError("Unknown determinization type: {!r}".format(det_type))
* cdef unique_ptr[fst.DeterminizeOptions] opts
* opts.reset(new fst.DeterminizeOptions(delta, wc, nstate, subsequential_label, # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::script::DeterminizeOptions(__pyx_v_delta, __pyx_v_wc, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_determinize_type_enum, __pyx_v_increment_subsequential_label));
- /* "pywrapfst.pyx":3466
+ /* "pywrapfst.pyx":3478
* determinize_type_enum,
* increment_subsequential_label))
* fst.Determinize(deref(ifst._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3466, __pyx_L1_error)
+ __PYX_ERR(0, 3478, __pyx_L1_error)
}
fst::script::Determinize((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3467
+ /* "pywrapfst.pyx":3479
* increment_subsequential_label))
* fst.Determinize(deref(ifst._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3467, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3479, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3412
+ /* "pywrapfst.pyx":3424
*
*
* cpdef _MutableFst determinize(_Fst ifst, # <<<<<<<<<<<<<<
PyObject* values[7] = {0,0,0,0,0,0,0};
values[2] = ((PyObject *)__pyx_n_b_functional);
- /* "pywrapfst.pyx":3417
+ /* "pywrapfst.pyx":3429
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "determinize") < 0)) __PYX_ERR(0, 3412, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "determinize") < 0)) __PYX_ERR(0, 3424, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
if (values[1]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3413, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__33;
}
__pyx_v_det_type = values[2];
if (values[3]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3415, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3427, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__34;
}
if (values[4]) {
- __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_subsequential_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3416, __pyx_L3_error)
+ __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_subsequential_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3428, __pyx_L3_error)
} else {
__pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);
}
__pyx_v_weight = values[5];
if (values[6]) {
- __pyx_v_increment_subsequential_label = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_increment_subsequential_label == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3418, __pyx_L3_error)
+ __pyx_v_increment_subsequential_label = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_increment_subsequential_label == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3430, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3418
+ /* "pywrapfst.pyx":3430
* int64 subsequential_label=0,
* weight=None,
* bool increment_subsequential_label=False): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3412, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3424, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.determinize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3412, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3424, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_24determinize(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_det_type, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_weight, __pyx_v_increment_subsequential_label);
- /* "pywrapfst.pyx":3412
+ /* "pywrapfst.pyx":3424
*
*
* cpdef _MutableFst determinize(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_2.subsequential_label = __pyx_v_subsequential_label;
__pyx_t_2.weight = __pyx_v_weight;
__pyx_t_2.increment_subsequential_label = __pyx_v_increment_subsequential_label;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_determinize(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3412, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_determinize(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3424, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3470
+/* "pywrapfst.pyx":3482
*
*
* cpdef _MutableFst difference(_Fst ifst1, # <<<<<<<<<<<<<<
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_difference(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_difference *__pyx_optional_args) {
PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3473
+ /* "pywrapfst.pyx":3485
* _Fst ifst2,
* compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3498
+ /* "pywrapfst.pyx":3510
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3498, __pyx_L1_error)
+ __PYX_ERR(0, 3510, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0)));
- /* "pywrapfst.pyx":3501
+ /* "pywrapfst.pyx":3513
* cdef unique_ptr[fst.ComposeOptions] opts
* opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(
* tostring(compose_filter)))) # <<<<<<<<<<<<<<
* fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release())
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3501, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3513, __pyx_L1_error)
- /* "pywrapfst.pyx":3500
+ /* "pywrapfst.pyx":3512
* tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
* cdef unique_ptr[fst.ComposeOptions] opts
* opts.reset(new fst.ComposeOptions(connect, _get_compose_filter( # <<<<<<<<<<<<<<
* tostring(compose_filter))))
* fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
*/
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3500, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3512, __pyx_L1_error)
__pyx_v_opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
- /* "pywrapfst.pyx":3502
+ /* "pywrapfst.pyx":3514
* opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(
* tostring(compose_filter))))
* fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3502, __pyx_L1_error)
+ __PYX_ERR(0, 3514, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3502, __pyx_L1_error)
+ __PYX_ERR(0, 3514, __pyx_L1_error)
}
fst::script::Difference((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3503
+ /* "pywrapfst.pyx":3515
* tostring(compose_filter))))
* fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3503, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3515, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3470
+ /* "pywrapfst.pyx":3482
*
*
* cpdef _MutableFst difference(_Fst ifst1, # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, 1); __PYX_ERR(0, 3470, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, 1); __PYX_ERR(0, 3482, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(0, 3470, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(0, 3482, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
__pyx_v_compose_filter = values[2];
if (values[3]) {
- __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3473, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3485, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3473
+ /* "pywrapfst.pyx":3485
* _Fst ifst2,
* compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3470, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3482, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.difference", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3470, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3471, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3482, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3483, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_26difference(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);
- /* "pywrapfst.pyx":3470
+ /* "pywrapfst.pyx":3482
*
*
* cpdef _MutableFst difference(_Fst ifst1, # <<<<<<<<<<<<<<
__pyx_t_2.__pyx_n = 2;
__pyx_t_2.compose_filter = __pyx_v_compose_filter;
__pyx_t_2.connect = __pyx_v_connect;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_difference(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3470, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_difference(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3506
+/* "pywrapfst.pyx":3518
*
*
* cpdef _MutableFst disambiguate(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__36;
__pyx_t_10basictypes_int64 __pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);
- /* "pywrapfst.pyx":3510
+ /* "pywrapfst.pyx":3522
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3537
+ /* "pywrapfst.pyx":3549
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3537, __pyx_L1_error)
+ __PYX_ERR(0, 3549, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3539
+ /* "pywrapfst.pyx":3551
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 3539, __pyx_L1_error)
+ __PYX_ERR(0, 3551, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3540
+ /* "pywrapfst.pyx":3552
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(),
* weight) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.DisambiguateOptions] opts
* opts.reset(new fst.DisambiguateOptions(delta, wc, nstate,
*/
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3539, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3551, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":3542
+ /* "pywrapfst.pyx":3554
* weight)
* cdef unique_ptr[fst.DisambiguateOptions] opts
* opts.reset(new fst.DisambiguateOptions(delta, wc, nstate, # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::script::DisambiguateOptions(__pyx_v_delta, __pyx_v_wc, __pyx_v_nstate, __pyx_v_subsequential_label));
- /* "pywrapfst.pyx":3544
+ /* "pywrapfst.pyx":3556
* opts.reset(new fst.DisambiguateOptions(delta, wc, nstate,
* subsequential_label))
* fst.Disambiguate(deref(ifst._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3544, __pyx_L1_error)
+ __PYX_ERR(0, 3556, __pyx_L1_error)
}
fst::script::Disambiguate((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3545
+ /* "pywrapfst.pyx":3557
* subsequential_label))
* fst.Disambiguate(deref(ifst._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3545, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3557, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3506
+ /* "pywrapfst.pyx":3518
*
*
* cpdef _MutableFst disambiguate(_Fst ifst, # <<<<<<<<<<<<<<
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_subsequential_label,&__pyx_n_s_weight,0};
PyObject* values[5] = {0,0,0,0,0};
- /* "pywrapfst.pyx":3510
+ /* "pywrapfst.pyx":3522
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "disambiguate") < 0)) __PYX_ERR(0, 3506, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "disambiguate") < 0)) __PYX_ERR(0, 3518, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
if (values[1]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3507, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3519, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__35;
}
if (values[2]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3520, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__36;
}
if (values[3]) {
- __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_subsequential_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3509, __pyx_L3_error)
+ __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_subsequential_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3521, __pyx_L3_error)
} else {
__pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("disambiguate", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3506, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("disambiguate", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3518, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.disambiguate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3506, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3518, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_28disambiguate(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_weight);
- /* "pywrapfst.pyx":3506
+ /* "pywrapfst.pyx":3518
*
*
* cpdef _MutableFst disambiguate(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_2.nstate = __pyx_v_nstate;
__pyx_t_2.subsequential_label = __pyx_v_subsequential_label;
__pyx_t_2.weight = __pyx_v_weight;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_disambiguate(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3506, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_disambiguate(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3518, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3548
+/* "pywrapfst.pyx":3560
*
*
* cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3571
+ /* "pywrapfst.pyx":3583
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3571, __pyx_L1_error)
+ __PYX_ERR(0, 3583, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3572
+ /* "pywrapfst.pyx":3584
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.EpsNormalize(deref(ifst._fst), tfst.get(), fst.EPS_NORM_OUTPUT if # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3572, __pyx_L1_error)
+ __PYX_ERR(0, 3584, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3573
+ /* "pywrapfst.pyx":3585
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.EpsNormalize(deref(ifst._fst), tfst.get(), fst.EPS_NORM_OUTPUT if
* eps_norm_output else # <<<<<<<<<<<<<<
*/
if ((__pyx_v_eps_norm_output != 0)) {
- /* "pywrapfst.pyx":3572
+ /* "pywrapfst.pyx":3584
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.EpsNormalize(deref(ifst._fst), tfst.get(), fst.EPS_NORM_OUTPUT if # <<<<<<<<<<<<<<
__pyx_t_1 = fst::EPS_NORM_OUTPUT;
} else {
- /* "pywrapfst.pyx":3574
+ /* "pywrapfst.pyx":3586
* fst.EpsNormalize(deref(ifst._fst), tfst.get(), fst.EPS_NORM_OUTPUT if
* eps_norm_output else
* fst.EPS_NORM_INPUT) # <<<<<<<<<<<<<<
__pyx_t_1 = fst::EPS_NORM_INPUT;
}
- /* "pywrapfst.pyx":3572
+ /* "pywrapfst.pyx":3584
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.EpsNormalize(deref(ifst._fst), tfst.get(), fst.EPS_NORM_OUTPUT if # <<<<<<<<<<<<<<
*/
fst::script::EpsNormalize((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_t_1);
- /* "pywrapfst.pyx":3575
+ /* "pywrapfst.pyx":3587
* eps_norm_output else
* fst.EPS_NORM_INPUT)
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3575, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3587, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3548
+ /* "pywrapfst.pyx":3560
*
*
* cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=False): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "epsnormalize") < 0)) __PYX_ERR(0, 3548, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "epsnormalize") < 0)) __PYX_ERR(0, 3560, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
if (values[1]) {
- __pyx_v_eps_norm_output = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_eps_norm_output == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3548, __pyx_L3_error)
+ __pyx_v_eps_norm_output = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_eps_norm_output == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3560, __pyx_L3_error)
} else {
__pyx_v_eps_norm_output = ((bool)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("epsnormalize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3548, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("epsnormalize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3560, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.epsnormalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3548, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3560, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_30epsnormalize(__pyx_self, __pyx_v_ifst, __pyx_v_eps_norm_output);
/* function exit code */
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.eps_norm_output = __pyx_v_eps_norm_output;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_epsnormalize(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3548, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_epsnormalize(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3560, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3578
+/* "pywrapfst.pyx":3590
*
*
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3598
+ /* "pywrapfst.pyx":3610
* See also: `equivalent`, `isomorphic`, `randequivalent`.
* """
* return fst.Equal(deref(ifst1._fst), deref(ifst2._fst), delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3598, __pyx_L1_error)
+ __PYX_ERR(0, 3610, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3598, __pyx_L1_error)
+ __PYX_ERR(0, 3610, __pyx_L1_error)
}
__pyx_r = fst::script::Equal((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3578
+ /* "pywrapfst.pyx":3590
*
*
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, 1); __PYX_ERR(0, 3578, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, 1); __PYX_ERR(0, 3590, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(0, 3578, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(0, 3590, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_ifst1 = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
__pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
if (values[2]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3578, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3590, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__37;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3578, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3590, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3578, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3578, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3590, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3590, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_32equal(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);
/* function exit code */
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.delta = __pyx_v_delta;
__pyx_t_1 = __pyx_f_9pywrapfst_equal(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2);
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3578, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3590, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3601
+/* "pywrapfst.pyx":3613
*
*
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3621
+ /* "pywrapfst.pyx":3633
* See also: `equal`, `isomorphic`, `randequivalent`.
* """
* return fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3621, __pyx_L1_error)
+ __PYX_ERR(0, 3633, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3621, __pyx_L1_error)
+ __PYX_ERR(0, 3633, __pyx_L1_error)
}
__pyx_r = fst::script::Equivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3601
+ /* "pywrapfst.pyx":3613
*
*
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *: # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, 1); __PYX_ERR(0, 3601, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, 1); __PYX_ERR(0, 3613, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equivalent") < 0)) __PYX_ERR(0, 3601, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equivalent") < 0)) __PYX_ERR(0, 3613, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_ifst1 = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
__pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
if (values[2]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3613, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__38;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3601, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3613, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.equivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3601, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3601, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3613, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3613, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_34equivalent(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);
/* function exit code */
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.delta = __pyx_v_delta;
- __pyx_t_1 = __pyx_f_9pywrapfst_equivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3601, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_equivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 3613, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3613, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3624
+/* "pywrapfst.pyx":3636
*
*
* cpdef _MutableFst intersect(_Fst ifst1, # <<<<<<<<<<<<<<
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_intersect(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_intersect *__pyx_optional_args) {
PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3627
+ /* "pywrapfst.pyx":3639
* _Fst ifst2,
* compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3650
+ /* "pywrapfst.pyx":3662
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3650, __pyx_L1_error)
+ __PYX_ERR(0, 3662, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0)));
- /* "pywrapfst.pyx":3653
+ /* "pywrapfst.pyx":3665
* cdef unique_ptr[fst.ComposeOptions] opts
* opts.reset(new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter)))) # <<<<<<<<<<<<<<
* fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release())
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3653, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3653, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3665, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3665, __pyx_L1_error)
- /* "pywrapfst.pyx":3652
+ /* "pywrapfst.pyx":3664
* tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
* cdef unique_ptr[fst.ComposeOptions] opts
* opts.reset(new fst.ComposeOptions(connect, # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
- /* "pywrapfst.pyx":3654
+ /* "pywrapfst.pyx":3666
* opts.reset(new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter))))
* fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3654, __pyx_L1_error)
+ __PYX_ERR(0, 3666, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3654, __pyx_L1_error)
+ __PYX_ERR(0, 3666, __pyx_L1_error)
}
fst::script::Intersect((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3655
+ /* "pywrapfst.pyx":3667
* _get_compose_filter(tostring(compose_filter))))
* fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3655, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3667, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3624
+ /* "pywrapfst.pyx":3636
*
*
* cpdef _MutableFst intersect(_Fst ifst1, # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, 1); __PYX_ERR(0, 3624, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, 1); __PYX_ERR(0, 3636, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersect") < 0)) __PYX_ERR(0, 3624, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersect") < 0)) __PYX_ERR(0, 3636, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
__pyx_v_compose_filter = values[2];
if (values[3]) {
- __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3627, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3639, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3627
+ /* "pywrapfst.pyx":3639
* _Fst ifst2,
* compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3624, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3636, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3624, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3625, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3636, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3637, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_36intersect(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);
- /* "pywrapfst.pyx":3624
+ /* "pywrapfst.pyx":3636
*
*
* cpdef _MutableFst intersect(_Fst ifst1, # <<<<<<<<<<<<<<
__pyx_t_2.__pyx_n = 2;
__pyx_t_2.compose_filter = __pyx_v_compose_filter;
__pyx_t_2.connect = __pyx_v_connect;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_intersect(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3624, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_intersect(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3636, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3658
+/* "pywrapfst.pyx":3670
*
*
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3681
+ /* "pywrapfst.pyx":3693
* See also: `equal`, `equivalent`, `randequivalent`.
* """
* return fst.Isomorphic(deref(ifst1._fst), deref(ifst2._fst), delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3681, __pyx_L1_error)
+ __PYX_ERR(0, 3693, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3681, __pyx_L1_error)
+ __PYX_ERR(0, 3693, __pyx_L1_error)
}
__pyx_r = fst::script::Isomorphic((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3658
+ /* "pywrapfst.pyx":3670
*
*
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, 1); __PYX_ERR(0, 3658, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, 1); __PYX_ERR(0, 3670, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isomorphic") < 0)) __PYX_ERR(0, 3658, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isomorphic") < 0)) __PYX_ERR(0, 3670, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_ifst1 = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
__pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
if (values[2]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3658, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3670, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__39;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3658, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3670, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.isomorphic", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3658, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3658, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3670, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3670, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_38isomorphic(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);
/* function exit code */
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.delta = __pyx_v_delta;
__pyx_t_1 = __pyx_f_9pywrapfst_isomorphic(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2);
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3658, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3670, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3684
+/* "pywrapfst.pyx":3696
*
*
* cpdef _MutableFst prune(_Fst ifst, # <<<<<<<<<<<<<<
float __pyx_v_delta = __pyx_k__40;
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__41;
- /* "pywrapfst.pyx":3687
+ /* "pywrapfst.pyx":3699
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3711
+ /* "pywrapfst.pyx":3723
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3711, __pyx_L1_error)
+ __PYX_ERR(0, 3723, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3712
+ /* "pywrapfst.pyx":3724
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 3712, __pyx_L1_error)
+ __PYX_ERR(0, 3724, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3712, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3724, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":3713
+ /* "pywrapfst.pyx":3725
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
* fst.Prune(deref(ifst._fst), tfst.get(), wc, nstate, delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3713, __pyx_L1_error)
+ __PYX_ERR(0, 3725, __pyx_L1_error)
}
fst::script::Prune((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":3714
+ /* "pywrapfst.pyx":3726
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
* fst.Prune(deref(ifst._fst), tfst.get(), wc, nstate, delta)
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3714, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3726, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3684
+ /* "pywrapfst.pyx":3696
*
*
* cpdef _MutableFst prune(_Fst ifst, # <<<<<<<<<<<<<<
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_weight,0};
PyObject* values[4] = {0,0,0,0};
- /* "pywrapfst.pyx":3687
+ /* "pywrapfst.pyx":3699
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 3684, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 3696, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
if (values[1]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3685, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3697, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__40;
}
if (values[2]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3686, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3698, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__41;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3684, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3696, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3684, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3696, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_40prune(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);
- /* "pywrapfst.pyx":3684
+ /* "pywrapfst.pyx":3696
*
*
* cpdef _MutableFst prune(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_2.delta = __pyx_v_delta;
__pyx_t_2.nstate = __pyx_v_nstate;
__pyx_t_2.weight = __pyx_v_weight;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_prune(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3684, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_prune(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3696, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3717
+/* "pywrapfst.pyx":3729
*
*
* cpdef _MutableFst push(_Fst ifst, # <<<<<<<<<<<<<<
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_push *__pyx_optional_args) {
float __pyx_v_delta = __pyx_k__42;
- /* "pywrapfst.pyx":3719
+ /* "pywrapfst.pyx":3731
* cpdef _MutableFst push(_Fst ifst,
* float delta=fst.kDelta,
* bool push_weights=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_push_weights = ((bool)0);
- /* "pywrapfst.pyx":3720
+ /* "pywrapfst.pyx":3732
* float delta=fst.kDelta,
* bool push_weights=False,
* bool push_labels=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_push_labels = ((bool)0);
- /* "pywrapfst.pyx":3721
+ /* "pywrapfst.pyx":3733
* bool push_weights=False,
* bool push_labels=False,
* bool remove_common_affix=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_common_affix = ((bool)0);
- /* "pywrapfst.pyx":3722
+ /* "pywrapfst.pyx":3734
* bool push_labels=False,
* bool remove_common_affix=False,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_total_weight = ((bool)0);
- /* "pywrapfst.pyx":3723
+ /* "pywrapfst.pyx":3735
* bool remove_common_affix=False,
* bool remove_total_weight=False,
* bool to_final=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3763
+ /* "pywrapfst.pyx":3775
* # This is copied, almost verbatim, from nlp/fst/bin/fstpush.cc.
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3763, __pyx_L1_error)
+ __PYX_ERR(0, 3775, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3764
+ /* "pywrapfst.pyx":3776
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* cdef uint32 flags = fst.GetPushFlags(push_weights, push_labels, # <<<<<<<<<<<<<<
*/
__pyx_v_flags = fst::script::GetPushFlags(__pyx_v_push_weights, __pyx_v_push_labels, __pyx_v_remove_common_affix, __pyx_v_remove_total_weight);
- /* "pywrapfst.pyx":3766
+ /* "pywrapfst.pyx":3778
* cdef uint32 flags = fst.GetPushFlags(push_weights, push_labels,
* remove_common_affix, remove_total_weight)
* fst.Push(deref(ifst._fst), tfst.get(), flags, fst.GetReweightType(to_final), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3766, __pyx_L1_error)
+ __PYX_ERR(0, 3778, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3767
+ /* "pywrapfst.pyx":3779
* remove_common_affix, remove_total_weight)
* fst.Push(deref(ifst._fst), tfst.get(), flags, fst.GetReweightType(to_final),
* delta) # <<<<<<<<<<<<<<
*/
fst::script::Push((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_flags, fst::script::GetReweightType(__pyx_v_to_final), __pyx_v_delta);
- /* "pywrapfst.pyx":3768
+ /* "pywrapfst.pyx":3780
* fst.Push(deref(ifst._fst), tfst.get(), flags, fst.GetReweightType(to_final),
* delta)
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3768, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3780, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3717
+ /* "pywrapfst.pyx":3729
*
*
* cpdef _MutableFst push(_Fst ifst, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 3717, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 3729, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
if (values[1]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3718, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3730, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__42;
}
if (values[2]) {
- __pyx_v_push_weights = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_push_weights == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3719, __pyx_L3_error)
+ __pyx_v_push_weights = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_push_weights == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3731, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3719
+ /* "pywrapfst.pyx":3731
* cpdef _MutableFst push(_Fst ifst,
* float delta=fst.kDelta,
* bool push_weights=False, # <<<<<<<<<<<<<<
__pyx_v_push_weights = ((bool)0);
}
if (values[3]) {
- __pyx_v_push_labels = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_push_labels == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3720, __pyx_L3_error)
+ __pyx_v_push_labels = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_push_labels == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3732, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3720
+ /* "pywrapfst.pyx":3732
* float delta=fst.kDelta,
* bool push_weights=False,
* bool push_labels=False, # <<<<<<<<<<<<<<
__pyx_v_push_labels = ((bool)0);
}
if (values[4]) {
- __pyx_v_remove_common_affix = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_remove_common_affix == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3721, __pyx_L3_error)
+ __pyx_v_remove_common_affix = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_remove_common_affix == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3733, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3721
+ /* "pywrapfst.pyx":3733
* bool push_weights=False,
* bool push_labels=False,
* bool remove_common_affix=False, # <<<<<<<<<<<<<<
__pyx_v_remove_common_affix = ((bool)0);
}
if (values[5]) {
- __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3722, __pyx_L3_error)
+ __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3734, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3722
+ /* "pywrapfst.pyx":3734
* bool push_labels=False,
* bool remove_common_affix=False,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
__pyx_v_remove_total_weight = ((bool)0);
}
if (values[6]) {
- __pyx_v_to_final = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_to_final == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3723, __pyx_L3_error)
+ __pyx_v_to_final = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_to_final == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3735, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3723
+ /* "pywrapfst.pyx":3735
* bool remove_common_affix=False,
* bool remove_total_weight=False,
* bool to_final=False): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("push", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3717, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("push", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3729, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3717, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3729, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_42push(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_push_weights, __pyx_v_push_labels, __pyx_v_remove_common_affix, __pyx_v_remove_total_weight, __pyx_v_to_final);
- /* "pywrapfst.pyx":3717
+ /* "pywrapfst.pyx":3729
*
*
* cpdef _MutableFst push(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_2.remove_common_affix = __pyx_v_remove_common_affix;
__pyx_t_2.remove_total_weight = __pyx_v_remove_total_weight;
__pyx_t_2.to_final = __pyx_v_to_final;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_push(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3717, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_push(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3729, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3771
+/* "pywrapfst.pyx":3783
*
*
* cpdef bool randequivalent(_Fst ifst1, # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3806
+ /* "pywrapfst.pyx":3818
* See also: `equal`, `equivalent`, `isomorphic`, `randgen`.
* """
* cdef fst.RandArcSelection ras = _get_rand_arc_selection(tostring(select)) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
* # The three trailing options will be ignored by RandEquivalent.
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3818, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3818, __pyx_L1_error)
__pyx_v_ras = __pyx_t_2;
- /* "pywrapfst.pyx":3809
+ /* "pywrapfst.pyx":3821
* cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
* # The three trailing options will be ignored by RandEquivalent.
* opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length, # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::RandGenOptions<enum fst::script::RandArcSelection> (__pyx_v_ras, __pyx_v_max_length, 1, 0, 0));
- /* "pywrapfst.pyx":3811
+ /* "pywrapfst.pyx":3823
* opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,
* 1, False, False))
* if seed == 0: # <<<<<<<<<<<<<<
__pyx_t_3 = ((__pyx_v_seed == 0) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":3812
+ /* "pywrapfst.pyx":3824
* 1, False, False))
* if seed == 0:
* seed = time(NULL) + getpid() # <<<<<<<<<<<<<<
*/
__pyx_v_seed = (time(NULL) + getpid());
- /* "pywrapfst.pyx":3811
+ /* "pywrapfst.pyx":3823
* opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,
* 1, False, False))
* if seed == 0: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3813
+ /* "pywrapfst.pyx":3825
* if seed == 0:
* seed = time(NULL) + getpid()
* return fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), npath, delta, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3813, __pyx_L1_error)
+ __PYX_ERR(0, 3825, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3813, __pyx_L1_error)
+ __PYX_ERR(0, 3825, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3814
+ /* "pywrapfst.pyx":3826
* seed = time(NULL) + getpid()
* return fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), npath, delta,
* seed, deref(opts)) # <<<<<<<<<<<<<<
__pyx_r = fst::script::RandEquivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_npath, __pyx_v_delta, __pyx_v_seed, (*__pyx_v_opts));
goto __pyx_L0;
- /* "pywrapfst.pyx":3771
+ /* "pywrapfst.pyx":3783
*
*
* cpdef bool randequivalent(_Fst ifst1, # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, 1); __PYX_ERR(0, 3771, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, 1); __PYX_ERR(0, 3783, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randequivalent") < 0)) __PYX_ERR(0, 3771, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randequivalent") < 0)) __PYX_ERR(0, 3783, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_ifst1 = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
__pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
if (values[2]) {
- __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_npath == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3773, __pyx_L3_error)
+ __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_npath == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3785, __pyx_L3_error)
} else {
__pyx_v_npath = ((__pyx_t_10basictypes_int32)1);
}
if (values[3]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3774, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3786, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__43;
}
if (values[4]) {
- __pyx_v_seed = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_seed == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3775, __pyx_L3_error)
+ __pyx_v_seed = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_seed == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3787, __pyx_L3_error)
} else {
__pyx_v_seed = ((time_t)0);
}
__pyx_v_select = values[5];
if (values[6]) {
- __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[6]); if (unlikely((__pyx_v_max_length == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3777, __pyx_L3_error)
+ __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[6]); if (unlikely((__pyx_v_max_length == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3789, __pyx_L3_error)
} else {
__pyx_v_max_length = __pyx_k__44;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3771, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3783, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.randequivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3771, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3772, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3783, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3784, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_44randequivalent(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_npath, __pyx_v_delta, __pyx_v_seed, __pyx_v_select, __pyx_v_max_length);
/* function exit code */
__pyx_t_2.seed = __pyx_v_seed;
__pyx_t_2.select = __pyx_v_select;
__pyx_t_2.max_length = __pyx_v_max_length;
- __pyx_t_1 = __pyx_f_9pywrapfst_randequivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 3771, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3771, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_randequivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 3783, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3817
+/* "pywrapfst.pyx":3829
*
*
* cpdef _MutableFst randgen(_Fst ifst, # <<<<<<<<<<<<<<
PyObject *__pyx_v_select = ((PyObject *)__pyx_n_b_uniform);
__pyx_t_10basictypes_int32 __pyx_v_max_length = __pyx_k__45;
- /* "pywrapfst.pyx":3822
+ /* "pywrapfst.pyx":3834
* select=b"uniform",
* int32 max_length=INT32_MAX,
* bool weighted=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_weighted = ((bool)0);
- /* "pywrapfst.pyx":3823
+ /* "pywrapfst.pyx":3835
* int32 max_length=INT32_MAX,
* bool weighted=False,
* bool remove_total_weight=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3855
+ /* "pywrapfst.pyx":3867
* See also: `randequivalent`.
* """
* cdef fst.RandArcSelection ras = _get_rand_arc_selection(tostring(select)) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
* opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3855, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3855, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3867, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3867, __pyx_L1_error)
__pyx_v_ras = __pyx_t_2;
- /* "pywrapfst.pyx":3857
+ /* "pywrapfst.pyx":3869
* cdef fst.RandArcSelection ras = _get_rand_arc_selection(tostring(select))
* cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
* opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length, # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::RandGenOptions<enum fst::script::RandArcSelection> (__pyx_v_ras, __pyx_v_max_length, __pyx_v_npath, __pyx_v_weighted, __pyx_v_remove_total_weight));
- /* "pywrapfst.pyx":3861
+ /* "pywrapfst.pyx":3873
* remove_total_weight))
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3861, __pyx_L1_error)
+ __PYX_ERR(0, 3873, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3862
+ /* "pywrapfst.pyx":3874
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* if seed == 0: # <<<<<<<<<<<<<<
__pyx_t_3 = ((__pyx_v_seed == 0) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":3863
+ /* "pywrapfst.pyx":3875
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* if seed == 0:
* seed = time(NULL) + getpid() # <<<<<<<<<<<<<<
*/
__pyx_v_seed = (time(NULL) + getpid());
- /* "pywrapfst.pyx":3862
+ /* "pywrapfst.pyx":3874
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* if seed == 0: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3864
+ /* "pywrapfst.pyx":3876
* if seed == 0:
* seed = time(NULL) + getpid()
* fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3864, __pyx_L1_error)
+ __PYX_ERR(0, 3876, __pyx_L1_error)
}
fst::script::RandGen((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_seed, (*__pyx_v_opts));
- /* "pywrapfst.pyx":3865
+ /* "pywrapfst.pyx":3877
* seed = time(NULL) + getpid()
* fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3865, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3877, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3817
+ /* "pywrapfst.pyx":3829
*
*
* cpdef _MutableFst randgen(_Fst ifst, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randgen") < 0)) __PYX_ERR(0, 3817, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randgen") < 0)) __PYX_ERR(0, 3829, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
if (values[1]) {
- __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[1]); if (unlikely((__pyx_v_npath == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3818, __pyx_L3_error)
+ __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[1]); if (unlikely((__pyx_v_npath == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3830, __pyx_L3_error)
} else {
__pyx_v_npath = ((__pyx_t_10basictypes_int32)1);
}
if (values[2]) {
- __pyx_v_seed = __Pyx_PyInt_As_time_t(values[2]); if (unlikely((__pyx_v_seed == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3819, __pyx_L3_error)
+ __pyx_v_seed = __Pyx_PyInt_As_time_t(values[2]); if (unlikely((__pyx_v_seed == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3831, __pyx_L3_error)
} else {
__pyx_v_seed = ((time_t)0);
}
__pyx_v_select = values[3];
if (values[4]) {
- __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[4]); if (unlikely((__pyx_v_max_length == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3821, __pyx_L3_error)
+ __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[4]); if (unlikely((__pyx_v_max_length == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3833, __pyx_L3_error)
} else {
__pyx_v_max_length = __pyx_k__45;
}
if (values[5]) {
- __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3822, __pyx_L3_error)
+ __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3834, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3822
+ /* "pywrapfst.pyx":3834
* select=b"uniform",
* int32 max_length=INT32_MAX,
* bool weighted=False, # <<<<<<<<<<<<<<
__pyx_v_weighted = ((bool)0);
}
if (values[6]) {
- __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3823, __pyx_L3_error)
+ __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3835, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3823
+ /* "pywrapfst.pyx":3835
* int32 max_length=INT32_MAX,
* bool weighted=False,
* bool remove_total_weight=False): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("randgen", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3817, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randgen", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3829, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.randgen", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3817, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3829, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_46randgen(__pyx_self, __pyx_v_ifst, __pyx_v_npath, __pyx_v_seed, __pyx_v_select, __pyx_v_max_length, __pyx_v_weighted, __pyx_v_remove_total_weight);
- /* "pywrapfst.pyx":3817
+ /* "pywrapfst.pyx":3829
*
*
* cpdef _MutableFst randgen(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_2.max_length = __pyx_v_max_length;
__pyx_t_2.remove_total_weight = __pyx_v_weighted;
__pyx_t_2.weighted = __pyx_v_remove_total_weight;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_randgen(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3817, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_randgen(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3829, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3868
+/* "pywrapfst.pyx":3880
*
*
* cpdef _MutableFst replace(pairs, # <<<<<<<<<<<<<<
PyObject *__pyx_v_call_arc_labeling = ((PyObject *)__pyx_n_b_input);
PyObject *__pyx_v_return_arc_labeling = ((PyObject *)__pyx_n_b_neither);
- /* "pywrapfst.pyx":3871
+ /* "pywrapfst.pyx":3883
* call_arc_labeling=b"input",
* return_arc_labeling=b"neither",
* bool epsilon_on_replace=False, # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3913
+ /* "pywrapfst.pyx":3925
* cdef int64 label
* cdef _Fst ifst
* it = iter(pairs) # <<<<<<<<<<<<<<
* (root_label, ifst) = next(it)
* _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
*/
- __pyx_t_1 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3913, __pyx_L1_error)
+ __pyx_t_1 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3925, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_it = __pyx_t_1;
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":3914
+ /* "pywrapfst.pyx":3926
* cdef _Fst ifst
* it = iter(pairs)
* (root_label, ifst) = next(it) # <<<<<<<<<<<<<<
* _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
* cdef unique_ptr[fst.VectorFstClass] tfst
*/
- __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3914, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3926, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 3914, __pyx_L1_error)
+ __PYX_ERR(0, 3926, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
#else
- __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3914, __pyx_L1_error)
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3926, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3914, __pyx_L1_error)
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3926, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3914, __pyx_L1_error)
+ __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3926, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 3914, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 3926, __pyx_L1_error)
__pyx_t_5 = NULL;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L4_unpacking_done;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 3914, __pyx_L1_error)
+ __PYX_ERR(0, 3926, __pyx_L1_error)
__pyx_L4_unpacking_done:;
}
- __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3914, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3926, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3914, __pyx_L1_error)
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3926, __pyx_L1_error)
__pyx_v_root_label = __pyx_t_6;
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "pywrapfst.pyx":3915
+ /* "pywrapfst.pyx":3927
* it = iter(pairs)
* (root_label, ifst) = next(it)
* _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3915, __pyx_L1_error)
+ __PYX_ERR(0, 3927, __pyx_L1_error)
}
try {
__pyx_t_7 = __pyx_t_3fst_LabelFstClassPair(__pyx_v_root_label, __pyx_v_ifst->_fst.get());
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 3915, __pyx_L1_error)
+ __PYX_ERR(0, 3927, __pyx_L1_error)
}
try {
__pyx_v__pairs.push_back(__pyx_t_7);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 3915, __pyx_L1_error)
+ __PYX_ERR(0, 3927, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3917
+ /* "pywrapfst.pyx":3929
* _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3917, __pyx_L1_error)
+ __PYX_ERR(0, 3929, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3918
+ /* "pywrapfst.pyx":3930
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* for (label, ifst) in it: # <<<<<<<<<<<<<<
__pyx_t_1 = __pyx_v_it; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3918, __pyx_L1_error)
+ __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3918, __pyx_L1_error)
+ __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3930, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_9)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3918, __pyx_L1_error)
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3930, __pyx_L1_error)
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3918, __pyx_L1_error)
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3918, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3930, __pyx_L1_error)
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3918, __pyx_L1_error)
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 3918, __pyx_L1_error)
+ else __PYX_ERR(0, 3930, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 3918, __pyx_L1_error)
+ __PYX_ERR(0, 3930, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
#else
- __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3918, __pyx_L1_error)
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3918, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3918, __pyx_L1_error)
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = Py_TYPE(__pyx_t_10)->tp_iternext;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_10), 2) < 0) __PYX_ERR(0, 3918, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_10), 2) < 0) __PYX_ERR(0, 3930, __pyx_L1_error)
__pyx_t_5 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L8_unpacking_done;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_5 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 3918, __pyx_L1_error)
+ __PYX_ERR(0, 3930, __pyx_L1_error)
__pyx_L8_unpacking_done:;
}
- __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3918, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3930, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3918, __pyx_L1_error)
+ if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3930, __pyx_L1_error)
__pyx_v_label = __pyx_t_6;
__Pyx_DECREF_SET(__pyx_v_ifst, ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_4));
__pyx_t_4 = 0;
- /* "pywrapfst.pyx":3919
+ /* "pywrapfst.pyx":3931
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* for (label, ifst) in it:
* _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3919, __pyx_L1_error)
+ __PYX_ERR(0, 3931, __pyx_L1_error)
}
try {
__pyx_t_7 = __pyx_t_3fst_LabelFstClassPair(__pyx_v_label, __pyx_v_ifst->_fst.get());
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 3919, __pyx_L1_error)
+ __PYX_ERR(0, 3931, __pyx_L1_error)
}
try {
__pyx_v__pairs.push_back(__pyx_t_7);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 3919, __pyx_L1_error)
+ __PYX_ERR(0, 3931, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3918
+ /* "pywrapfst.pyx":3930
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* for (label, ifst) in it: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":3921
+ /* "pywrapfst.pyx":3933
* _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get()))
* cdef fst.ReplaceLabelType cal = _get_replace_label_type(
* tostring(call_arc_labeling), epsilon_on_replace) # <<<<<<<<<<<<<<
* cdef fst.ReplaceLabelType ral = _get_replace_label_type(
* tostring(return_arc_labeling), epsilon_on_replace)
*/
- __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_call_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3921, __pyx_L1_error)
+ __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_call_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3933, __pyx_L1_error)
- /* "pywrapfst.pyx":3920
+ /* "pywrapfst.pyx":3932
* for (label, ifst) in it:
* _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get()))
* cdef fst.ReplaceLabelType cal = _get_replace_label_type( # <<<<<<<<<<<<<<
* tostring(call_arc_labeling), epsilon_on_replace)
* cdef fst.ReplaceLabelType ral = _get_replace_label_type(
*/
- __pyx_t_12 = __pyx_f_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3920, __pyx_L1_error)
+ __pyx_t_12 = __pyx_f_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3932, __pyx_L1_error)
__pyx_v_cal = __pyx_t_12;
- /* "pywrapfst.pyx":3923
+ /* "pywrapfst.pyx":3935
* tostring(call_arc_labeling), epsilon_on_replace)
* cdef fst.ReplaceLabelType ral = _get_replace_label_type(
* tostring(return_arc_labeling), epsilon_on_replace) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.ReplaceOptions] opts
* opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label))
*/
- __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_return_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3923, __pyx_L1_error)
+ __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_return_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3935, __pyx_L1_error)
- /* "pywrapfst.pyx":3922
+ /* "pywrapfst.pyx":3934
* cdef fst.ReplaceLabelType cal = _get_replace_label_type(
* tostring(call_arc_labeling), epsilon_on_replace)
* cdef fst.ReplaceLabelType ral = _get_replace_label_type( # <<<<<<<<<<<<<<
* tostring(return_arc_labeling), epsilon_on_replace)
* cdef unique_ptr[fst.ReplaceOptions] opts
*/
- __pyx_t_12 = __pyx_f_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3922, __pyx_L1_error)
+ __pyx_t_12 = __pyx_f_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3934, __pyx_L1_error)
__pyx_v_ral = __pyx_t_12;
- /* "pywrapfst.pyx":3925
+ /* "pywrapfst.pyx":3937
* tostring(return_arc_labeling), epsilon_on_replace)
* cdef unique_ptr[fst.ReplaceOptions] opts
* opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label)) # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::script::ReplaceOptions(__pyx_v_root_label, __pyx_v_cal, __pyx_v_ral, __pyx_v_return_label));
- /* "pywrapfst.pyx":3926
+ /* "pywrapfst.pyx":3938
* cdef unique_ptr[fst.ReplaceOptions] opts
* opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label))
* fst.Replace(_pairs, tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
fst::script::Replace(__pyx_v__pairs, __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3927
+ /* "pywrapfst.pyx":3939
* opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label))
* fst.Replace(_pairs, tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3927, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3939, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3868
+ /* "pywrapfst.pyx":3880
*
*
* cpdef _MutableFst replace(pairs, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(0, 3868, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(0, 3880, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_call_arc_labeling = values[1];
__pyx_v_return_arc_labeling = values[2];
if (values[3]) {
- __pyx_v_epsilon_on_replace = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_epsilon_on_replace == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3871, __pyx_L3_error)
+ __pyx_v_epsilon_on_replace = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_epsilon_on_replace == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3883, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3871
+ /* "pywrapfst.pyx":3883
* call_arc_labeling=b"input",
* return_arc_labeling=b"neither",
* bool epsilon_on_replace=False, # <<<<<<<<<<<<<<
__pyx_v_epsilon_on_replace = ((bool)0);
}
if (values[4]) {
- __pyx_v_return_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_return_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3872, __pyx_L3_error)
+ __pyx_v_return_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_return_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3884, __pyx_L3_error)
} else {
__pyx_v_return_label = ((__pyx_t_10basictypes_int64)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("replace", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3868, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("replace", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3880, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_9pywrapfst_48replace(__pyx_self, __pyx_v_pairs, __pyx_v_call_arc_labeling, __pyx_v_return_arc_labeling, __pyx_v_epsilon_on_replace, __pyx_v_return_label);
- /* "pywrapfst.pyx":3868
+ /* "pywrapfst.pyx":3880
*
*
* cpdef _MutableFst replace(pairs, # <<<<<<<<<<<<<<
__pyx_t_2.return_arc_labeling = __pyx_v_return_arc_labeling;
__pyx_t_2.epsilon_on_replace = __pyx_v_epsilon_on_replace;
__pyx_t_2.return_label = __pyx_v_return_label;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_replace(__pyx_v_pairs, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3868, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_replace(__pyx_v_pairs, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3880, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3930
+/* "pywrapfst.pyx":3942
*
*
* cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=True): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3950
+ /* "pywrapfst.pyx":3962
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3950, __pyx_L1_error)
+ __PYX_ERR(0, 3962, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3951
+ /* "pywrapfst.pyx":3963
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.Reverse(deref(ifst._fst), tfst.get(), require_superinitial) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3951, __pyx_L1_error)
+ __PYX_ERR(0, 3963, __pyx_L1_error)
}
fst::script::Reverse((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_require_superinitial);
- /* "pywrapfst.pyx":3952
+ /* "pywrapfst.pyx":3964
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.Reverse(deref(ifst._fst), tfst.get(), require_superinitial)
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3952, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3964, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3930
+ /* "pywrapfst.pyx":3942
*
*
* cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=True): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reverse") < 0)) __PYX_ERR(0, 3930, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reverse") < 0)) __PYX_ERR(0, 3942, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
if (values[1]) {
- __pyx_v_require_superinitial = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_require_superinitial == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3930, __pyx_L3_error)
+ __pyx_v_require_superinitial = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_require_superinitial == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3942, __pyx_L3_error)
} else {
__pyx_v_require_superinitial = ((bool)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("reverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3930, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3942, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3930, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3942, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_50reverse(__pyx_self, __pyx_v_ifst, __pyx_v_require_superinitial);
/* function exit code */
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.require_superinitial = __pyx_v_require_superinitial;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_reverse(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3930, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_reverse(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3942, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3958
+/* "pywrapfst.pyx":3970
*
*
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__47;
PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3962
+ /* "pywrapfst.pyx":3974
* int64 nstate=fst.kNoStateId,
* queue_type=b"auto",
* bool reverse=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3964
+ /* "pywrapfst.pyx":3976
* bool reverse=False) except *:
* cdef unique_ptr[vector[fst.WeightClass]] distance
* distance.reset(new vector[fst.WeightClass]()) # <<<<<<<<<<<<<<
__pyx_t_1 = new std::vector<fst::script::WeightClass> ();
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 3964, __pyx_L1_error)
+ __PYX_ERR(0, 3976, __pyx_L1_error)
}
__pyx_v_distance.reset(__pyx_t_1);
- /* "pywrapfst.pyx":3968
+ /* "pywrapfst.pyx":3980
* # not be used in all cases.
* cdef unique_ptr[fst.ShortestDistanceOptions] opts
* if reverse: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_v_reverse != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":3971
+ /* "pywrapfst.pyx":3983
* # Only the simpler signature supports shortest distance to final states;
* # `nstate` and `queue_type` arguments are ignored.
* fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3971, __pyx_L1_error)
+ __PYX_ERR(0, 3983, __pyx_L1_error)
}
fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance.get(), 1, __pyx_v_delta);
- /* "pywrapfst.pyx":3968
+ /* "pywrapfst.pyx":3980
* # not be used in all cases.
* cdef unique_ptr[fst.ShortestDistanceOptions] opts
* if reverse: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":3973
+ /* "pywrapfst.pyx":3985
* fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta)
* else:
* opts.reset(new fst.ShortestDistanceOptions( # <<<<<<<<<<<<<<
*/
/*else*/ {
- /* "pywrapfst.pyx":3974
+ /* "pywrapfst.pyx":3986
* else:
* opts.reset(new fst.ShortestDistanceOptions(
* _get_queue_type(tostring(queue_type)), fst.ANY_ARC_FILTER, nstate, # <<<<<<<<<<<<<<
* delta))
* fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts))
*/
- __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3974, __pyx_L1_error)
- __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3974, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3986, __pyx_L1_error)
+ __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3986, __pyx_L1_error)
- /* "pywrapfst.pyx":3973
+ /* "pywrapfst.pyx":3985
* fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta)
* else:
* opts.reset(new fst.ShortestDistanceOptions( # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::script::ShortestDistanceOptions(__pyx_t_4, fst::script::ANY_ARC_FILTER, __pyx_v_nstate, __pyx_v_delta));
- /* "pywrapfst.pyx":3976
+ /* "pywrapfst.pyx":3988
* _get_queue_type(tostring(queue_type)), fst.ANY_ARC_FILTER, nstate,
* delta))
* fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3976, __pyx_L1_error)
+ __PYX_ERR(0, 3988, __pyx_L1_error)
}
fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance.get(), (*__pyx_v_opts));
}
__pyx_L3:;
- /* "pywrapfst.pyx":3977
+ /* "pywrapfst.pyx":3989
* delta))
* fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts))
* return distance.release() # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_distance.release();
goto __pyx_L0;
- /* "pywrapfst.pyx":3958
+ /* "pywrapfst.pyx":3970
*
*
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3980
+/* "pywrapfst.pyx":3992
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 3980, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 3992, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
if (values[1]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3981, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3993, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__48;
}
if (values[2]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3982, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3994, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__49;
}
__pyx_v_queue_type = values[3];
if (values[4]) {
- __pyx_v_reverse = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_reverse == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3984, __pyx_L3_error)
+ __pyx_v_reverse = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_reverse == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3996, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3984
+ /* "pywrapfst.pyx":3996
* int64 nstate=fst.kNoStateId,
* queue_type=b"auto",
* bool reverse=False): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3980, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3992, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.shortestdistance", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3980, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3992, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_52shortestdistance(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_queue_type, __pyx_v_reverse);
- /* "pywrapfst.pyx":3980
+ /* "pywrapfst.pyx":3992
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("shortestdistance", 0);
- /* "pywrapfst.pyx":4012
+ /* "pywrapfst.pyx":4024
* """
* cdef unique_ptr[vector[fst.WeightClass]] distance
* distance.reset(_shortestdistance(ifst, delta, nstate, queue_type, reverse)) # <<<<<<<<<<<<<<
__pyx_t_2.nstate = __pyx_v_nstate;
__pyx_t_2.queue_type = __pyx_v_queue_type;
__pyx_t_2.reverse = __pyx_v_reverse;
- __pyx_t_1 = __pyx_f_9pywrapfst__shortestdistance(__pyx_v_ifst, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4012, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__shortestdistance(__pyx_v_ifst, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4024, __pyx_L1_error)
__pyx_v_distance.reset(__pyx_t_1);
- /* "pywrapfst.pyx":4013
+ /* "pywrapfst.pyx":4025
* cdef unique_ptr[vector[fst.WeightClass]] distance
* distance.reset(_shortestdistance(ifst, delta, nstate, queue_type, reverse))
* cdef string weight_type = ifst.weight_type() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 4013, __pyx_L1_error)
+ __PYX_ERR(0, 4025, __pyx_L1_error)
}
__pyx_v_weight_type = ((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0);
- /* "pywrapfst.pyx":4014
+ /* "pywrapfst.pyx":4026
* distance.reset(_shortestdistance(ifst, delta, nstate, queue_type, reverse))
* cdef string weight_type = ifst.weight_type()
* return [Weight(weight_type, weight.ToString()) for weight in deref(distance)] # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
{ /* enter inner scope */
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4014, __pyx_L1_error)
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4026, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = &(*__pyx_v_distance);
__pyx_t_4 = __pyx_t_1->begin();
__pyx_t_5 = *__pyx_t_4;
++__pyx_t_4;
__pyx_7genexpr__pyx_v_weight = __pyx_t_5;
- __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_weight_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4014, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_weight_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4026, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_7genexpr__pyx_v_weight.ToString()); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4014, __pyx_L1_error)
+ __pyx_t_7 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_7genexpr__pyx_v_weight.ToString()); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4026, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4014, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4026, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
__pyx_t_6 = 0;
__pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4014, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4026, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 4014, __pyx_L1_error)
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 4026, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
} /* exit inner scope */
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3980
+ /* "pywrapfst.pyx":3992
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4017
+/* "pywrapfst.pyx":4029
*
*
* cpdef _MutableFst shortestpath(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__51;
PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":4022
+ /* "pywrapfst.pyx":4034
* int64 nstate=fst.kNoStateId,
* queue_type=b"auto",
* bool unique=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_unique = ((bool)0);
- /* "pywrapfst.pyx":4023
+ /* "pywrapfst.pyx":4035
* queue_type=b"auto",
* bool unique=False,
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":4055
+ /* "pywrapfst.pyx":4067
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 4055, __pyx_L1_error)
+ __PYX_ERR(0, 4067, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":4057
+ /* "pywrapfst.pyx":4069
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 4057, __pyx_L1_error)
+ __PYX_ERR(0, 4069, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4057, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4069, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":4059
+ /* "pywrapfst.pyx":4071
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
* cdef unique_ptr[fst.ShortestPathOptions] opts
* opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
* nshortest, unique, delta, wc, nstate))
* fst.ShortestPath(deref(ifst._fst), tfst.get(), deref(opts))
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4059, __pyx_L1_error)
- __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4059, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4071, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4071, __pyx_L1_error)
- /* "pywrapfst.pyx":4060
+ /* "pywrapfst.pyx":4072
* cdef unique_ptr[fst.ShortestPathOptions] opts
* opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),
* nshortest, unique, delta, wc, nstate)) # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::script::ShortestPathOptions(__pyx_t_3, __pyx_v_nshortest, __pyx_v_unique, __pyx_v_delta, __pyx_v_wc, __pyx_v_nstate));
- /* "pywrapfst.pyx":4061
+ /* "pywrapfst.pyx":4073
* opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),
* nshortest, unique, delta, wc, nstate))
* fst.ShortestPath(deref(ifst._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4061, __pyx_L1_error)
+ __PYX_ERR(0, 4073, __pyx_L1_error)
}
fst::script::ShortestPath((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":4062
+ /* "pywrapfst.pyx":4074
* nshortest, unique, delta, wc, nstate))
* fst.ShortestPath(deref(ifst._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4062, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4074, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4017
+ /* "pywrapfst.pyx":4029
*
*
* cpdef _MutableFst shortestpath(_Fst ifst, # <<<<<<<<<<<<<<
PyObject* values[7] = {0,0,0,0,0,0,0};
values[4] = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":4023
+ /* "pywrapfst.pyx":4035
* queue_type=b"auto",
* bool unique=False,
* weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestpath") < 0)) __PYX_ERR(0, 4017, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestpath") < 0)) __PYX_ERR(0, 4029, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
if (values[1]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 4018, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 4030, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__50;
}
if (values[2]) {
- __pyx_v_nshortest = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_nshortest == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4019, __pyx_L3_error)
+ __pyx_v_nshortest = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_nshortest == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4031, __pyx_L3_error)
} else {
__pyx_v_nshortest = ((__pyx_t_10basictypes_int32)1);
}
if (values[3]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4020, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4032, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__51;
}
__pyx_v_queue_type = values[4];
if (values[5]) {
- __pyx_v_unique = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_unique == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4022, __pyx_L3_error)
+ __pyx_v_unique = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_unique == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4034, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4022
+ /* "pywrapfst.pyx":4034
* int64 nstate=fst.kNoStateId,
* queue_type=b"auto",
* bool unique=False, # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4017, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4029, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.shortestpath", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4017, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4029, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_54shortestpath(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nshortest, __pyx_v_nstate, __pyx_v_queue_type, __pyx_v_unique, __pyx_v_weight);
- /* "pywrapfst.pyx":4017
+ /* "pywrapfst.pyx":4029
*
*
* cpdef _MutableFst shortestpath(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_2.queue_type = __pyx_v_queue_type;
__pyx_t_2.unique = __pyx_v_unique;
__pyx_t_2.weight = __pyx_v_weight;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_shortestpath(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4017, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_shortestpath(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4029, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4065
+/* "pywrapfst.pyx":4077
*
*
* cpdef _Fst statemap(_Fst ifst, map_type): # <<<<<<<<<<<<<<
struct __pyx_opt_args_9pywrapfst__map __pyx_t_2;
__Pyx_RefNannySetupContext("statemap", 0);
- /* "pywrapfst.pyx":4088
+ /* "pywrapfst.pyx":4102
* See also: `arcmap`.
* """
* return _map(ifst, fst.kDelta, map_type, 1., None) # <<<<<<<<<<<<<<
__pyx_t_2.map_type = __pyx_v_map_type;
__pyx_t_2.power = 1.;
__pyx_t_2.weight = Py_None;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__map(__pyx_v_ifst, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4088, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__map(__pyx_v_ifst, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4065
+ /* "pywrapfst.pyx":4077
*
*
* cpdef _Fst statemap(_Fst ifst, map_type): # <<<<<<<<<<<<<<
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_57statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_56statemap[] = "\n state_map(ifst, map_type)\n\n Constructively applies a transform to all states.\n\n This operation transforms each state according to the requested map type.\n Note that currently, only one state-mapping operation is supported.\n\n Args:\n ifst: The input FST.\n map_type: A string matching a known mapping operation; one of: \"arc_sum\"\n (sum weights of identically-labeled multi-arcs), \"arc_unique\" (deletes\n non-unique identically-labeled multi-arcs).\n\n Returns:\n An FST with states remapped.\n\n Raises:\n FstArgError: Unknown map type.\n\n See also: `arcmap`.\n ";
+static char __pyx_doc_9pywrapfst_56statemap[] = "\n state_map(ifst, map_type)\n\n Constructively applies a transform to all states.\n\n This operation transforms each state using one of the following:\n\n * arc_sum: sums weights of identically-labeled multi-arcs.\n * arc_unique: deletes non-unique identically-labeled multi-arcs.\n * identity: maps to self.\n\n Args:\n ifst: The input FST.\n map_type: A string matching a known mapping operation; one of: \"arc_sum\",\n \"arc_unique\", \"identity\".\n\n Returns:\n An FST with states remapped.\n\n Raises:\n FstArgError: Unknown map type.\n\n See also: `arcmap`.\n ";
static PyObject *__pyx_pw_9pywrapfst_57statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
PyObject *__pyx_v_map_type = 0;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_map_type)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4065, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4077, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "statemap") < 0)) __PYX_ERR(0, 4065, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "statemap") < 0)) __PYX_ERR(0, 4077, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4065, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4077, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.statemap", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4065, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4077, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_56statemap(__pyx_self, __pyx_v_ifst, __pyx_v_map_type);
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("statemap", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_statemap(__pyx_v_ifst, __pyx_v_map_type, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4065, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_statemap(__pyx_v_ifst, __pyx_v_map_type, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4077, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4091
+/* "pywrapfst.pyx":4105
*
*
* cpdef _MutableFst synchronize(_Fst ifst): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("synchronize", 0);
- /* "pywrapfst.pyx":4111
+ /* "pywrapfst.pyx":4125
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 4111, __pyx_L1_error)
+ __PYX_ERR(0, 4125, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":4112
+ /* "pywrapfst.pyx":4126
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.Synchronize(deref(ifst._fst), tfst.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4112, __pyx_L1_error)
+ __PYX_ERR(0, 4126, __pyx_L1_error)
}
fst::script::Synchronize((*__pyx_v_ifst->_fst), __pyx_v_tfst.get());
- /* "pywrapfst.pyx":4113
+ /* "pywrapfst.pyx":4127
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.Synchronize(deref(ifst._fst), tfst.get())
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4113, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4091
+ /* "pywrapfst.pyx":4105
*
*
* cpdef _MutableFst synchronize(_Fst ifst): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("synchronize (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4091, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4105, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_58synchronize(__pyx_self, ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_ifst));
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("synchronize", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_synchronize(__pyx_v_ifst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4091, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_synchronize(__pyx_v_ifst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4170
+/* "pywrapfst.pyx":4184
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fst_type,&__pyx_n_s_arc_type,&__pyx_n_s_isymbols,&__pyx_n_s_osymbols,&__pyx_n_s_ssymbols,&__pyx_n_s_acceptor,&__pyx_n_s_keep_isymbols,&__pyx_n_s_keep_osymbols,&__pyx_n_s_keep_state_numbering,&__pyx_n_s_allow_negative_labels,0};
PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
- /* "pywrapfst.pyx":4173
+ /* "pywrapfst.pyx":4187
* string fst_type=b"vector",
* string arc_type=b"standard",
* SymbolTable isymbols=None, # <<<<<<<<<<<<<<
*/
values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
- /* "pywrapfst.pyx":4174
+ /* "pywrapfst.pyx":4188
* string arc_type=b"standard",
* SymbolTable isymbols=None,
* SymbolTable osymbols=None, # <<<<<<<<<<<<<<
*/
values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
- /* "pywrapfst.pyx":4175
+ /* "pywrapfst.pyx":4189
* SymbolTable isymbols=None,
* SymbolTable osymbols=None,
* SymbolTable ssymbols=None, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 4170, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 4184, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
}
if (values[0]) {
- __pyx_v_fst_type = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4171, __pyx_L3_error)
+ __pyx_v_fst_type = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4185, __pyx_L3_error)
} else {
__pyx_v_fst_type = __pyx_k__52;
}
if (values[1]) {
- __pyx_v_arc_type = __pyx_convert_string_from_py_std__in_string(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4172, __pyx_L3_error)
+ __pyx_v_arc_type = __pyx_convert_string_from_py_std__in_string(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4186, __pyx_L3_error)
} else {
__pyx_v_arc_type = __pyx_k__53;
}
__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)values[3]);
__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)values[4]);
if (values[5]) {
- __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4176, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4190, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4176
+ /* "pywrapfst.pyx":4190
* SymbolTable osymbols=None,
* SymbolTable ssymbols=None,
* bool acceptor=False, # <<<<<<<<<<<<<<
__pyx_v_acceptor = ((bool)0);
}
if (values[6]) {
- __pyx_v_keep_isymbols = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_keep_isymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4177, __pyx_L3_error)
+ __pyx_v_keep_isymbols = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_keep_isymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4191, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4177
+ /* "pywrapfst.pyx":4191
* SymbolTable ssymbols=None,
* bool acceptor=False,
* bool keep_isymbols=False, # <<<<<<<<<<<<<<
__pyx_v_keep_isymbols = ((bool)0);
}
if (values[7]) {
- __pyx_v_keep_osymbols = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_keep_osymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4178, __pyx_L3_error)
+ __pyx_v_keep_osymbols = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_keep_osymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4192, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4178
+ /* "pywrapfst.pyx":4192
* bool acceptor=False,
* bool keep_isymbols=False,
* bool keep_osymbols=False, # <<<<<<<<<<<<<<
__pyx_v_keep_osymbols = ((bool)0);
}
if (values[8]) {
- __pyx_v_keep_state_numbering = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_keep_state_numbering == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4179, __pyx_L3_error)
+ __pyx_v_keep_state_numbering = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_keep_state_numbering == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4193, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4179
+ /* "pywrapfst.pyx":4193
* bool keep_isymbols=False,
* bool keep_osymbols=False,
* bool keep_state_numbering=False, # <<<<<<<<<<<<<<
__pyx_v_keep_state_numbering = ((bool)0);
}
if (values[9]) {
- __pyx_v_allow_negative_labels = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_allow_negative_labels == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4180, __pyx_L3_error)
+ __pyx_v_allow_negative_labels = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_allow_negative_labels == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4194, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4180
+ /* "pywrapfst.pyx":4194
* bool keep_osymbols=False,
* bool keep_state_numbering=False,
* bool allow_negative_labels=False): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4170, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4184, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Compiler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 4173, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4174, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4175, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 4187, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4188, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4189, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_8Compiler___cinit__(((struct __pyx_obj_9pywrapfst_Compiler *)__pyx_v_self), __pyx_v_fst_type, __pyx_v_arc_type, __pyx_v_isymbols, __pyx_v_osymbols, __pyx_v_ssymbols, __pyx_v_acceptor, __pyx_v_keep_isymbols, __pyx_v_keep_osymbols, __pyx_v_keep_state_numbering, __pyx_v_allow_negative_labels);
- /* "pywrapfst.pyx":4170
+ /* "pywrapfst.pyx":4184
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
fst::SymbolTable *__pyx_t_5;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "pywrapfst.pyx":4181
+ /* "pywrapfst.pyx":4195
* bool keep_state_numbering=False,
* bool allow_negative_labels=False):
* self._sstrm.reset(new stringstream()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
- __PYX_ERR(0, 4181, __pyx_L1_error)
+ __PYX_ERR(0, 4195, __pyx_L1_error)
}
__pyx_v_self->_sstrm.reset(new std::stringstream());
- /* "pywrapfst.pyx":4182
+ /* "pywrapfst.pyx":4196
* bool allow_negative_labels=False):
* self._sstrm.reset(new stringstream())
* self._fst_type = tostring(fst_type) # <<<<<<<<<<<<<<
* self._arc_type = tostring(arc_type)
* self._isymbols = NULL
*/
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4182, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4182, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4196, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst_type");
- __PYX_ERR(0, 4182, __pyx_L1_error)
+ __PYX_ERR(0, 4196, __pyx_L1_error)
}
__pyx_v_self->_fst_type = __pyx_t_2;
- /* "pywrapfst.pyx":4183
+ /* "pywrapfst.pyx":4197
* self._sstrm.reset(new stringstream())
* self._fst_type = tostring(fst_type)
* self._arc_type = tostring(arc_type) # <<<<<<<<<<<<<<
* self._isymbols = NULL
* if isymbols is not None:
*/
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4183, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4183, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4197, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc_type");
- __PYX_ERR(0, 4183, __pyx_L1_error)
+ __PYX_ERR(0, 4197, __pyx_L1_error)
}
__pyx_v_self->_arc_type = __pyx_t_2;
- /* "pywrapfst.pyx":4184
+ /* "pywrapfst.pyx":4198
* self._fst_type = tostring(fst_type)
* self._arc_type = tostring(arc_type)
* self._isymbols = NULL # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
- __PYX_ERR(0, 4184, __pyx_L1_error)
+ __PYX_ERR(0, 4198, __pyx_L1_error)
}
__pyx_v_self->_isymbols = NULL;
- /* "pywrapfst.pyx":4185
+ /* "pywrapfst.pyx":4199
* self._arc_type = tostring(arc_type)
* self._isymbols = NULL
* if isymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
- /* "pywrapfst.pyx":4186
+ /* "pywrapfst.pyx":4200
* self._isymbols = NULL
* if isymbols is not None:
* self._isymbols = isymbols._table # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 4186, __pyx_L1_error)
+ __PYX_ERR(0, 4200, __pyx_L1_error)
}
__pyx_t_5 = __pyx_v_isymbols->__pyx_base.__pyx_base._table;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
- __PYX_ERR(0, 4186, __pyx_L1_error)
+ __PYX_ERR(0, 4200, __pyx_L1_error)
}
__pyx_v_self->_isymbols = __pyx_t_5;
- /* "pywrapfst.pyx":4185
+ /* "pywrapfst.pyx":4199
* self._arc_type = tostring(arc_type)
* self._isymbols = NULL
* if isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4187
+ /* "pywrapfst.pyx":4201
* if isymbols is not None:
* self._isymbols = isymbols._table
* self._osymbols = NULL # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
- __PYX_ERR(0, 4187, __pyx_L1_error)
+ __PYX_ERR(0, 4201, __pyx_L1_error)
}
__pyx_v_self->_osymbols = NULL;
- /* "pywrapfst.pyx":4188
+ /* "pywrapfst.pyx":4202
* self._isymbols = isymbols._table
* self._osymbols = NULL
* if osymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":4189
+ /* "pywrapfst.pyx":4203
* self._osymbols = NULL
* if osymbols is not None:
* self._osymbols = osymbols._table # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 4189, __pyx_L1_error)
+ __PYX_ERR(0, 4203, __pyx_L1_error)
}
__pyx_t_5 = __pyx_v_osymbols->__pyx_base.__pyx_base._table;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
- __PYX_ERR(0, 4189, __pyx_L1_error)
+ __PYX_ERR(0, 4203, __pyx_L1_error)
}
__pyx_v_self->_osymbols = __pyx_t_5;
- /* "pywrapfst.pyx":4188
+ /* "pywrapfst.pyx":4202
* self._isymbols = isymbols._table
* self._osymbols = NULL
* if osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4190
+ /* "pywrapfst.pyx":4204
* if osymbols is not None:
* self._osymbols = osymbols._table
* self._ssymbols = NULL # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
- __PYX_ERR(0, 4190, __pyx_L1_error)
+ __PYX_ERR(0, 4204, __pyx_L1_error)
}
__pyx_v_self->_ssymbols = NULL;
- /* "pywrapfst.pyx":4191
+ /* "pywrapfst.pyx":4205
* self._osymbols = osymbols._table
* self._ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
- /* "pywrapfst.pyx":4192
+ /* "pywrapfst.pyx":4206
* self._ssymbols = NULL
* if ssymbols is not None:
* self._ssymbols = ssymbols._table # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 4192, __pyx_L1_error)
+ __PYX_ERR(0, 4206, __pyx_L1_error)
}
__pyx_t_5 = __pyx_v_ssymbols->__pyx_base.__pyx_base._table;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
- __PYX_ERR(0, 4192, __pyx_L1_error)
+ __PYX_ERR(0, 4206, __pyx_L1_error)
}
__pyx_v_self->_ssymbols = __pyx_t_5;
- /* "pywrapfst.pyx":4191
+ /* "pywrapfst.pyx":4205
* self._osymbols = osymbols._table
* self._ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4193
+ /* "pywrapfst.pyx":4207
* if ssymbols is not None:
* self._ssymbols = ssymbols._table
* self._acceptor = acceptor # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_acceptor");
- __PYX_ERR(0, 4193, __pyx_L1_error)
+ __PYX_ERR(0, 4207, __pyx_L1_error)
}
__pyx_v_self->_acceptor = __pyx_v_acceptor;
- /* "pywrapfst.pyx":4194
+ /* "pywrapfst.pyx":4208
* self._ssymbols = ssymbols._table
* self._acceptor = acceptor
* self._keep_isymbols = keep_isymbols # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_isymbols");
- __PYX_ERR(0, 4194, __pyx_L1_error)
+ __PYX_ERR(0, 4208, __pyx_L1_error)
}
__pyx_v_self->_keep_isymbols = __pyx_v_keep_isymbols;
- /* "pywrapfst.pyx":4195
+ /* "pywrapfst.pyx":4209
* self._acceptor = acceptor
* self._keep_isymbols = keep_isymbols
* self._keep_osymbols = keep_osymbols # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_osymbols");
- __PYX_ERR(0, 4195, __pyx_L1_error)
+ __PYX_ERR(0, 4209, __pyx_L1_error)
}
__pyx_v_self->_keep_osymbols = __pyx_v_keep_osymbols;
- /* "pywrapfst.pyx":4196
+ /* "pywrapfst.pyx":4210
* self._keep_isymbols = keep_isymbols
* self._keep_osymbols = keep_osymbols
* self._keep_state_numbering = keep_state_numbering # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_state_numbering");
- __PYX_ERR(0, 4196, __pyx_L1_error)
+ __PYX_ERR(0, 4210, __pyx_L1_error)
}
__pyx_v_self->_keep_state_numbering = __pyx_v_keep_state_numbering;
- /* "pywrapfst.pyx":4197
+ /* "pywrapfst.pyx":4211
* self._keep_osymbols = keep_osymbols
* self._keep_state_numbering = keep_state_numbering
* self._allow_negative_labels = allow_negative_labels # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_allow_negative_labels");
- __PYX_ERR(0, 4197, __pyx_L1_error)
+ __PYX_ERR(0, 4211, __pyx_L1_error)
}
__pyx_v_self->_allow_negative_labels = __pyx_v_allow_negative_labels;
- /* "pywrapfst.pyx":4170
+ /* "pywrapfst.pyx":4184
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4199
+/* "pywrapfst.pyx":4213
* self._allow_negative_labels = allow_negative_labels
*
* cpdef _Fst compile(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4199, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_8Compiler_3compile)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4199, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 4199, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 4213, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4214
+ /* "pywrapfst.pyx":4228
* """
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.CompileFstInternal(deref(self._sstrm), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
- __PYX_ERR(0, 4214, __pyx_L1_error)
+ __PYX_ERR(0, 4228, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4215
+ /* "pywrapfst.pyx":4229
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.CompileFstInternal(deref(self._sstrm),
* b"<pywrapfst>", self._fst_type, self._arc_type, self._isymbols, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst_type");
- __PYX_ERR(0, 4215, __pyx_L1_error)
+ __PYX_ERR(0, 4229, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc_type");
- __PYX_ERR(0, 4215, __pyx_L1_error)
+ __PYX_ERR(0, 4229, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
- __PYX_ERR(0, 4215, __pyx_L1_error)
+ __PYX_ERR(0, 4229, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4216
+ /* "pywrapfst.pyx":4230
* tfst.reset(fst.CompileFstInternal(deref(self._sstrm),
* b"<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
* self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
- __PYX_ERR(0, 4216, __pyx_L1_error)
+ __PYX_ERR(0, 4230, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
- __PYX_ERR(0, 4216, __pyx_L1_error)
+ __PYX_ERR(0, 4230, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_acceptor");
- __PYX_ERR(0, 4216, __pyx_L1_error)
+ __PYX_ERR(0, 4230, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_isymbols");
- __PYX_ERR(0, 4216, __pyx_L1_error)
+ __PYX_ERR(0, 4230, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4217
+ /* "pywrapfst.pyx":4231
* b"<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
* self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,
* self._keep_osymbols, self._keep_state_numbering, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_osymbols");
- __PYX_ERR(0, 4217, __pyx_L1_error)
+ __PYX_ERR(0, 4231, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_state_numbering");
- __PYX_ERR(0, 4217, __pyx_L1_error)
+ __PYX_ERR(0, 4231, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4218
+ /* "pywrapfst.pyx":4232
* self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,
* self._keep_osymbols, self._keep_state_numbering,
* self._allow_negative_labels)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_allow_negative_labels");
- __PYX_ERR(0, 4218, __pyx_L1_error)
+ __PYX_ERR(0, 4232, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4214
+ /* "pywrapfst.pyx":4228
* """
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.CompileFstInternal(deref(self._sstrm), # <<<<<<<<<<<<<<
*/
__pyx_v_tfst.reset(fst::script::CompileFstInternal((*__pyx_v_self->_sstrm), __pyx_k_pywrapfst, __pyx_v_self->_fst_type, __pyx_v_self->_arc_type, __pyx_v_self->_isymbols, __pyx_v_self->_osymbols, __pyx_v_self->_ssymbols, __pyx_v_self->_acceptor, __pyx_v_self->_keep_isymbols, __pyx_v_self->_keep_osymbols, __pyx_v_self->_keep_state_numbering, __pyx_v_self->_allow_negative_labels));
- /* "pywrapfst.pyx":4219
+ /* "pywrapfst.pyx":4233
* self._keep_osymbols, self._keep_state_numbering,
* self._allow_negative_labels))
* self._sstrm.reset(new stringstream()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
- __PYX_ERR(0, 4219, __pyx_L1_error)
+ __PYX_ERR(0, 4233, __pyx_L1_error)
}
__pyx_v_self->_sstrm.reset(new std::stringstream());
- /* "pywrapfst.pyx":4220
+ /* "pywrapfst.pyx":4234
* self._allow_negative_labels))
* self._sstrm.reset(new stringstream())
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_5 = ((__pyx_v_tfst.get() == NULL) != 0);
if (unlikely(__pyx_t_5)) {
- /* "pywrapfst.pyx":4221
+ /* "pywrapfst.pyx":4235
* self._sstrm.reset(new stringstream())
* if tfst.get() == NULL:
* raise FstOpError("Compilation failed") # <<<<<<<<<<<<<<
* return _init_XFst(tfst.release())
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4221, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Compilation_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Compilation_failed);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4221, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 4221, __pyx_L1_error)
+ __PYX_ERR(0, 4235, __pyx_L1_error)
- /* "pywrapfst.pyx":4220
+ /* "pywrapfst.pyx":4234
* self._allow_negative_labels))
* self._sstrm.reset(new stringstream())
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4222
+ /* "pywrapfst.pyx":4236
* if tfst.get() == NULL:
* raise FstOpError("Compilation failed")
* return _init_XFst(tfst.release()) # <<<<<<<<<<<<<<
* cpdef void write(self, expression):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4222, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4199
+ /* "pywrapfst.pyx":4213
* self._allow_negative_labels = allow_negative_labels
*
* cpdef _Fst compile(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("compile", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_8Compiler_compile(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4199, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_8Compiler_compile(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4224
+/* "pywrapfst.pyx":4238
* return _init_XFst(tfst.release())
*
* cpdef void write(self, expression): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4224, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_8Compiler_5write)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_expression) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_expression);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4224, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":4240
+ /* "pywrapfst.pyx":4254
* expression: A string expression to add to compiler string buffer.
* """
* cdef string line = tostring(expression) # <<<<<<<<<<<<<<
* if not line.empty() and line.back() != b'\n':
* line.append(b'\n')
*/
- __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4240, __pyx_L1_error)
+ __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4254, __pyx_L1_error)
__pyx_v_line = __pyx_t_5;
- /* "pywrapfst.pyx":4241
+ /* "pywrapfst.pyx":4255
* """
* cdef string line = tostring(expression)
* if not line.empty() and line.back() != b'\n': # <<<<<<<<<<<<<<
__pyx_L4_bool_binop_done:;
if (__pyx_t_6) {
- /* "pywrapfst.pyx":4242
+ /* "pywrapfst.pyx":4256
* cdef string line = tostring(expression)
* if not line.empty() and line.back() != b'\n':
* line.append(b'\n') # <<<<<<<<<<<<<<
*/
(void)(__pyx_v_line.append(((char const *)"\n")));
- /* "pywrapfst.pyx":4241
+ /* "pywrapfst.pyx":4255
* """
* cdef string line = tostring(expression)
* if not line.empty() and line.back() != b'\n': # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4243
+ /* "pywrapfst.pyx":4257
* if not line.empty() and line.back() != b'\n':
* line.append(b'\n')
* deref(self._sstrm) << line # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
- __PYX_ERR(0, 4243, __pyx_L1_error)
+ __PYX_ERR(0, 4257, __pyx_L1_error)
}
(void)(((*__pyx_v_self->_sstrm) << __pyx_v_line));
- /* "pywrapfst.pyx":4224
+ /* "pywrapfst.pyx":4238
* return _init_XFst(tfst.release())
*
* cpdef void write(self, expression): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("write", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_8Compiler_write(__pyx_v_self, __pyx_v_expression, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4224, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_8Compiler_write(__pyx_v_self, __pyx_v_expression, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4265
+/* "pywrapfst.pyx":4279
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":4266
+ /* "pywrapfst.pyx":4280
*
* def __init__(self):
* raise FstDeletedConstructorError( # <<<<<<<<<<<<<<
* "Cannot construct {}".format(self.__class__.__name__))
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4266, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4267
+ /* "pywrapfst.pyx":4281
* def __init__(self):
* raise FstDeletedConstructorError(
* "Cannot construct {}".format(self.__class__.__name__)) # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4267, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4267, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4267, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4267, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4266, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 4266, __pyx_L1_error)
+ __PYX_ERR(0, 4280, __pyx_L1_error)
- /* "pywrapfst.pyx":4265
+ /* "pywrapfst.pyx":4279
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4269
+/* "pywrapfst.pyx":4283
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":4270
+ /* "pywrapfst.pyx":4284
*
* def __repr__(self):
* return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self)) # <<<<<<<<<<<<<<
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_FarReader_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4270, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_FarReader_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "far_type");
- __PYX_ERR(0, 4270, __pyx_L1_error)
+ __PYX_ERR(0, 4284, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4270, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4270, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
__pyx_t_6 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4270, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4284, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4270, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4284, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4270, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4270, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4269
+ /* "pywrapfst.pyx":4283
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4273
+/* "pywrapfst.pyx":4287
*
* @classmethod
* def open(cls, *filenames): # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("open", 0);
- /* "pywrapfst.pyx":4292
+ /* "pywrapfst.pyx":4306
* """
* cdef vector[string] filename_strings
* for filename in filenames: # <<<<<<<<<<<<<<
for (;;) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4292, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4306, __pyx_L1_error)
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4292, __pyx_L1_error)
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
__Pyx_XDECREF_SET(__pyx_v_filename, __pyx_t_3);
__pyx_t_3 = 0;
- /* "pywrapfst.pyx":4293
+ /* "pywrapfst.pyx":4307
* cdef vector[string] filename_strings
* for filename in filenames:
* filename_strings.push_back(tostring(filename)) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.FarReaderClass] tfar
* tfar.reset(fst.FarReaderClass.Open(filename_strings))
*/
- __pyx_t_4 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4293, __pyx_L1_error)
+ __pyx_t_4 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4307, __pyx_L1_error)
try {
__pyx_v_filename_strings.push_back(__pyx_t_4);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 4293, __pyx_L1_error)
+ __PYX_ERR(0, 4307, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4292
+ /* "pywrapfst.pyx":4306
* """
* cdef vector[string] filename_strings
* for filename in filenames: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":4295
+ /* "pywrapfst.pyx":4309
* filename_strings.push_back(tostring(filename))
* cdef unique_ptr[fst.FarReaderClass] tfar
* tfar.reset(fst.FarReaderClass.Open(filename_strings)) # <<<<<<<<<<<<<<
*/
__pyx_v_tfar.reset(fst::script::FarReaderClass::Open(__pyx_v_filename_strings));
- /* "pywrapfst.pyx":4296
+ /* "pywrapfst.pyx":4310
* cdef unique_ptr[fst.FarReaderClass] tfar
* tfar.reset(fst.FarReaderClass.Open(filename_strings))
* if tfar.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_5 = ((__pyx_v_tfar.get() == NULL) != 0);
if (unlikely(__pyx_t_5)) {
- /* "pywrapfst.pyx":4297
+ /* "pywrapfst.pyx":4311
* tfar.reset(fst.FarReaderClass.Open(filename_strings))
* if tfar.get() == NULL:
* raise FstIOError("Read failed: {!r}".format(filenames)) # <<<<<<<<<<<<<<
* cdef FarReader result = FarReader.__new__(FarReader)
* result._reader.reset(tfar.release())
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4297, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4297, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
}
__pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_filenames) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_filenames);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4297, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = NULL;
__pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4297, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 4297, __pyx_L1_error)
+ __PYX_ERR(0, 4311, __pyx_L1_error)
- /* "pywrapfst.pyx":4296
+ /* "pywrapfst.pyx":4310
* cdef unique_ptr[fst.FarReaderClass] tfar
* tfar.reset(fst.FarReaderClass.Open(filename_strings))
* if tfar.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4298
+ /* "pywrapfst.pyx":4312
* if tfar.get() == NULL:
* raise FstIOError("Read failed: {!r}".format(filenames))
* cdef FarReader result = FarReader.__new__(FarReader) # <<<<<<<<<<<<<<
* result._reader.reset(tfar.release())
* return result
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_FarReader(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarReader), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4298, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_FarReader(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarReader), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4312, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":4299
+ /* "pywrapfst.pyx":4313
* raise FstIOError("Read failed: {!r}".format(filenames))
* cdef FarReader result = FarReader.__new__(FarReader)
* result._reader.reset(tfar.release()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4299, __pyx_L1_error)
+ __PYX_ERR(0, 4313, __pyx_L1_error)
}
__pyx_v_result->_reader.reset(__pyx_v_tfar.release());
- /* "pywrapfst.pyx":4300
+ /* "pywrapfst.pyx":4314
* cdef FarReader result = FarReader.__new__(FarReader)
* result._reader.reset(tfar.release())
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":4273
+ /* "pywrapfst.pyx":4287
*
* @classmethod
* def open(cls, *filenames): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4302
+/* "pywrapfst.pyx":4316
* return result
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4302, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_7arc_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4302, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4302, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4316, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4308
+ /* "pywrapfst.pyx":4322
* Returns a string indicating the arc type.
* """
* return self._reader.get().ArcType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4308, __pyx_L1_error)
+ __PYX_ERR(0, 4322, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":4302
+ /* "pywrapfst.pyx":4316
* return result
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("arc_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4302, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4310
+/* "pywrapfst.pyx":4324
* return self._reader.get().ArcType()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4310, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_9done)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4310, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4310, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4324, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4319
+ /* "pywrapfst.pyx":4333
* True if the iterator is exhausted, False otherwise.
* """
* return self._reader.get().Done() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4319, __pyx_L1_error)
+ __PYX_ERR(0, 4333, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":4310
+ /* "pywrapfst.pyx":4324
* return self._reader.get().ArcType()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("done", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarReader_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4310, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarReader_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4321
+/* "pywrapfst.pyx":4335
* return self._reader.get().Done()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4321, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_11error)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4321, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4321, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4335, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4330
+ /* "pywrapfst.pyx":4344
* True if the FarReader is in an errorful state, False otherwise.
* """
* return self._reader.get().Error() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4330, __pyx_L1_error)
+ __PYX_ERR(0, 4344, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->Error();
goto __pyx_L0;
- /* "pywrapfst.pyx":4321
+ /* "pywrapfst.pyx":4335
* return self._reader.get().Done()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("error", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarReader_error(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4321, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarReader_error(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4332
+/* "pywrapfst.pyx":4346
* return self._reader.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4332, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_13far_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4332, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4332, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4346, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4333
+ /* "pywrapfst.pyx":4347
*
* cpdef string far_type(self):
* return fst.GetFarTypeString(self._reader.get().Type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4333, __pyx_L1_error)
+ __PYX_ERR(0, 4347, __pyx_L1_error)
}
__pyx_r = fst::GetFarTypeString(__pyx_v_self->_reader.get()->Type());
goto __pyx_L0;
- /* "pywrapfst.pyx":4332
+ /* "pywrapfst.pyx":4346
* return self._reader.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("far_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4332, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4335
+/* "pywrapfst.pyx":4349
* return fst.GetFarTypeString(self._reader.get().Type())
*
* cpdef bool find(self, key) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4335, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_15find)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4335, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4335, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4349, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4348
+ /* "pywrapfst.pyx":4362
* True if the key was found, False otherwise.
* """
* return self._reader.get().Find(tostring(key)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4348, __pyx_L1_error)
+ __PYX_ERR(0, 4362, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4348, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4362, __pyx_L1_error)
__pyx_r = __pyx_v_self->_reader.get()->Find(__pyx_t_6);
goto __pyx_L0;
- /* "pywrapfst.pyx":4335
+ /* "pywrapfst.pyx":4349
* return fst.GetFarTypeString(self._reader.get().Type())
*
* cpdef bool find(self, key) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("find", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_9FarReader_find(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4335, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4335, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_9FarReader_find(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4349, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4350
+/* "pywrapfst.pyx":4364
* return self._reader.get().Find(tostring(key))
*
* cpdef _Fst get_fst(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4350, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_17get_fst)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4350, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 4350, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 4364, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4359
+ /* "pywrapfst.pyx":4373
* A copy of the FST at the current position.
* """
* return _init_XFst(new fst.FstClass( # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "pywrapfst.pyx":4360
+ /* "pywrapfst.pyx":4374
* """
* return _init_XFst(new fst.FstClass(
* deref(self._reader.get().GetFstClass()))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4360, __pyx_L1_error)
+ __PYX_ERR(0, 4374, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4359
+ /* "pywrapfst.pyx":4373
* A copy of the FST at the current position.
* """
* return _init_XFst(new fst.FstClass( # <<<<<<<<<<<<<<
* deref(self._reader.get().GetFstClass())))
*
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(new fst::script::FstClass((*__pyx_v_self->_reader.get()->GetFstClass())))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4359, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(new fst::script::FstClass((*__pyx_v_self->_reader.get()->GetFstClass())))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4350
+ /* "pywrapfst.pyx":4364
* return self._reader.get().Find(tostring(key))
*
* cpdef _Fst get_fst(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("get_fst", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_9FarReader_get_fst(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4350, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_9FarReader_get_fst(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4362
+/* "pywrapfst.pyx":4376
* deref(self._reader.get().GetFstClass())))
*
* cpdef string get_key(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4362, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4376, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_19get_key)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4362, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4376, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4362, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4376, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4371
+ /* "pywrapfst.pyx":4385
* The string key at the current position.
* """
* return self._reader.get().GetKey() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4371, __pyx_L1_error)
+ __PYX_ERR(0, 4385, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->GetKey();
goto __pyx_L0;
- /* "pywrapfst.pyx":4362
+ /* "pywrapfst.pyx":4376
* deref(self._reader.get().GetFstClass())))
*
* cpdef string get_key(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("get_key", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_get_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4362, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_get_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4376, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4373
+/* "pywrapfst.pyx":4387
* return self._reader.get().GetKey()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4373, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_21next)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4373, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":4379
+ /* "pywrapfst.pyx":4393
* Advances the iterator.
* """
* self._reader.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4379, __pyx_L1_error)
+ __PYX_ERR(0, 4393, __pyx_L1_error)
}
__pyx_v_self->_reader.get()->Next();
- /* "pywrapfst.pyx":4373
+ /* "pywrapfst.pyx":4387
* return self._reader.get().GetKey()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("next", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_9FarReader_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4373, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_9FarReader_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4381
+/* "pywrapfst.pyx":4395
* self._reader.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4381, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4395, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_23reset)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4381, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4395, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":4387
+ /* "pywrapfst.pyx":4401
* Resets the iterator to the initial position.
* """
* self._reader.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4387, __pyx_L1_error)
+ __PYX_ERR(0, 4401, __pyx_L1_error)
}
__pyx_v_self->_reader.get()->Reset();
- /* "pywrapfst.pyx":4381
+ /* "pywrapfst.pyx":4395
* self._reader.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("reset", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_9FarReader_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4381, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_9FarReader_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4395, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4389
+/* "pywrapfst.pyx":4403
* self._reader.get().Reset()
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "pywrapfst.pyx":4390
+ /* "pywrapfst.pyx":4404
*
* def __getitem__(self, key):
* if self._reader.get().Find(tostring(key)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4390, __pyx_L1_error)
+ __PYX_ERR(0, 4404, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4390, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4404, __pyx_L1_error)
__pyx_t_2 = (__pyx_v_self->_reader.get()->Find(__pyx_t_1) != 0);
if (likely(__pyx_t_2)) {
- /* "pywrapfst.pyx":4391
+ /* "pywrapfst.pyx":4405
* def __getitem__(self, key):
* if self._reader.get().Find(tostring(key)):
* return self.get_fst() # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get_fst");
- __PYX_ERR(0, 4391, __pyx_L1_error)
+ __PYX_ERR(0, 4405, __pyx_L1_error)
}
- __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_fst(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4391, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_fst(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4390
+ /* "pywrapfst.pyx":4404
*
* def __getitem__(self, key):
* if self._reader.get().Find(tostring(key)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4393
+ /* "pywrapfst.pyx":4407
* return self.get_fst()
* else:
* raise KeyError(key) # <<<<<<<<<<<<<<
*
*/
/*else*/ {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4393, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 4393, __pyx_L1_error)
+ __PYX_ERR(0, 4407, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4389
+ /* "pywrapfst.pyx":4403
* self._reader.get().Reset()
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4416
+/* "pywrapfst.pyx":4430
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":4417
+ /* "pywrapfst.pyx":4431
*
* def __init__(self):
* raise FstDeletedConstructorError( # <<<<<<<<<<<<<<
* "Cannot construct {}".format(self.__class__.__name__))
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4417, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4418
+ /* "pywrapfst.pyx":4432
* def __init__(self):
* raise FstDeletedConstructorError(
* "Cannot construct {}".format(self.__class__.__name__)) # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4418, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4418, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4418, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4418, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4417, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 4417, __pyx_L1_error)
+ __PYX_ERR(0, 4431, __pyx_L1_error)
- /* "pywrapfst.pyx":4416
+ /* "pywrapfst.pyx":4430
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4420
+/* "pywrapfst.pyx":4434
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":4421
+ /* "pywrapfst.pyx":4435
*
* def __repr__(self):
* return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(self)) # <<<<<<<<<<<<<<
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_FarWriter_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_FarWriter_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "far_type");
- __PYX_ERR(0, 4421, __pyx_L1_error)
+ __PYX_ERR(0, 4435, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
__pyx_t_6 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4435, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4435, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4420
+ /* "pywrapfst.pyx":4434
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4424
+/* "pywrapfst.pyx":4438
*
* @classmethod
* def create(cls, filename, arc_type=b"standard", far_type=b"default"): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 4424, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 4438, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4424, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4438, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.FarWriter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("create", 0);
- /* "pywrapfst.pyx":4445
+ /* "pywrapfst.pyx":4459
* FstIOError: Read failed.
* """
* cdef fst.FarType ft = fst.GetFarType(tostring(far_type)) # <<<<<<<<<<<<<<
* cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
* tostring(filename), tostring(arc_type), ft)
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_far_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4445, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_far_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4459, __pyx_L1_error)
__pyx_v_ft = fst::script::GetFarType(__pyx_t_1);
- /* "pywrapfst.pyx":4447
+ /* "pywrapfst.pyx":4461
* cdef fst.FarType ft = fst.GetFarType(tostring(far_type))
* cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
* tostring(filename), tostring(arc_type), ft) # <<<<<<<<<<<<<<
* if tfar == NULL:
* raise FstIOError("Open failed: {!r}".format(filename))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4447, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4447, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4461, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4461, __pyx_L1_error)
- /* "pywrapfst.pyx":4446
+ /* "pywrapfst.pyx":4460
* """
* cdef fst.FarType ft = fst.GetFarType(tostring(far_type))
* cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create( # <<<<<<<<<<<<<<
*/
__pyx_v_tfar = fst::script::FarWriterClass::Create(__pyx_t_1, __pyx_t_2, __pyx_v_ft);
- /* "pywrapfst.pyx":4448
+ /* "pywrapfst.pyx":4462
* cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
* tostring(filename), tostring(arc_type), ft)
* if tfar == NULL: # <<<<<<<<<<<<<<
__pyx_t_3 = ((__pyx_v_tfar == NULL) != 0);
if (unlikely(__pyx_t_3)) {
- /* "pywrapfst.pyx":4449
+ /* "pywrapfst.pyx":4463
* tostring(filename), tostring(arc_type), ft)
* if tfar == NULL:
* raise FstIOError("Open failed: {!r}".format(filename)) # <<<<<<<<<<<<<<
* cdef FarWriter result = FarWriter.__new__(FarWriter)
* result._writer.reset(tfar)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4449, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4463, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Open_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4449, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Open_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4463, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
}
__pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_filename) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_filename);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4449, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4463, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = NULL;
__pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4449, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4463, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 4449, __pyx_L1_error)
+ __PYX_ERR(0, 4463, __pyx_L1_error)
- /* "pywrapfst.pyx":4448
+ /* "pywrapfst.pyx":4462
* cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
* tostring(filename), tostring(arc_type), ft)
* if tfar == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4450
+ /* "pywrapfst.pyx":4464
* if tfar == NULL:
* raise FstIOError("Open failed: {!r}".format(filename))
* cdef FarWriter result = FarWriter.__new__(FarWriter) # <<<<<<<<<<<<<<
* result._writer.reset(tfar)
* return result
*/
- __pyx_t_4 = ((PyObject *)__pyx_tp_new_9pywrapfst_FarWriter(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarWriter), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4450, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_tp_new_9pywrapfst_FarWriter(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarWriter), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "pywrapfst.pyx":4451
+ /* "pywrapfst.pyx":4465
* raise FstIOError("Open failed: {!r}".format(filename))
* cdef FarWriter result = FarWriter.__new__(FarWriter)
* result._writer.reset(tfar) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4451, __pyx_L1_error)
+ __PYX_ERR(0, 4465, __pyx_L1_error)
}
__pyx_v_result->_writer.reset(__pyx_v_tfar);
- /* "pywrapfst.pyx":4452
+ /* "pywrapfst.pyx":4466
* cdef FarWriter result = FarWriter.__new__(FarWriter)
* result._writer.reset(tfar)
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":4424
+ /* "pywrapfst.pyx":4438
*
* @classmethod
* def create(cls, filename, arc_type=b"standard", far_type=b"default"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4456
+/* "pywrapfst.pyx":4470
* # NB: Invoking this method may be dangerous: calling any other method on the
* # instance after this is invoked may result in a null dereference.
* cdef void close(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("close", 0);
- /* "pywrapfst.pyx":4457
+ /* "pywrapfst.pyx":4471
* # instance after this is invoked may result in a null dereference.
* cdef void close(self):
* self._writer.reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4457, __pyx_L1_error)
+ __PYX_ERR(0, 4471, __pyx_L1_error)
}
__pyx_v_self->_writer.reset();
- /* "pywrapfst.pyx":4456
+ /* "pywrapfst.pyx":4470
* # NB: Invoking this method may be dangerous: calling any other method on the
* # instance after this is invoked may result in a null dereference.
* cdef void close(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":4459
+/* "pywrapfst.pyx":4473
* self._writer.reset()
*
* cpdef void add(self, key, _Fst ifst) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4459, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarWriter_7add)) {
__Pyx_INCREF(__pyx_t_1);
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, ((PyObject *)__pyx_v_ifst)};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4459, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4473, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, ((PyObject *)__pyx_v_ifst)};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4459, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4473, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4459, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(((PyObject *)__pyx_v_ifst));
__Pyx_GIVEREF(((PyObject *)__pyx_v_ifst));
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_ifst));
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4459, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
#endif
}
- /* "pywrapfst.pyx":4478
+ /* "pywrapfst.pyx":4492
* # Failure here results from passing an FST with a different arc type than
* # used by the FAR was initialized to use.
* if not self._writer.get().Add(tostring(key), deref(ifst._fst)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4478, __pyx_L1_error)
+ __PYX_ERR(0, 4492, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4478, __pyx_L1_error)
+ __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4492, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4478, __pyx_L1_error)
+ __PYX_ERR(0, 4492, __pyx_L1_error)
}
__pyx_t_8 = ((!(__pyx_v_self->_writer.get()->Add(__pyx_t_7, (*__pyx_v_ifst->_fst)) != 0)) != 0);
if (unlikely(__pyx_t_8)) {
- /* "pywrapfst.pyx":4479
+ /* "pywrapfst.pyx":4493
* # used by the FAR was initialized to use.
* if not self._writer.get().Add(tostring(key), deref(ifst._fst)):
* raise FstOpError("Incompatible or invalid arc type") # <<<<<<<<<<<<<<
* # An error here usually indicates a key out of order.
* if self._writer.get().Error():
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4479, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Incompatible_or_invalid_arc_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Incompatible_or_invalid_arc_type);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4479, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 4479, __pyx_L1_error)
+ __PYX_ERR(0, 4493, __pyx_L1_error)
- /* "pywrapfst.pyx":4478
+ /* "pywrapfst.pyx":4492
* # Failure here results from passing an FST with a different arc type than
* # used by the FAR was initialized to use.
* if not self._writer.get().Add(tostring(key), deref(ifst._fst)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4481
+ /* "pywrapfst.pyx":4495
* raise FstOpError("Incompatible or invalid arc type")
* # An error here usually indicates a key out of order.
* if self._writer.get().Error(): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4481, __pyx_L1_error)
+ __PYX_ERR(0, 4495, __pyx_L1_error)
}
__pyx_t_8 = (__pyx_v_self->_writer.get()->Error() != 0);
if (unlikely(__pyx_t_8)) {
- /* "pywrapfst.pyx":4482
+ /* "pywrapfst.pyx":4496
* # An error here usually indicates a key out of order.
* if self._writer.get().Error():
* raise FstArgError("Key out of order") # <<<<<<<<<<<<<<
*
* cpdef string arc_type(self):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4482, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4496, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Key_out_of_order) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Key_out_of_order);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4482, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4496, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 4482, __pyx_L1_error)
+ __PYX_ERR(0, 4496, __pyx_L1_error)
- /* "pywrapfst.pyx":4481
+ /* "pywrapfst.pyx":4495
* raise FstOpError("Incompatible or invalid arc type")
* # An error here usually indicates a key out of order.
* if self._writer.get().Error(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4459
+ /* "pywrapfst.pyx":4473
* self._writer.reset()
*
* cpdef void add(self, key, _Fst ifst) except *: # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 4459, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 4473, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 4459, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 4473, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4459, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4473, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.FarWriter.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4459, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4473, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_9FarWriter_6add(((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_v_self), __pyx_v_key, __pyx_v_ifst);
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("add", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_9FarWriter_add(__pyx_v_self, __pyx_v_key, __pyx_v_ifst, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4459, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4459, __pyx_L1_error)
+ __pyx_f_9pywrapfst_9FarWriter_add(__pyx_v_self, __pyx_v_key, __pyx_v_ifst, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4473, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4484
+/* "pywrapfst.pyx":4498
* raise FstArgError("Key out of order")
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4484, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarWriter_9arc_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4484, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4484, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4498, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4490
+ /* "pywrapfst.pyx":4504
* Returns a string indicating the arc type.
* """
* return self._writer.get().ArcType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4490, __pyx_L1_error)
+ __PYX_ERR(0, 4504, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_writer.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":4484
+ /* "pywrapfst.pyx":4498
* raise FstArgError("Key out of order")
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("arc_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4484, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4492
+/* "pywrapfst.pyx":4506
* return self._writer.get().ArcType()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4492, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4506, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarWriter_11error)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4492, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4506, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4492, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4506, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4501
+ /* "pywrapfst.pyx":4515
* True if the FarWriter is in an errorful state, False otherwise.
* """
* return self._writer.get().Error() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4501, __pyx_L1_error)
+ __PYX_ERR(0, 4515, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_writer.get()->Error();
goto __pyx_L0;
- /* "pywrapfst.pyx":4492
+ /* "pywrapfst.pyx":4506
* return self._writer.get().ArcType()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("error", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarWriter_error(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4492, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarWriter_error(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4506, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4503
+/* "pywrapfst.pyx":4517
* return self._writer.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4503, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarWriter_13far_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4503, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4503, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4517, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4509
+ /* "pywrapfst.pyx":4523
* Returns a string indicating the FAR type.
* """
* return fst.GetFarTypeString(self._writer.get().Type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4509, __pyx_L1_error)
+ __PYX_ERR(0, 4523, __pyx_L1_error)
}
__pyx_r = fst::GetFarTypeString(__pyx_v_self->_writer.get()->Type());
goto __pyx_L0;
- /* "pywrapfst.pyx":4503
+ /* "pywrapfst.pyx":4517
* return self._writer.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("far_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4503, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4512
+/* "pywrapfst.pyx":4526
*
* # Dictionary-like assignment.
* def __setitem__(self, key, _Fst fst): # <<<<<<<<<<<<<<
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst), __pyx_ptype_9pywrapfst__Fst, 1, "fst", 0))) __PYX_ERR(0, 4512, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst), __pyx_ptype_9pywrapfst__Fst, 1, "fst", 0))) __PYX_ERR(0, 4526, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_9FarWriter_14__setitem__(((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_fst));
/* function exit code */
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "pywrapfst.pyx":4513
+ /* "pywrapfst.pyx":4527
* # Dictionary-like assignment.
* def __setitem__(self, key, _Fst fst):
* self.add(key, fst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
- __PYX_ERR(0, 4513, __pyx_L1_error)
+ __PYX_ERR(0, 4527, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->add(__pyx_v_self, __pyx_v_key, __pyx_v_fst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4513, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->add(__pyx_v_self, __pyx_v_key, __pyx_v_fst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4527, __pyx_L1_error)
- /* "pywrapfst.pyx":4512
+ /* "pywrapfst.pyx":4526
*
* # Dictionary-like assignment.
* def __setitem__(self, key, _Fst fst): # <<<<<<<<<<<<<<
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst__SymbolTable __pyx_vtable_9pywrapfst__SymbolTable;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTable __pyx_vtable_9pywrapfst__EncodeMapperSymbolTable;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst__FstSymbolTable __pyx_vtable_9pywrapfst__FstSymbolTable;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable __pyx_vtable_9pywrapfst__MutableSymbolTable;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTable __pyx_vtable_9pywrapfst__MutableFstSymbolTable;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst_SymbolTable __pyx_vtable_9pywrapfst_SymbolTable;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator __pyx_vtable_9pywrapfst_SymbolTableIterator;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst_EncodeMapper __pyx_vtable_9pywrapfst_EncodeMapper;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst__Fst __pyx_vtable_9pywrapfst__Fst;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst__MutableFst __pyx_vtable_9pywrapfst__MutableFst;
static PyMethodDef __pyx_methods_9pywrapfst__MutableFst[] = {
{"add_arc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_1add_arc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_add_arc},
{"add_state", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_3add_state, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_2add_state},
- {"arcsort", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_5arcsort, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_4arcsort},
- {"closure", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_7closure, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_6closure},
- {"concat", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_9concat, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_8concat},
- {"connect", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_11connect, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_10connect},
- {"decode", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_13decode, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_12decode},
- {"delete_arcs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_15delete_arcs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_14delete_arcs},
- {"delete_states", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_17delete_states, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_16delete_states},
- {"encode", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_19encode, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_18encode},
- {"invert", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_21invert, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_20invert},
- {"minimize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_23minimize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_22minimize},
- {"mutable_arcs", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_25mutable_arcs, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_24mutable_arcs},
- {"mutable_input_symbols", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_27mutable_input_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_26mutable_input_symbols},
- {"mutable_output_symbols", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_29mutable_output_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_28mutable_output_symbols},
- {"num_states", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_31num_states, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_30num_states},
- {"project", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_33project, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_32project},
- {"prune", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_35prune, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_34prune},
- {"push", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_37push, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_36push},
- {"relabel_pairs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_39relabel_pairs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_38relabel_pairs},
- {"relabel_tables", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_41relabel_tables, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_40relabel_tables},
- {"reserve_arcs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_43reserve_arcs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_42reserve_arcs},
- {"reserve_states", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_45reserve_states, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_44reserve_states},
- {"reweight", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_47reweight, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_46reweight},
- {"rmepsilon", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_48rmepsilon},
- {"set_final", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_51set_final, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_50set_final},
- {"set_input_symbols", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_53set_input_symbols, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_52set_input_symbols},
- {"set_output_symbols", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_55set_output_symbols, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_54set_output_symbols},
- {"set_properties", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_57set_properties, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_56set_properties},
- {"set_start", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_59set_start, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_58set_start},
- {"topsort", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_61topsort, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_60topsort},
- {"union", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_63union, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_62union},
+ {"add_states", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_5add_states, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_4add_states},
+ {"arcsort", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_7arcsort, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_6arcsort},
+ {"closure", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_9closure, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_8closure},
+ {"concat", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_11concat, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_10concat},
+ {"connect", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_13connect, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_12connect},
+ {"decode", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_15decode, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_14decode},
+ {"delete_arcs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_17delete_arcs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_16delete_arcs},
+ {"delete_states", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_19delete_states, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_18delete_states},
+ {"encode", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_21encode, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_20encode},
+ {"invert", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_23invert, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_22invert},
+ {"minimize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_25minimize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_24minimize},
+ {"mutable_arcs", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_27mutable_arcs, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_26mutable_arcs},
+ {"mutable_input_symbols", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_29mutable_input_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_28mutable_input_symbols},
+ {"mutable_output_symbols", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_31mutable_output_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_30mutable_output_symbols},
+ {"num_states", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_33num_states, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_32num_states},
+ {"project", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_35project, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_34project},
+ {"prune", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_37prune, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_36prune},
+ {"push", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_39push, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_38push},
+ {"relabel_pairs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_41relabel_pairs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_40relabel_pairs},
+ {"relabel_tables", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_43relabel_tables, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_42relabel_tables},
+ {"reserve_arcs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_45reserve_arcs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_44reserve_arcs},
+ {"reserve_states", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_47reserve_states, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_46reserve_states},
+ {"reweight", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_49reweight, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_48reweight},
+ {"rmepsilon", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_51rmepsilon, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_50rmepsilon},
+ {"set_final", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_53set_final, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_52set_final},
+ {"set_input_symbols", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_55set_input_symbols, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_54set_input_symbols},
+ {"set_output_symbols", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_57set_output_symbols, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_56set_output_symbols},
+ {"set_properties", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_11_MutableFst_59set_properties, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_58set_properties},
+ {"set_start", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_61set_start, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_60set_start},
+ {"topsort", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_63topsort, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_62topsort},
+ {"union", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_65union, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_64union},
{0, 0, 0, 0}
};
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst_Arc __pyx_vtable_9pywrapfst_Arc;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst_ArcIterator __pyx_vtable_9pywrapfst_ArcIterator;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator __pyx_vtable_9pywrapfst_MutableArcIterator;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst_StateIterator __pyx_vtable_9pywrapfst_StateIterator;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst_Compiler __pyx_vtable_9pywrapfst_Compiler;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst_FarReader __pyx_vtable_9pywrapfst_FarReader;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_vtabstruct_9pywrapfst_FarWriter __pyx_vtable_9pywrapfst_FarWriter;
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static struct __pyx_obj_9pywrapfst___pyx_scope_struct____iter__ *__pyx_freelist_9pywrapfst___pyx_scope_struct____iter__[8];
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
+ #if PY_VERSION_HEX >= 0x030800b1
+ 0, /*tp_vectorcall*/
+ #endif
};
static PyMethodDef __pyx_methods[] = {
{&__pyx_n_s_acceptor, __pyx_k_acceptor, sizeof(__pyx_k_acceptor), 0, 0, 1, 1},
{&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
{&__pyx_n_s_add_state, __pyx_k_add_state, sizeof(__pyx_k_add_state), 0, 0, 1, 1},
+ {&__pyx_n_s_add_states, __pyx_k_add_states, sizeof(__pyx_k_add_states), 0, 0, 1, 1},
{&__pyx_n_s_add_symbol, __pyx_k_add_symbol, sizeof(__pyx_k_add_symbol), 0, 0, 1, 1},
{&__pyx_n_s_add_table, __pyx_k_add_table, sizeof(__pyx_k_add_table), 0, 0, 1, 1},
{&__pyx_n_s_allow_negative_labels, __pyx_k_allow_negative_labels, sizeof(__pyx_k_allow_negative_labels), 0, 0, 1, 1},
__pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 122, __pyx_L1_error)
__pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 127, __pyx_L1_error)
__pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 132, __pyx_L1_error)
- __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 2766, __pyx_L1_error)
- __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 2786, __pyx_L1_error)
+ __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 2778, __pyx_L1_error)
+ __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 2798, __pyx_L1_error)
__pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 356, __pyx_L1_error)
__pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
__pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 1170, __pyx_L1_error)
- __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 4393, __pyx_L1_error)
+ __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 4407, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
__Pyx_GIVEREF(__pyx_tuple__66);
__pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_power, 542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 542, __pyx_L1_error)
- /* "pywrapfst.pyx":2766
+ /* "pywrapfst.pyx":2778
*
*
* class Fst(object): # <<<<<<<<<<<<<<
*
* """
*/
- __pyx_tuple__68 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 2766, __pyx_L1_error)
+ __pyx_tuple__68 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 2778, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__68);
__Pyx_GIVEREF(__pyx_tuple__68);
- /* "pywrapfst.pyx":2783
+ /* "pywrapfst.pyx":2795
* """
*
* def __new__(cls, arc_type=b"standard"): # <<<<<<<<<<<<<<
* return _create_Fst(arc_type)
*
*/
- __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_arc_type); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 2783, __pyx_L1_error)
+ __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_arc_type); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 2795, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__69);
__Pyx_GIVEREF(__pyx_tuple__69);
- __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_new, 2783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 2783, __pyx_L1_error)
- __pyx_tuple__71 = PyTuple_Pack(1, ((PyObject*)__pyx_n_b_standard)); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 2783, __pyx_L1_error)
+ __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_new, 2795, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 2795, __pyx_L1_error)
+ __pyx_tuple__71 = PyTuple_Pack(1, ((PyObject*)__pyx_n_b_standard)); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 2795, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__71);
__Pyx_GIVEREF(__pyx_tuple__71);
- /* "pywrapfst.pyx":2787
+ /* "pywrapfst.pyx":2799
*
* @staticmethod
* def read(filename): # <<<<<<<<<<<<<<
* """
* read(filename):
*/
- __pyx_tuple__72 = PyTuple_Pack(1, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 2787, __pyx_L1_error)
+ __pyx_tuple__72 = PyTuple_Pack(1, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 2799, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__72);
__Pyx_GIVEREF(__pyx_tuple__72);
- __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_read, 2787, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 2787, __pyx_L1_error)
+ __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_read, 2799, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 2799, __pyx_L1_error)
- /* "pywrapfst.pyx":2805
+ /* "pywrapfst.pyx":2817
*
* @staticmethod
* def read_from_string(state): # <<<<<<<<<<<<<<
* """
* read_from_string(string, fst_type=None)
*/
- __pyx_tuple__74 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 2805, __pyx_L1_error)
+ __pyx_tuple__74 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 2817, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__74);
__Pyx_GIVEREF(__pyx_tuple__74);
- __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_read_from_string, 2805, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 2805, __pyx_L1_error)
+ __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_read_from_string, 2817, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 2817, __pyx_L1_error)
- /* "pywrapfst.pyx":3980
+ /* "pywrapfst.pyx":3992
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kShortestDelta,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_tuple__76 = PyTuple_Pack(8, __pyx_n_s_ifst, __pyx_n_s_delta, __pyx_n_s_nstate, __pyx_n_s_queue_type, __pyx_n_s_reverse, __pyx_n_s_distance, __pyx_n_s_weight_type, __pyx_n_s_weight); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 3980, __pyx_L1_error)
+ __pyx_tuple__76 = PyTuple_Pack(8, __pyx_n_s_ifst, __pyx_n_s_delta, __pyx_n_s_nstate, __pyx_n_s_queue_type, __pyx_n_s_reverse, __pyx_n_s_distance, __pyx_n_s_weight_type, __pyx_n_s_weight); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 3992, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__76);
__Pyx_GIVEREF(__pyx_tuple__76);
- __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_shortestdistance, 3980, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 3980, __pyx_L1_error)
+ __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_shortestdistance, 3992, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 3992, __pyx_L1_error)
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
__pyx_vtable_9pywrapfst_Weight.type = (std::string (*)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_6Weight_type;
__pyx_vtable_9pywrapfst_Weight.member = (bool (*)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_6Weight_member;
if (PyType_Ready(&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_Weight.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_Weight.tp_dictoffset && __pyx_type_9pywrapfst_Weight.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_Weight.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
__pyx_vtable_9pywrapfst__SymbolTable.write_text = (void (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_write_text;
__pyx_vtable_9pywrapfst__SymbolTable.write_to_string = (PyObject *(*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_write_to_string;
if (PyType_Ready(&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst__SymbolTable.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst__SymbolTable.tp_dictoffset && __pyx_type_9pywrapfst__SymbolTable.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst__SymbolTable.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
__pyx_vtable_9pywrapfst__EncodeMapperSymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst__SymbolTable;
__pyx_type_9pywrapfst__EncodeMapperSymbolTable.tp_base = __pyx_ptype_9pywrapfst__SymbolTable;
if (PyType_Ready(&__pyx_type_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 852, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst__EncodeMapperSymbolTable.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst__EncodeMapperSymbolTable.tp_dictoffset && __pyx_type_9pywrapfst__EncodeMapperSymbolTable.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst__EncodeMapperSymbolTable.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
__pyx_vtable_9pywrapfst__FstSymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst__SymbolTable;
__pyx_type_9pywrapfst__FstSymbolTable.tp_base = __pyx_ptype_9pywrapfst__SymbolTable;
if (PyType_Ready(&__pyx_type_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 872, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst__FstSymbolTable.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst__FstSymbolTable.tp_dictoffset && __pyx_type_9pywrapfst__FstSymbolTable.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst__FstSymbolTable.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
__pyx_vtable_9pywrapfst__MutableSymbolTable.set_name = (void (*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19_MutableSymbolTable_set_name;
__pyx_type_9pywrapfst__MutableSymbolTable.tp_base = __pyx_ptype_9pywrapfst__SymbolTable;
if (PyType_Ready(&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 891, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst__MutableSymbolTable.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst__MutableSymbolTable.tp_dictoffset && __pyx_type_9pywrapfst__MutableSymbolTable.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst__MutableSymbolTable.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
__pyx_vtable_9pywrapfst__MutableFstSymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
__pyx_type_9pywrapfst__MutableFstSymbolTable.tp_base = __pyx_ptype_9pywrapfst__MutableSymbolTable;
if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 943, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst__MutableFstSymbolTable.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst__MutableFstSymbolTable.tp_dictoffset && __pyx_type_9pywrapfst__MutableFstSymbolTable.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst__MutableFstSymbolTable.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
__pyx_vtable_9pywrapfst_SymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
__pyx_type_9pywrapfst_SymbolTable.tp_base = __pyx_ptype_9pywrapfst__MutableSymbolTable;
if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 954, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_SymbolTable.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_SymbolTable.tp_dictoffset && __pyx_type_9pywrapfst_SymbolTable.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_SymbolTable.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
__pyx_vtable_9pywrapfst_SymbolTableIterator.symbol = (std::string (*)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19SymbolTableIterator_symbol;
__pyx_vtable_9pywrapfst_SymbolTableIterator.value = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19SymbolTableIterator_value;
if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1149, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_SymbolTableIterator.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_SymbolTableIterator.tp_dictoffset && __pyx_type_9pywrapfst_SymbolTableIterator.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_SymbolTableIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
__pyx_vtable_9pywrapfst_EncodeMapper.set_output_symbols = (void (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_set_output_symbols;
__pyx_vtable_9pywrapfst_EncodeMapper.weight_type = (std::string (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_weight_type;
if (PyType_Ready(&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1231, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_EncodeMapper.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_EncodeMapper.tp_dictoffset && __pyx_type_9pywrapfst_EncodeMapper.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_EncodeMapper.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
__pyx_vtable_9pywrapfst__Fst.write = (void (*)(struct __pyx_obj_9pywrapfst__Fst *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_write;
__pyx_vtable_9pywrapfst__Fst.write_to_string = (PyObject *(*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_write_to_string;
if (PyType_Ready(&__pyx_type_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1387, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst__Fst.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst__Fst.tp_dictoffset && __pyx_type_9pywrapfst__Fst.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst__Fst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
__pyx_vtable_9pywrapfst__MutableFst._check_mutating_imethod = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *))__pyx_f_9pywrapfst_11_MutableFst__check_mutating_imethod;
__pyx_vtable_9pywrapfst__MutableFst._add_arc = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64, struct __pyx_obj_9pywrapfst_Arc *))__pyx_f_9pywrapfst_11_MutableFst__add_arc;
__pyx_vtable_9pywrapfst__MutableFst.add_state = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst__MutableFst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11_MutableFst_add_state;
+ __pyx_vtable_9pywrapfst__MutableFst.add_states = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, size_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11_MutableFst_add_states;
__pyx_vtable_9pywrapfst__MutableFst._arcsort = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__arcsort;
__pyx_vtable_9pywrapfst__MutableFst._closure = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__closure;
__pyx_vtable_9pywrapfst__MutableFst._concat = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst__Fst *))__pyx_f_9pywrapfst_11_MutableFst__concat;
__pyx_vtable_9pywrapfst__MutableFst._union = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst__Fst *))__pyx_f_9pywrapfst_11_MutableFst__union;
__pyx_type_9pywrapfst__MutableFst.tp_base = __pyx_ptype_9pywrapfst__Fst;
if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1802, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst__MutableFst.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst__MutableFst.tp_dictoffset && __pyx_type_9pywrapfst__MutableFst.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst__MutableFst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
__pyx_ptype_9pywrapfst__MutableFst = &__pyx_type_9pywrapfst__MutableFst;
__pyx_vtabptr_9pywrapfst_Arc = &__pyx_vtable_9pywrapfst_Arc;
__pyx_vtable_9pywrapfst_Arc.copy = (struct __pyx_obj_9pywrapfst_Arc *(*)(struct __pyx_obj_9pywrapfst_Arc *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Arc_copy;
- if (PyType_Ready(&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2920, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2932, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_Arc.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_Arc.tp_dictoffset && __pyx_type_9pywrapfst_Arc.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_Arc.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Arc.tp_dict, __pyx_vtabptr_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2920, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Arc, (PyObject *)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2920, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2920, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Arc.tp_dict, __pyx_vtabptr_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2932, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Arc, (PyObject *)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2932, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2932, __pyx_L1_error)
__pyx_ptype_9pywrapfst_Arc = &__pyx_type_9pywrapfst_Arc;
__pyx_vtabptr_9pywrapfst_ArcIterator = &__pyx_vtable_9pywrapfst_ArcIterator;
__pyx_vtable_9pywrapfst_ArcIterator.done = (bool (*)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_done;
__pyx_vtable_9pywrapfst_ArcIterator.seek = (void (*)(struct __pyx_obj_9pywrapfst_ArcIterator *, size_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_seek;
__pyx_vtable_9pywrapfst_ArcIterator.set_flags = (void (*)(struct __pyx_obj_9pywrapfst_ArcIterator *, __pyx_t_10basictypes_uint32, __pyx_t_10basictypes_uint32, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_set_flags;
__pyx_vtable_9pywrapfst_ArcIterator.value = (PyObject *(*)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_value;
- if (PyType_Ready(&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2987, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2999, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_ArcIterator.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_ArcIterator.tp_dictoffset && __pyx_type_9pywrapfst_ArcIterator.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_ArcIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_ArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2987, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArcIterator, (PyObject *)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2987, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2987, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_ArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2999, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArcIterator, (PyObject *)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2999, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2999, __pyx_L1_error)
__pyx_ptype_9pywrapfst_ArcIterator = &__pyx_type_9pywrapfst_ArcIterator;
__pyx_vtabptr_9pywrapfst_MutableArcIterator = &__pyx_vtable_9pywrapfst_MutableArcIterator;
__pyx_vtable_9pywrapfst_MutableArcIterator.done = (bool (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_done;
__pyx_vtable_9pywrapfst_MutableArcIterator.set_flags = (void (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, __pyx_t_10basictypes_uint32, __pyx_t_10basictypes_uint32, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_set_flags;
__pyx_vtable_9pywrapfst_MutableArcIterator.set_value = (void (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, struct __pyx_obj_9pywrapfst_Arc *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_set_value;
__pyx_vtable_9pywrapfst_MutableArcIterator.value = (PyObject *(*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_value;
- if (PyType_Ready(&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3098, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3110, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_MutableArcIterator.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_MutableArcIterator.tp_dictoffset && __pyx_type_9pywrapfst_MutableArcIterator.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_MutableArcIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_MutableArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3098, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableArcIterator, (PyObject *)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3098, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3098, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_MutableArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3110, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableArcIterator, (PyObject *)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3110, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3110, __pyx_L1_error)
__pyx_ptype_9pywrapfst_MutableArcIterator = &__pyx_type_9pywrapfst_MutableArcIterator;
__pyx_vtabptr_9pywrapfst_StateIterator = &__pyx_vtable_9pywrapfst_StateIterator;
__pyx_vtable_9pywrapfst_StateIterator.done = (bool (*)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_13StateIterator_done;
__pyx_vtable_9pywrapfst_StateIterator.next = (void (*)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_13StateIterator_next;
__pyx_vtable_9pywrapfst_StateIterator.reset = (void (*)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_13StateIterator_reset;
__pyx_vtable_9pywrapfst_StateIterator.value = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_13StateIterator_value;
- if (PyType_Ready(&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3218, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3230, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_StateIterator.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_StateIterator.tp_dictoffset && __pyx_type_9pywrapfst_StateIterator.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_StateIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_StateIterator.tp_dict, __pyx_vtabptr_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3218, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StateIterator, (PyObject *)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3218, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3218, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_StateIterator.tp_dict, __pyx_vtabptr_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3230, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StateIterator, (PyObject *)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3230, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3230, __pyx_L1_error)
__pyx_ptype_9pywrapfst_StateIterator = &__pyx_type_9pywrapfst_StateIterator;
__pyx_vtabptr_9pywrapfst_Compiler = &__pyx_vtable_9pywrapfst_Compiler;
__pyx_vtable_9pywrapfst_Compiler.compile = (struct __pyx_obj_9pywrapfst__Fst *(*)(struct __pyx_obj_9pywrapfst_Compiler *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_8Compiler_compile;
__pyx_vtable_9pywrapfst_Compiler.write = (void (*)(struct __pyx_obj_9pywrapfst_Compiler *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_8Compiler_write;
- if (PyType_Ready(&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4119, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4133, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_Compiler.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_Compiler.tp_dictoffset && __pyx_type_9pywrapfst_Compiler.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_Compiler.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Compiler.tp_dict, __pyx_vtabptr_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4119, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Compiler, (PyObject *)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4119, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4119, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Compiler.tp_dict, __pyx_vtabptr_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4133, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Compiler, (PyObject *)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4133, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4133, __pyx_L1_error)
__pyx_ptype_9pywrapfst_Compiler = &__pyx_type_9pywrapfst_Compiler;
__pyx_vtabptr_9pywrapfst_FarReader = &__pyx_vtable_9pywrapfst_FarReader;
__pyx_vtable_9pywrapfst_FarReader.arc_type = (std::string (*)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_arc_type;
__pyx_vtable_9pywrapfst_FarReader.get_key = (std::string (*)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_get_key;
__pyx_vtable_9pywrapfst_FarReader.next = (void (*)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_next;
__pyx_vtable_9pywrapfst_FarReader.reset = (void (*)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_reset;
- if (PyType_Ready(&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4249, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4263, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_FarReader.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_FarReader.tp_dictoffset && __pyx_type_9pywrapfst_FarReader.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_FarReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarReader.tp_dict, __pyx_vtabptr_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4249, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FarReader, (PyObject *)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4249, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4249, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarReader.tp_dict, __pyx_vtabptr_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4263, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FarReader, (PyObject *)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4263, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4263, __pyx_L1_error)
__pyx_ptype_9pywrapfst_FarReader = &__pyx_type_9pywrapfst_FarReader;
__pyx_vtabptr_9pywrapfst_FarWriter = &__pyx_vtable_9pywrapfst_FarWriter;
__pyx_vtable_9pywrapfst_FarWriter.arc_type = (std::string (*)(struct __pyx_obj_9pywrapfst_FarWriter *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarWriter_arc_type;
__pyx_vtable_9pywrapfst_FarWriter.add = (void (*)(struct __pyx_obj_9pywrapfst_FarWriter *, PyObject *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarWriter_add;
__pyx_vtable_9pywrapfst_FarWriter.error = (bool (*)(struct __pyx_obj_9pywrapfst_FarWriter *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarWriter_error;
__pyx_vtable_9pywrapfst_FarWriter.far_type = (std::string (*)(struct __pyx_obj_9pywrapfst_FarWriter *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarWriter_far_type;
- if (PyType_Ready(&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4396, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4410, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_FarWriter.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_FarWriter.tp_dictoffset && __pyx_type_9pywrapfst_FarWriter.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_FarWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarWriter.tp_dict, __pyx_vtabptr_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4396, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FarWriter, (PyObject *)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4396, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4396, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarWriter.tp_dict, __pyx_vtabptr_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4410, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FarWriter, (PyObject *)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4410, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4410, __pyx_L1_error)
__pyx_ptype_9pywrapfst_FarWriter = &__pyx_type_9pywrapfst_FarWriter;
- if (PyType_Ready(&__pyx_type_9pywrapfst___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 3118, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 3130, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst___pyx_scope_struct____iter__.tp_print = 0;
+ #endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst___pyx_scope_struct____iter__.tp_dictoffset && __pyx_type_9pywrapfst___pyx_scope_struct____iter__.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
}
__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
__pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
- #if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
- #endif
+ __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_cython_runtime);
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#endif
/*--- Builtin init code ---*/
- if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
/*--- Constants init code ---*/
- if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
/*--- Global type/function init code ---*/
(void)__Pyx_modinit_global_init_code();
(void)__Pyx_modinit_variable_export_code();
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":2090
+ /* "pywrapfst.pyx":2102
* return self
*
* cdef void _minimize(self, float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__11 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2096
+ /* "pywrapfst.pyx":2108
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
*/
__pyx_k__12 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2196
+ /* "pywrapfst.pyx":2208
* return self
*
* cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
__pyx_k__13 = fst::kDelta;
__pyx_k__14 = fst::kNoStateId;
- /* "pywrapfst.pyx":2205
+ /* "pywrapfst.pyx":2217
*
* def prune(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__15 = fst::kDelta;
- /* "pywrapfst.pyx":2206
+ /* "pywrapfst.pyx":2218
* def prune(self,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__16 = fst::kNoStateId;
- /* "pywrapfst.pyx":2233
+ /* "pywrapfst.pyx":2245
*
* cdef void _push(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__17 = fst::kDelta;
- /* "pywrapfst.pyx":2241
+ /* "pywrapfst.pyx":2253
*
* def push(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__18 = fst::kDelta;
- /* "pywrapfst.pyx":2478
+ /* "pywrapfst.pyx":2490
* bool connect=True,
* weight=None,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__19 = fst::kNoStateId;
- /* "pywrapfst.pyx":2479
+ /* "pywrapfst.pyx":2491
* weight=None,
* int64 nstate=fst.kNoStateId,
* float delta=fst.kShortestDelta) except *: # <<<<<<<<<<<<<<
*/
__pyx_k__20 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2492
+ /* "pywrapfst.pyx":2504
* bool connect=True,
* weight=None,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__21 = fst::kNoStateId;
- /* "pywrapfst.pyx":2493
+ /* "pywrapfst.pyx":2505
* weight=None,
* int64 nstate=fst.kNoStateId,
* float delta=fst.kShortestDelta): # <<<<<<<<<<<<<<
*/
__pyx_k__22 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2766
+ /* "pywrapfst.pyx":2778
*
*
* class Fst(object): # <<<<<<<<<<<<<<
*
* """
*/
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__68); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2766, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__68); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2778, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__68, __pyx_n_s_Fst_2, __pyx_n_s_Fst_2, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, __pyx_kp_s_Fst_arc_type_standard_Construct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2766, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__68, __pyx_n_s_Fst_2, __pyx_n_s_Fst_2, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, __pyx_kp_s_Fst_arc_type_standard_Construct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2778, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":2783
+ /* "pywrapfst.pyx":2795
* """
*
* def __new__(cls, arc_type=b"standard"): # <<<<<<<<<<<<<<
* return _create_Fst(arc_type)
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst___new, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2783, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst___new, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2795, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__71);
- if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_new, __pyx_t_3) < 0) __PYX_ERR(0, 2783, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_new, __pyx_t_3) < 0) __PYX_ERR(0, 2795, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "pywrapfst.pyx":2787
+ /* "pywrapfst.pyx":2799
*
* @staticmethod
* def read(filename): # <<<<<<<<<<<<<<
* """
* read(filename):
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_3read, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst_read, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2787, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_3read, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst_read, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2799, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":2786
+ /* "pywrapfst.pyx":2798
* return _create_Fst(arc_type)
*
* @staticmethod # <<<<<<<<<<<<<<
* def read(filename):
* """
*/
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2786, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2798, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_read, __pyx_t_4) < 0) __PYX_ERR(0, 2787, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_read, __pyx_t_4) < 0) __PYX_ERR(0, 2799, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "pywrapfst.pyx":2805
+ /* "pywrapfst.pyx":2817
*
* @staticmethod
* def read_from_string(state): # <<<<<<<<<<<<<<
* """
* read_from_string(string, fst_type=None)
*/
- __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_5read_from_string, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst_read_from_string, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2805, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_5read_from_string, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst_read_from_string, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2817, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- /* "pywrapfst.pyx":2804
+ /* "pywrapfst.pyx":2816
* return _read(filename)
*
* @staticmethod # <<<<<<<<<<<<<<
* def read_from_string(state):
* """
*/
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2804, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2816, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_read_from_string, __pyx_t_3) < 0) __PYX_ERR(0, 2805, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_read_from_string, __pyx_t_3) < 0) __PYX_ERR(0, 2817, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "pywrapfst.pyx":2766
+ /* "pywrapfst.pyx":2778
*
*
* class Fst(object): # <<<<<<<<<<<<<<
*
* """
*/
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Fst_2, __pyx_tuple__68, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2766, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Fst_2, __pyx_tuple__68, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2778, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Fst_2, __pyx_t_3) < 0) __PYX_ERR(0, 2766, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Fst_2, __pyx_t_3) < 0) __PYX_ERR(0, 2778, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2829
+ /* "pywrapfst.pyx":2841
*
*
* NO_LABEL = fst.kNoLabel # <<<<<<<<<<<<<<
* NO_STATE_ID = fst.kNoStateId
* NO_SYMBOL = fst.kNoSymbol
*/
- __pyx_t_1 = __Pyx_PyInt_From_int(fst::kNoLabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2829, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int(fst::kNoLabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2841, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_LABEL, __pyx_t_1) < 0) __PYX_ERR(0, 2829, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_LABEL, __pyx_t_1) < 0) __PYX_ERR(0, 2841, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2830
+ /* "pywrapfst.pyx":2842
*
* NO_LABEL = fst.kNoLabel
* NO_STATE_ID = fst.kNoStateId # <<<<<<<<<<<<<<
* NO_SYMBOL = fst.kNoSymbol
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2830, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_STATE_ID, __pyx_t_1) < 0) __PYX_ERR(0, 2830, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_STATE_ID, __pyx_t_1) < 0) __PYX_ERR(0, 2842, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2831
+ /* "pywrapfst.pyx":2843
* NO_LABEL = fst.kNoLabel
* NO_STATE_ID = fst.kNoStateId
* NO_SYMBOL = fst.kNoSymbol # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(fst::kNoSymbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2831, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(fst::kNoSymbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2843, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_SYMBOL, __pyx_t_1) < 0) __PYX_ERR(0, 2831, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_SYMBOL, __pyx_t_1) < 0) __PYX_ERR(0, 2843, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2837
+ /* "pywrapfst.pyx":2849
*
*
* EXPANDED = fst.kExpanded # <<<<<<<<<<<<<<
* MUTABLE = fst.kMutable
* ERROR = fst.kError
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2837, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2849, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXPANDED, __pyx_t_1) < 0) __PYX_ERR(0, 2837, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXPANDED, __pyx_t_1) < 0) __PYX_ERR(0, 2849, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2838
+ /* "pywrapfst.pyx":2850
*
* EXPANDED = fst.kExpanded
* MUTABLE = fst.kMutable # <<<<<<<<<<<<<<
* ERROR = fst.kError
* ACCEPTOR = fst.kAcceptor
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2838, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2850, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_MUTABLE, __pyx_t_1) < 0) __PYX_ERR(0, 2838, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MUTABLE, __pyx_t_1) < 0) __PYX_ERR(0, 2850, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2839
+ /* "pywrapfst.pyx":2851
* EXPANDED = fst.kExpanded
* MUTABLE = fst.kMutable
* ERROR = fst.kError # <<<<<<<<<<<<<<
* ACCEPTOR = fst.kAcceptor
* NOT_ACCEPTOR = fst.kNotAcceptor
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2839, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2851, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_1) < 0) __PYX_ERR(0, 2839, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_1) < 0) __PYX_ERR(0, 2851, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2840
+ /* "pywrapfst.pyx":2852
* MUTABLE = fst.kMutable
* ERROR = fst.kError
* ACCEPTOR = fst.kAcceptor # <<<<<<<<<<<<<<
* NOT_ACCEPTOR = fst.kNotAcceptor
* I_DETERMINISTIC = fst.kIDeterministic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2840, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2852, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCEPTOR, __pyx_t_1) < 0) __PYX_ERR(0, 2840, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCEPTOR, __pyx_t_1) < 0) __PYX_ERR(0, 2852, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2841
+ /* "pywrapfst.pyx":2853
* ERROR = fst.kError
* ACCEPTOR = fst.kAcceptor
* NOT_ACCEPTOR = fst.kNotAcceptor # <<<<<<<<<<<<<<
* I_DETERMINISTIC = fst.kIDeterministic
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2841, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2853, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_1) < 0) __PYX_ERR(0, 2841, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_1) < 0) __PYX_ERR(0, 2853, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2842
+ /* "pywrapfst.pyx":2854
* ACCEPTOR = fst.kAcceptor
* NOT_ACCEPTOR = fst.kNotAcceptor
* I_DETERMINISTIC = fst.kIDeterministic # <<<<<<<<<<<<<<
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
* O_DETERMINISTIC = fst.kODeterministic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2842, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2854, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2842, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2854, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2843
+ /* "pywrapfst.pyx":2855
* NOT_ACCEPTOR = fst.kNotAcceptor
* I_DETERMINISTIC = fst.kIDeterministic
* NON_I_DETERMINISTIC = fst.kNonIDeterministic # <<<<<<<<<<<<<<
* O_DETERMINISTIC = fst.kODeterministic
* NON_O_DETERMINISTIC = fst.kNonODeterministic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2843, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2855, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2843, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2855, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2844
+ /* "pywrapfst.pyx":2856
* I_DETERMINISTIC = fst.kIDeterministic
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
* O_DETERMINISTIC = fst.kODeterministic # <<<<<<<<<<<<<<
* NON_O_DETERMINISTIC = fst.kNonODeterministic
* EPSILONS = fst.kEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2844, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2856, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2844, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2856, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2845
+ /* "pywrapfst.pyx":2857
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
* O_DETERMINISTIC = fst.kODeterministic
* NON_O_DETERMINISTIC = fst.kNonODeterministic # <<<<<<<<<<<<<<
* EPSILONS = fst.kEpsilons
* NO_EPSILONS = fst.kNoEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2845, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2857, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2845, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2857, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2846
+ /* "pywrapfst.pyx":2858
* O_DETERMINISTIC = fst.kODeterministic
* NON_O_DETERMINISTIC = fst.kNonODeterministic
* EPSILONS = fst.kEpsilons # <<<<<<<<<<<<<<
* NO_EPSILONS = fst.kNoEpsilons
* I_EPSILONS = fst.kIEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2846, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2846, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2858, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2847
+ /* "pywrapfst.pyx":2859
* NON_O_DETERMINISTIC = fst.kNonODeterministic
* EPSILONS = fst.kEpsilons
* NO_EPSILONS = fst.kNoEpsilons # <<<<<<<<<<<<<<
* I_EPSILONS = fst.kIEpsilons
* NO_I_EPSILONS = fst.kNoIEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2847, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2847, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2859, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2848
+ /* "pywrapfst.pyx":2860
* EPSILONS = fst.kEpsilons
* NO_EPSILONS = fst.kNoEpsilons
* I_EPSILONS = fst.kIEpsilons # <<<<<<<<<<<<<<
* NO_I_EPSILONS = fst.kNoIEpsilons
* O_EPSILONS = fst.kOEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2848, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2860, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2848, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2860, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2849
+ /* "pywrapfst.pyx":2861
* NO_EPSILONS = fst.kNoEpsilons
* I_EPSILONS = fst.kIEpsilons
* NO_I_EPSILONS = fst.kNoIEpsilons # <<<<<<<<<<<<<<
* O_EPSILONS = fst.kOEpsilons
* NO_O_EPSILONS = fst.kNoOEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2849, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2861, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_I_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2849, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_I_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2861, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2850
+ /* "pywrapfst.pyx":2862
* I_EPSILONS = fst.kIEpsilons
* NO_I_EPSILONS = fst.kNoIEpsilons
* O_EPSILONS = fst.kOEpsilons # <<<<<<<<<<<<<<
* NO_O_EPSILONS = fst.kNoOEpsilons
* I_LABEL_SORTED = fst.kILabelSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2850, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2862, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2850, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2862, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2851
+ /* "pywrapfst.pyx":2863
* NO_I_EPSILONS = fst.kNoIEpsilons
* O_EPSILONS = fst.kOEpsilons
* NO_O_EPSILONS = fst.kNoOEpsilons # <<<<<<<<<<<<<<
* I_LABEL_SORTED = fst.kILabelSorted
* NOT_I_LABEL_SORTED = fst.kNotILabelSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2851, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2863, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_O_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2851, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_O_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2863, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2852
+ /* "pywrapfst.pyx":2864
* O_EPSILONS = fst.kOEpsilons
* NO_O_EPSILONS = fst.kNoOEpsilons
* I_LABEL_SORTED = fst.kILabelSorted # <<<<<<<<<<<<<<
* NOT_I_LABEL_SORTED = fst.kNotILabelSorted
* O_LABEL_SORTED = fst.kOLabelSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2852, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2864, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2852, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2864, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2853
+ /* "pywrapfst.pyx":2865
* NO_O_EPSILONS = fst.kNoOEpsilons
* I_LABEL_SORTED = fst.kILabelSorted
* NOT_I_LABEL_SORTED = fst.kNotILabelSorted # <<<<<<<<<<<<<<
* O_LABEL_SORTED = fst.kOLabelSorted
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2853, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2865, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2853, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2865, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2854
+ /* "pywrapfst.pyx":2866
* I_LABEL_SORTED = fst.kILabelSorted
* NOT_I_LABEL_SORTED = fst.kNotILabelSorted
* O_LABEL_SORTED = fst.kOLabelSorted # <<<<<<<<<<<<<<
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
* WEIGHTED = fst.kWeighted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2854, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2866, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2854, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2866, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2855
+ /* "pywrapfst.pyx":2867
* NOT_I_LABEL_SORTED = fst.kNotILabelSorted
* O_LABEL_SORTED = fst.kOLabelSorted
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted # <<<<<<<<<<<<<<
* WEIGHTED = fst.kWeighted
* UNWEIGHTED = fst.kUnweighted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2855, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2867, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2855, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2867, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2856
+ /* "pywrapfst.pyx":2868
* O_LABEL_SORTED = fst.kOLabelSorted
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
* WEIGHTED = fst.kWeighted # <<<<<<<<<<<<<<
* UNWEIGHTED = fst.kUnweighted
* CYCLIC = fst.kCyclic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2856, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2868, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED, __pyx_t_1) < 0) __PYX_ERR(0, 2856, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED, __pyx_t_1) < 0) __PYX_ERR(0, 2868, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2857
+ /* "pywrapfst.pyx":2869
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
* WEIGHTED = fst.kWeighted
* UNWEIGHTED = fst.kUnweighted # <<<<<<<<<<<<<<
* CYCLIC = fst.kCyclic
* ACYCLIC = fst.kAcyclic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2857, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2869, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED, __pyx_t_1) < 0) __PYX_ERR(0, 2857, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED, __pyx_t_1) < 0) __PYX_ERR(0, 2869, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2858
+ /* "pywrapfst.pyx":2870
* WEIGHTED = fst.kWeighted
* UNWEIGHTED = fst.kUnweighted
* CYCLIC = fst.kCyclic # <<<<<<<<<<<<<<
* ACYCLIC = fst.kAcyclic
* INITIAL_CYCLIC = fst.kInitialCyclic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2870, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_CYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2858, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2870, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2859
+ /* "pywrapfst.pyx":2871
* UNWEIGHTED = fst.kUnweighted
* CYCLIC = fst.kCyclic
* ACYCLIC = fst.kAcyclic # <<<<<<<<<<<<<<
* INITIAL_CYCLIC = fst.kInitialCyclic
* INITIAL_ACYCLIC = fst.kInitialAcyclic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2859, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2871, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2859, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2871, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2860
+ /* "pywrapfst.pyx":2872
* CYCLIC = fst.kCyclic
* ACYCLIC = fst.kAcyclic
* INITIAL_CYCLIC = fst.kInitialCyclic # <<<<<<<<<<<<<<
* INITIAL_ACYCLIC = fst.kInitialAcyclic
* TOP_SORTED = fst.kTopSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2860, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2872, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2860, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2872, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2861
+ /* "pywrapfst.pyx":2873
* ACYCLIC = fst.kAcyclic
* INITIAL_CYCLIC = fst.kInitialCyclic
* INITIAL_ACYCLIC = fst.kInitialAcyclic # <<<<<<<<<<<<<<
* TOP_SORTED = fst.kTopSorted
* NOT_TOP_SORTED = fst.kNotTopSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2861, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2873, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2861, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2873, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2862
+ /* "pywrapfst.pyx":2874
* INITIAL_CYCLIC = fst.kInitialCyclic
* INITIAL_ACYCLIC = fst.kInitialAcyclic
* TOP_SORTED = fst.kTopSorted # <<<<<<<<<<<<<<
* NOT_TOP_SORTED = fst.kNotTopSorted
* ACCESSIBLE = fst.kAccessible
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2862, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOP_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2862, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOP_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2874, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2863
+ /* "pywrapfst.pyx":2875
* INITIAL_ACYCLIC = fst.kInitialAcyclic
* TOP_SORTED = fst.kTopSorted
* NOT_TOP_SORTED = fst.kNotTopSorted # <<<<<<<<<<<<<<
* ACCESSIBLE = fst.kAccessible
* NOT_ACCESSIBLE = fst.kNotAccessible
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2863, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2875, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2863, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2875, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2864
+ /* "pywrapfst.pyx":2876
* TOP_SORTED = fst.kTopSorted
* NOT_TOP_SORTED = fst.kNotTopSorted
* ACCESSIBLE = fst.kAccessible # <<<<<<<<<<<<<<
* NOT_ACCESSIBLE = fst.kNotAccessible
* COACCESSIBLE = fst.kCoAccessible
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2864, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2876, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2864, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2876, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2865
+ /* "pywrapfst.pyx":2877
* NOT_TOP_SORTED = fst.kNotTopSorted
* ACCESSIBLE = fst.kAccessible
* NOT_ACCESSIBLE = fst.kNotAccessible # <<<<<<<<<<<<<<
* COACCESSIBLE = fst.kCoAccessible
* NOT_COACCESSIBLE = fst.kNotCoAccessible
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2865, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2877, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2865, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2877, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2866
+ /* "pywrapfst.pyx":2878
* ACCESSIBLE = fst.kAccessible
* NOT_ACCESSIBLE = fst.kNotAccessible
* COACCESSIBLE = fst.kCoAccessible # <<<<<<<<<<<<<<
* NOT_COACCESSIBLE = fst.kNotCoAccessible
* STRING = fst.kString
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2866, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2878, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2866, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_COACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2878, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2867
+ /* "pywrapfst.pyx":2879
* NOT_ACCESSIBLE = fst.kNotAccessible
* COACCESSIBLE = fst.kCoAccessible
* NOT_COACCESSIBLE = fst.kNotCoAccessible # <<<<<<<<<<<<<<
* STRING = fst.kString
* NOT_STRING = fst.kNotString
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2867, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2867, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2879, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2868
+ /* "pywrapfst.pyx":2880
* COACCESSIBLE = fst.kCoAccessible
* NOT_COACCESSIBLE = fst.kNotCoAccessible
* STRING = fst.kString # <<<<<<<<<<<<<<
* NOT_STRING = fst.kNotString
* WEIGHTED_CYCLES = fst.kWeightedCycles
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2868, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2880, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_1) < 0) __PYX_ERR(0, 2868, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_1) < 0) __PYX_ERR(0, 2880, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2869
+ /* "pywrapfst.pyx":2881
* NOT_COACCESSIBLE = fst.kNotCoAccessible
* STRING = fst.kString
* NOT_STRING = fst.kNotString # <<<<<<<<<<<<<<
* WEIGHTED_CYCLES = fst.kWeightedCycles
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2869, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2881, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_STRING, __pyx_t_1) < 0) __PYX_ERR(0, 2869, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_STRING, __pyx_t_1) < 0) __PYX_ERR(0, 2881, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2870
+ /* "pywrapfst.pyx":2882
* STRING = fst.kString
* NOT_STRING = fst.kNotString
* WEIGHTED_CYCLES = fst.kWeightedCycles # <<<<<<<<<<<<<<
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
* NULL_PROPERTIES = fst.kNullProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2870, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2882, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_1) < 0) __PYX_ERR(0, 2870, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_1) < 0) __PYX_ERR(0, 2882, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2871
+ /* "pywrapfst.pyx":2883
* NOT_STRING = fst.kNotString
* WEIGHTED_CYCLES = fst.kWeightedCycles
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles # <<<<<<<<<<<<<<
* NULL_PROPERTIES = fst.kNullProperties
* COPY_PROPERTIES = fst.kCopyProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2871, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2883, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_1) < 0) __PYX_ERR(0, 2871, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_1) < 0) __PYX_ERR(0, 2883, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2872
+ /* "pywrapfst.pyx":2884
* WEIGHTED_CYCLES = fst.kWeightedCycles
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
* NULL_PROPERTIES = fst.kNullProperties # <<<<<<<<<<<<<<
* COPY_PROPERTIES = fst.kCopyProperties
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2872, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2884, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2872, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2884, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2873
+ /* "pywrapfst.pyx":2885
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
* NULL_PROPERTIES = fst.kNullProperties
* COPY_PROPERTIES = fst.kCopyProperties # <<<<<<<<<<<<<<
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2873, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2885, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COPY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2873, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_COPY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2885, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2874
+ /* "pywrapfst.pyx":2886
* NULL_PROPERTIES = fst.kNullProperties
* COPY_PROPERTIES = fst.kCopyProperties
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties # <<<<<<<<<<<<<<
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
* SET_START_PROPERTIES = fst.kSetStartProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2886, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2874, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2886, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2875
+ /* "pywrapfst.pyx":2887
* COPY_PROPERTIES = fst.kCopyProperties
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties # <<<<<<<<<<<<<<
* SET_START_PROPERTIES = fst.kSetStartProperties
* SET_FINAL_PROPERTIES = fst.kSetFinalProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2875, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2875, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2887, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2876
+ /* "pywrapfst.pyx":2888
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
* SET_START_PROPERTIES = fst.kSetStartProperties # <<<<<<<<<<<<<<
* SET_FINAL_PROPERTIES = fst.kSetFinalProperties
* ADD_STATE_PROPERTIES = fst.kAddStateProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2876, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2888, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2876, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2888, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2877
+ /* "pywrapfst.pyx":2889
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
* SET_START_PROPERTIES = fst.kSetStartProperties
* SET_FINAL_PROPERTIES = fst.kSetFinalProperties # <<<<<<<<<<<<<<
* ADD_STATE_PROPERTIES = fst.kAddStateProperties
* ADD_ARC_PROPERTIES = fst.kAddArcProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2877, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2889, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2877, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2889, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2878
+ /* "pywrapfst.pyx":2890
* SET_START_PROPERTIES = fst.kSetStartProperties
* SET_FINAL_PROPERTIES = fst.kSetFinalProperties
* ADD_STATE_PROPERTIES = fst.kAddStateProperties # <<<<<<<<<<<<<<
* ADD_ARC_PROPERTIES = fst.kAddArcProperties
* SET_ARC_PROPERTIES = fst.kSetArcProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2878, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2890, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2878, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2890, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2879
+ /* "pywrapfst.pyx":2891
* SET_FINAL_PROPERTIES = fst.kSetFinalProperties
* ADD_STATE_PROPERTIES = fst.kAddStateProperties
* ADD_ARC_PROPERTIES = fst.kAddArcProperties # <<<<<<<<<<<<<<
* SET_ARC_PROPERTIES = fst.kSetArcProperties
* DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2891, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2879, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2891, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2880
+ /* "pywrapfst.pyx":2892
* ADD_STATE_PROPERTIES = fst.kAddStateProperties
* ADD_ARC_PROPERTIES = fst.kAddArcProperties
* SET_ARC_PROPERTIES = fst.kSetArcProperties # <<<<<<<<<<<<<<
* DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
* DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2880, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2892, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2880, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2892, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2881
+ /* "pywrapfst.pyx":2893
* ADD_ARC_PROPERTIES = fst.kAddArcProperties
* SET_ARC_PROPERTIES = fst.kSetArcProperties
* DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties # <<<<<<<<<<<<<<
* DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
* STATE_SORT_PROPERTIES = fst.kStateSortProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2881, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2893, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2881, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2893, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2882
+ /* "pywrapfst.pyx":2894
* SET_ARC_PROPERTIES = fst.kSetArcProperties
* DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
* DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties # <<<<<<<<<<<<<<
* STATE_SORT_PROPERTIES = fst.kStateSortProperties
* ARC_SORT_PROPERTIES = fst.kArcSortProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2882, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2894, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2882, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2894, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2883
+ /* "pywrapfst.pyx":2895
* DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
* DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
* STATE_SORT_PROPERTIES = fst.kStateSortProperties # <<<<<<<<<<<<<<
* ARC_SORT_PROPERTIES = fst.kArcSortProperties
* I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2883, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2895, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2883, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2895, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2884
+ /* "pywrapfst.pyx":2896
* DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
* STATE_SORT_PROPERTIES = fst.kStateSortProperties
* ARC_SORT_PROPERTIES = fst.kArcSortProperties # <<<<<<<<<<<<<<
* I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
* O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2884, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2896, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2884, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2896, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2885
+ /* "pywrapfst.pyx":2897
* STATE_SORT_PROPERTIES = fst.kStateSortProperties
* ARC_SORT_PROPERTIES = fst.kArcSortProperties
* I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties # <<<<<<<<<<<<<<
* O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
* WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2885, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2897, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2885, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2897, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2886
+ /* "pywrapfst.pyx":2898
* ARC_SORT_PROPERTIES = fst.kArcSortProperties
* I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
* O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties # <<<<<<<<<<<<<<
* WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
* ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2886, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2898, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2886, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2898, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2887
+ /* "pywrapfst.pyx":2899
* I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
* O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
* WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties # <<<<<<<<<<<<<<
* ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
* RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2887, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2899, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2888
+ /* "pywrapfst.pyx":2900
* O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
* WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
* ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties # <<<<<<<<<<<<<<
* RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
* BINARY_PROPERTIES = fst.kBinaryProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2888, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2900, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2888, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2900, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2889
+ /* "pywrapfst.pyx":2901
* WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
* ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
* RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties # <<<<<<<<<<<<<<
* BINARY_PROPERTIES = fst.kBinaryProperties
* TRINARY_PROPERTIES = fst.kTrinaryProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2889, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2901, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2889, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2901, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2890
+ /* "pywrapfst.pyx":2902
* ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
* RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
* BINARY_PROPERTIES = fst.kBinaryProperties # <<<<<<<<<<<<<<
* TRINARY_PROPERTIES = fst.kTrinaryProperties
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2890, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2902, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2890, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2902, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2891
+ /* "pywrapfst.pyx":2903
* RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
* BINARY_PROPERTIES = fst.kBinaryProperties
* TRINARY_PROPERTIES = fst.kTrinaryProperties # <<<<<<<<<<<<<<
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2891, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2903, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2891, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2903, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2892
+ /* "pywrapfst.pyx":2904
* BINARY_PROPERTIES = fst.kBinaryProperties
* TRINARY_PROPERTIES = fst.kTrinaryProperties
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties # <<<<<<<<<<<<<<
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
* FST_PROPERTIES = fst.kFstProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2892, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2904, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2892, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2904, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2893
+ /* "pywrapfst.pyx":2905
* TRINARY_PROPERTIES = fst.kTrinaryProperties
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties # <<<<<<<<<<<<<<
* FST_PROPERTIES = fst.kFstProperties
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2893, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2905, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2893, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2905, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2894
+ /* "pywrapfst.pyx":2906
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
* FST_PROPERTIES = fst.kFstProperties # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2894, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FST_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2894, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FST_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2906, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2900
+ /* "pywrapfst.pyx":2912
*
*
* ARC_I_LABEL_VALUE = fst.kArcILabelValue # <<<<<<<<<<<<<<
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcILabelValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2900, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcILabelValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2912, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_I_LABEL_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2900, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_I_LABEL_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2912, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2901
+ /* "pywrapfst.pyx":2913
*
* ARC_I_LABEL_VALUE = fst.kArcILabelValue
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue # <<<<<<<<<<<<<<
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcOLabelValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2901, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcOLabelValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2913, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_O_LABEL_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2901, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_O_LABEL_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2913, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2902
+ /* "pywrapfst.pyx":2914
* ARC_I_LABEL_VALUE = fst.kArcILabelValue
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue
* ARC_WEIGHT_VALUE = fst.kArcWeightValue # <<<<<<<<<<<<<<
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
* ARC_NO_CACHE = fst.kArcNoCache
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcWeightValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2902, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcWeightValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_WEIGHT_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2902, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_WEIGHT_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2914, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2903
+ /* "pywrapfst.pyx":2915
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue # <<<<<<<<<<<<<<
* ARC_NO_CACHE = fst.kArcNoCache
* ARC_VALUE_FLAGS = fst.kArcValueFlags
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcNextStateValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2903, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcNextStateValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2915, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NEXT_STATE_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2903, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NEXT_STATE_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2915, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2904
+ /* "pywrapfst.pyx":2916
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
* ARC_NO_CACHE = fst.kArcNoCache # <<<<<<<<<<<<<<
* ARC_VALUE_FLAGS = fst.kArcValueFlags
* ARC_FLAGS = fst.kArcFlags
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcNoCache); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2904, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcNoCache); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2916, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NO_CACHE, __pyx_t_1) < 0) __PYX_ERR(0, 2904, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NO_CACHE, __pyx_t_1) < 0) __PYX_ERR(0, 2916, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2905
+ /* "pywrapfst.pyx":2917
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
* ARC_NO_CACHE = fst.kArcNoCache
* ARC_VALUE_FLAGS = fst.kArcValueFlags # <<<<<<<<<<<<<<
* ARC_FLAGS = fst.kArcFlags
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcValueFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2905, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcValueFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_VALUE_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2905, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_VALUE_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2917, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2906
+ /* "pywrapfst.pyx":2918
* ARC_NO_CACHE = fst.kArcNoCache
* ARC_VALUE_FLAGS = fst.kArcValueFlags
* ARC_FLAGS = fst.kArcFlags # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2906, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2918, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2906, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2918, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2912
+ /* "pywrapfst.pyx":2924
*
*
* ENCODE_LABELS = fst.kEncodeLabels # <<<<<<<<<<<<<<
* ENCODE_WEIGHTS = fst.kEncodeWeights
* ENCODE_FLAGS = fst.kEncodeFlags
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeLabels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2912, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeLabels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2924, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_LABELS, __pyx_t_1) < 0) __PYX_ERR(0, 2912, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_LABELS, __pyx_t_1) < 0) __PYX_ERR(0, 2924, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2913
+ /* "pywrapfst.pyx":2925
*
* ENCODE_LABELS = fst.kEncodeLabels
* ENCODE_WEIGHTS = fst.kEncodeWeights # <<<<<<<<<<<<<<
* ENCODE_FLAGS = fst.kEncodeFlags
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeWeights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2913, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeWeights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2925, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_WEIGHTS, __pyx_t_1) < 0) __PYX_ERR(0, 2913, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_WEIGHTS, __pyx_t_1) < 0) __PYX_ERR(0, 2925, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2914
+ /* "pywrapfst.pyx":2926
* ENCODE_LABELS = fst.kEncodeLabels
* ENCODE_WEIGHTS = fst.kEncodeWeights
* ENCODE_FLAGS = fst.kEncodeFlags # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2914, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2926, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2914, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2926, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":3286
+ /* "pywrapfst.pyx":3298
*
* cdef _Fst _map(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__31 = fst::kDelta;
- /* "pywrapfst.pyx":3300
+ /* "pywrapfst.pyx":3312
*
* cpdef _Fst arcmap(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__32 = fst::kDelta;
- /* "pywrapfst.pyx":3299
+ /* "pywrapfst.pyx":3311
*
*
* cpdef _Fst arcmap(_Fst ifst, # <<<<<<<<<<<<<<
*/
__pyx_k__32 = fst::kDelta;
- /* "pywrapfst.pyx":3413
+ /* "pywrapfst.pyx":3425
*
* cpdef _MutableFst determinize(_Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__33 = fst::kShortestDelta;
- /* "pywrapfst.pyx":3415
+ /* "pywrapfst.pyx":3427
* float delta=fst.kShortestDelta,
* det_type=b"functional",
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__34 = fst::kNoStateId;
- /* "pywrapfst.pyx":3413
+ /* "pywrapfst.pyx":3425
*
* cpdef _MutableFst determinize(_Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__33 = fst::kShortestDelta;
- /* "pywrapfst.pyx":3415
+ /* "pywrapfst.pyx":3427
* float delta=fst.kShortestDelta,
* det_type=b"functional",
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__34 = fst::kNoStateId;
- /* "pywrapfst.pyx":3507
+ /* "pywrapfst.pyx":3519
*
* cpdef _MutableFst disambiguate(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__35 = fst::kDelta;
- /* "pywrapfst.pyx":3508
+ /* "pywrapfst.pyx":3520
* cpdef _MutableFst disambiguate(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__36 = fst::kNoStateId;
- /* "pywrapfst.pyx":3507
+ /* "pywrapfst.pyx":3519
*
* cpdef _MutableFst disambiguate(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__35 = fst::kDelta;
- /* "pywrapfst.pyx":3508
+ /* "pywrapfst.pyx":3520
* cpdef _MutableFst disambiguate(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__36 = fst::kNoStateId;
- /* "pywrapfst.pyx":3578
+ /* "pywrapfst.pyx":3590
*
*
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
__pyx_k__37 = fst::kDelta;
__pyx_k__37 = fst::kDelta;
- /* "pywrapfst.pyx":3601
+ /* "pywrapfst.pyx":3613
*
*
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *: # <<<<<<<<<<<<<<
__pyx_k__38 = fst::kDelta;
__pyx_k__38 = fst::kDelta;
- /* "pywrapfst.pyx":3658
+ /* "pywrapfst.pyx":3670
*
*
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
__pyx_k__39 = fst::kDelta;
__pyx_k__39 = fst::kDelta;
- /* "pywrapfst.pyx":3685
+ /* "pywrapfst.pyx":3697
*
* cpdef _MutableFst prune(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__40 = fst::kDelta;
- /* "pywrapfst.pyx":3686
+ /* "pywrapfst.pyx":3698
* cpdef _MutableFst prune(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__41 = fst::kNoStateId;
- /* "pywrapfst.pyx":3685
+ /* "pywrapfst.pyx":3697
*
* cpdef _MutableFst prune(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__40 = fst::kDelta;
- /* "pywrapfst.pyx":3686
+ /* "pywrapfst.pyx":3698
* cpdef _MutableFst prune(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__41 = fst::kNoStateId;
- /* "pywrapfst.pyx":3718
+ /* "pywrapfst.pyx":3730
*
* cpdef _MutableFst push(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__42 = fst::kDelta;
- /* "pywrapfst.pyx":3717
+ /* "pywrapfst.pyx":3729
*
*
* cpdef _MutableFst push(_Fst ifst, # <<<<<<<<<<<<<<
*/
__pyx_k__42 = fst::kDelta;
- /* "pywrapfst.pyx":3774
+ /* "pywrapfst.pyx":3786
* _Fst ifst2,
* int32 npath=1,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__43 = fst::kDelta;
- /* "pywrapfst.pyx":3777
+ /* "pywrapfst.pyx":3789
* time_t seed=0,
* select=b"uniform",
* int32 max_length=INT32_MAX) except *: # <<<<<<<<<<<<<<
*/
__pyx_k__44 = INT32_MAX;
- /* "pywrapfst.pyx":3774
+ /* "pywrapfst.pyx":3786
* _Fst ifst2,
* int32 npath=1,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__43 = fst::kDelta;
- /* "pywrapfst.pyx":3777
+ /* "pywrapfst.pyx":3789
* time_t seed=0,
* select=b"uniform",
* int32 max_length=INT32_MAX) except *: # <<<<<<<<<<<<<<
*/
__pyx_k__44 = INT32_MAX;
- /* "pywrapfst.pyx":3821
+ /* "pywrapfst.pyx":3833
* time_t seed=0,
* select=b"uniform",
* int32 max_length=INT32_MAX, # <<<<<<<<<<<<<<
*/
__pyx_k__45 = INT32_MAX;
- /* "pywrapfst.pyx":3817
+ /* "pywrapfst.pyx":3829
*
*
* cpdef _MutableFst randgen(_Fst ifst, # <<<<<<<<<<<<<<
*/
__pyx_k__45 = INT32_MAX;
- /* "pywrapfst.pyx":3959
+ /* "pywrapfst.pyx":3971
*
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__46 = fst::kShortestDelta;
- /* "pywrapfst.pyx":3960
+ /* "pywrapfst.pyx":3972
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,
* float delta=fst.kShortestDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__47 = fst::kNoStateId;
- /* "pywrapfst.pyx":3981
+ /* "pywrapfst.pyx":3993
*
* def shortestdistance(_Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__48 = fst::kShortestDelta;
- /* "pywrapfst.pyx":3982
+ /* "pywrapfst.pyx":3994
* def shortestdistance(_Fst ifst,
* float delta=fst.kShortestDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__49 = fst::kNoStateId;
- /* "pywrapfst.pyx":3980
+ /* "pywrapfst.pyx":3992
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kShortestDelta,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_53shortestdistance, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3980, __pyx_L1_error)
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_53shortestdistance, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3992, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_1) < 0) __PYX_ERR(0, 3980, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_1) < 0) __PYX_ERR(0, 3992, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":4018
+ /* "pywrapfst.pyx":4030
*
* cpdef _MutableFst shortestpath(_Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__50 = fst::kShortestDelta;
- /* "pywrapfst.pyx":4020
+ /* "pywrapfst.pyx":4032
* float delta=fst.kShortestDelta,
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__51 = fst::kNoStateId;
- /* "pywrapfst.pyx":4018
+ /* "pywrapfst.pyx":4030
*
* cpdef _MutableFst shortestpath(_Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__50 = fst::kShortestDelta;
- /* "pywrapfst.pyx":4020
+ /* "pywrapfst.pyx":4032
* float delta=fst.kShortestDelta,
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__51 = fst::kNoStateId;
- /* "pywrapfst.pyx":4171
+ /* "pywrapfst.pyx":4185
*
* def __cinit__(self,
* string fst_type=b"vector", # <<<<<<<<<<<<<<
* string arc_type=b"standard",
* SymbolTable isymbols=None,
*/
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_vector); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4171, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_vector); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4185, __pyx_L1_error)
__pyx_k__52 = __pyx_t_5;
- /* "pywrapfst.pyx":4172
+ /* "pywrapfst.pyx":4186
* def __cinit__(self,
* string fst_type=b"vector",
* string arc_type=b"standard", # <<<<<<<<<<<<<<
* SymbolTable isymbols=None,
* SymbolTable osymbols=None,
*/
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_standard); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4172, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_standard); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4186, __pyx_L1_error)
__pyx_k__53 = __pyx_t_5;
- /* "pywrapfst.pyx":4273
+ /* "pywrapfst.pyx":4287
*
* @classmethod
* def open(cls, *filenames): # <<<<<<<<<<<<<<
* """
* FarReader.open(*filenames)
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":4272
+ /* "pywrapfst.pyx":4286
* return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self))
*
* @classmethod # <<<<<<<<<<<<<<
* def open(cls, *filenames):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4272, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4286, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarReader->tp_dict, __pyx_n_s_open, __pyx_t_2) < 0) __PYX_ERR(0, 4273, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarReader->tp_dict, __pyx_n_s_open, __pyx_t_2) < 0) __PYX_ERR(0, 4287, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_FarReader);
- /* "pywrapfst.pyx":4424
+ /* "pywrapfst.pyx":4438
*
* @classmethod
* def create(cls, filename, arc_type=b"standard", far_type=b"default"): # <<<<<<<<<<<<<<
* """
* FarWriter.
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4424, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4438, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4423
+ /* "pywrapfst.pyx":4437
* return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(self))
*
* @classmethod # <<<<<<<<<<<<<<
* def create(cls, filename, arc_type=b"standard", far_type=b"default"):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4423, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarWriter->tp_dict, __pyx_n_s_create, __pyx_t_1) < 0) __PYX_ERR(0, 4424, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarWriter->tp_dict, __pyx_n_s_create, __pyx_t_1) < 0) __PYX_ERR(0, 4438, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_FarWriter);
- /* "pywrapfst.pyx":4516
+ /* "pywrapfst.pyx":4530
*
* # Masks fst_error_fatal in-module.
* fst.FLAGS_fst_error_fatal = False # <<<<<<<<<<<<<<
return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
-static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
PyObject *globals = PyFunction_GET_GLOBALS(func);
PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
}
#if PY_MAJOR_VERSION >= 3
result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
- args, nargs,
+ args, (int)nargs,
k, (int)nk,
d, (int)nd, kwdefs, closure);
#else
result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
- args, nargs,
+ args, (int)nargs,
k, (int)nk,
d, (int)nd, closure);
#endif
#if PY_VERSION_HEX >= 0x030400a1
0,
#endif
+#if PY_VERSION_HEX >= 0x030800b1
+ 0,
+#endif
};
static int __pyx_CyFunction_init(void) {
__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
#elif PY_VERSION_HEX >= 0x030400a1
0,
#endif
+#if PY_VERSION_HEX >= 0x030800b1
+ 0,
+#endif
};
static int __pyx_Generator_init(void) {
__pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;