*
* cdef string weighttostring(data, encoding=?) except * # <<<<<<<<<<<<<<
*
- * cdef fst.ComposeFilter _get_compose_filter(const string &cf) except *
+ * cdef fst.ComposeFilter _get_compose_filter(
*/
struct __pyx_opt_args_9pywrapfst_weighttostring {
int __pyx_n;
PyObject *encoding;
};
-/* "pywrapfst.pxd":96
+/* "pywrapfst.pxd":98
* # SymbolTable.
*
* ctypedef fst.SymbolTable * SymbolTable_ptr # <<<<<<<<<<<<<<
*/
typedef fst::SymbolTable *__pyx_t_9pywrapfst_SymbolTable_ptr;
-/* "pywrapfst.pxd":136
+/* "pywrapfst.pxd":138
* cdef class _MutableSymbolTable(_SymbolTable):
*
* cpdef int64 add_symbol(self, symbol, int64 key=?) # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int64 key;
};
-/* "pywrapfst.pxd":212
+/* "pywrapfst.pxd":214
*
*
* ctypedef fst.FstClass * FstClass_ptr # <<<<<<<<<<<<<<
*/
typedef fst::script::FstClass *__pyx_t_9pywrapfst_FstClass_ptr;
-/* "pywrapfst.pxd":213
+/* "pywrapfst.pxd":215
*
* ctypedef fst.FstClass * FstClass_ptr
* ctypedef fst.MutableFstClass * MutableFstClass_ptr # <<<<<<<<<<<<<<
*/
typedef fst::script::MutableFstClass *__pyx_t_9pywrapfst_MutableFstClass_ptr;
-/* "pywrapfst.pxd":214
+/* "pywrapfst.pxd":216
* ctypedef fst.FstClass * FstClass_ptr
* ctypedef fst.MutableFstClass * MutableFstClass_ptr
* ctypedef fst.VectorFstClass * VectorFstClass_ptr # <<<<<<<<<<<<<<
*/
typedef fst::script::VectorFstClass *__pyx_t_9pywrapfst_VectorFstClass_ptr;
-/* "pywrapfst.pxd":227
+/* "pywrapfst.pxd":229
* cpdef _Fst copy(self)
*
* cpdef void draw(self, filename, _SymbolTable isymbols=?, # <<<<<<<<<<<<<<
bool show_weight_one;
};
-/* "pywrapfst.pxd":255
+/* "pywrapfst.pxd":257
* cpdef StateIterator states(self)
*
* cpdef string text(self, _SymbolTable isymbols=?, _SymbolTable osymbols=?, # <<<<<<<<<<<<<<
PyObject *missing_sym;
};
-/* "pywrapfst.pxd":278
+/* "pywrapfst.pxd":280
* cpdef int64 add_state(self) except *
*
- * cdef void _arcsort(self, st=?) except * # <<<<<<<<<<<<<<
+ * cdef void _arcsort(self, sort_type=?) except * # <<<<<<<<<<<<<<
*
* cdef void _closure(self, bool closure_plus=?) except *
*/
struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort {
int __pyx_n;
- PyObject *st;
+ PyObject *sort_type;
};
-/* "pywrapfst.pxd":280
- * cdef void _arcsort(self, st=?) except *
+/* "pywrapfst.pxd":282
+ * cdef void _arcsort(self, sort_type=?) except *
*
* cdef void _closure(self, bool closure_plus=?) except * # <<<<<<<<<<<<<<
*
bool closure_plus;
};
-/* "pywrapfst.pxd":288
+/* "pywrapfst.pxd":290
* cdef void _decode(self, EncodeMapper) except *
*
* cdef void _delete_arcs(self, int64 state, size_t n=?) except * # <<<<<<<<<<<<<<
size_t n;
};
-/* "pywrapfst.pxd":290
+/* "pywrapfst.pxd":292
* cdef void _delete_arcs(self, int64 state, size_t n=?) except *
*
* cdef void _delete_states(self, states=?) except * # <<<<<<<<<<<<<<
PyObject *states;
};
-/* "pywrapfst.pxd":296
+/* "pywrapfst.pxd":298
* cdef void _invert(self) except *
*
* cdef void _minimize(self, float delta=?, bool allow_nondet=?) except * # <<<<<<<<<<<<<<
bool allow_nondet;
};
-/* "pywrapfst.pxd":302
+/* "pywrapfst.pxd":304
* cpdef int64 num_states(self)
*
* cdef void _project(self, bool project_output=?) except * # <<<<<<<<<<<<<<
bool project_output;
};
-/* "pywrapfst.pxd":304
+/* "pywrapfst.pxd":306
* cdef void _project(self, bool project_output=?) except *
*
* cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except * # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":306
+/* "pywrapfst.pxd":308
* 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":309
+/* "pywrapfst.pxd":311
* bool to_final=?) except *
*
* cdef void _relabel_pairs(self, ipairs=?, opairs=?) except * # <<<<<<<<<<<<<<
PyObject *opairs;
};
-/* "pywrapfst.pxd":311
+/* "pywrapfst.pxd":313
* cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *
*
* cdef void _relabel_tables(self, _SymbolTable old_isymbols=?, # <<<<<<<<<<<<<<
bool attach_new_osymbols;
};
-/* "pywrapfst.pxd":321
+/* "pywrapfst.pxd":323
* cdef void _reserve_states(self, int64 n) except *
*
* cdef void _reweight(self, potentials, bool to_final=?) except * # <<<<<<<<<<<<<<
bool to_final;
};
-/* "pywrapfst.pxd":323
+/* "pywrapfst.pxd":325
* cdef void _reweight(self, potentials, bool to_final=?) except *
*
* cdef void _rmepsilon(self, bool connect=?, float delta=?, int64 nstate=?, # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":326
+/* "pywrapfst.pxd":328
* weight=?) except *
*
* cdef void _set_final(self, int64 state, weight=?) except * # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":350
+/* "pywrapfst.pxd":352
* cdef _Fst _init_XFst(FstClass_ptr tfst)
*
* cdef _MutableFst _create_Fst(arc_type=?) # <<<<<<<<<<<<<<
PyObject *arc_type;
};
-/* "pywrapfst.pxd":352
+/* "pywrapfst.pxd":354
* cdef _MutableFst _create_Fst(arc_type=?)
*
* cdef _Fst _read_Fst(filename, fst_type=?) # <<<<<<<<<<<<<<
PyObject *fst_type;
};
-/* "pywrapfst.pxd":354
+/* "pywrapfst.pxd":356
* cdef _Fst _read_Fst(filename, fst_type=?)
*
* cdef _Fst _deserialize_Fst(fst_string, fst_type=?) # <<<<<<<<<<<<<<
PyObject *fst_type;
};
-/* "pywrapfst.pxd":433
+/* "pywrapfst.pxd":435
*
*
- * cdef _Fst _map(_Fst ifst, float delta=?, mt=?, weight=?) # <<<<<<<<<<<<<<
+ * cdef _Fst _map(_Fst ifst, float delta=?, map_type=?, weight=?) # <<<<<<<<<<<<<<
*
- * cpdef _Fst arcmap(_Fst ifst, float delta=?, mt=?, weight=?)
+ * cpdef _Fst arcmap(_Fst ifst, float delta=?, map_type=?, weight=?)
*/
struct __pyx_opt_args_9pywrapfst__map {
int __pyx_n;
float delta;
- PyObject *mt;
+ PyObject *map_type;
PyObject *weight;
};
-/* "pywrapfst.pxd":435
- * cdef _Fst _map(_Fst ifst, float delta=?, mt=?, weight=?)
+/* "pywrapfst.pxd":437
+ * cdef _Fst _map(_Fst ifst, float delta=?, map_type=?, weight=?)
*
- * cpdef _Fst arcmap(_Fst ifst, float delta=?, mt=?, weight=?) # <<<<<<<<<<<<<<
+ * cpdef _Fst arcmap(_Fst ifst, float delta=?, map_type=?, weight=?) # <<<<<<<<<<<<<<
*
- * cpdef _MutableFst compose(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?)
+ * cpdef _MutableFst compose(_Fst ifst1, _Fst ifst2, compose_filter=?,
*/
struct __pyx_opt_args_9pywrapfst_arcmap {
int __pyx_n;
float delta;
- PyObject *mt;
+ PyObject *map_type;
PyObject *weight;
};
-/* "pywrapfst.pxd":437
- * cpdef _Fst arcmap(_Fst ifst, float delta=?, mt=?, weight=?)
+/* "pywrapfst.pxd":439
+ * cpdef _Fst arcmap(_Fst ifst, float delta=?, map_type=?, weight=?)
*
- * cpdef _MutableFst compose(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?) # <<<<<<<<<<<<<<
+ * cpdef _MutableFst compose(_Fst ifst1, _Fst ifst2, compose_filter=?, # <<<<<<<<<<<<<<
+ * bool connect=?)
*
- * cpdef _Fst convert(_Fst ifst, fst_type=?)
*/
struct __pyx_opt_args_9pywrapfst_compose {
int __pyx_n;
- PyObject *cf;
+ PyObject *compose_filter;
bool connect;
};
-/* "pywrapfst.pxd":439
- * cpdef _MutableFst compose(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?)
+/* "pywrapfst.pxd":442
+ * bool connect=?)
*
* cpdef _Fst convert(_Fst ifst, fst_type=?) # <<<<<<<<<<<<<<
*
- * cpdef _MutableFst determinize(_Fst ifst, float delta=?, dt=?,
+ * cpdef _MutableFst determinize(_Fst ifst, float delta=?, det_type=?,
*/
struct __pyx_opt_args_9pywrapfst_convert {
int __pyx_n;
PyObject *fst_type;
};
-/* "pywrapfst.pxd":441
+/* "pywrapfst.pxd":444
* cpdef _Fst convert(_Fst ifst, fst_type=?)
*
- * cpdef _MutableFst determinize(_Fst ifst, float delta=?, dt=?, # <<<<<<<<<<<<<<
- * int64 nstate=?, int64 subsequential_label=?,
- * weight=?, bool increment_subsequential_label=?)
+ * cpdef _MutableFst determinize(_Fst ifst, float delta=?, det_type=?, # <<<<<<<<<<<<<<
+ * int64 nstate=?, int64 subsequential_label=?,
+ * weight=?, bool increment_subsequential_label=?)
*/
struct __pyx_opt_args_9pywrapfst_determinize {
int __pyx_n;
float delta;
- PyObject *dt;
+ PyObject *det_type;
__pyx_t_10basictypes_int64 nstate;
__pyx_t_10basictypes_int64 subsequential_label;
PyObject *weight;
bool increment_subsequential_label;
};
-/* "pywrapfst.pxd":445
- * weight=?, bool increment_subsequential_label=?)
+/* "pywrapfst.pxd":448
+ * weight=?, bool increment_subsequential_label=?)
*
- * cpdef _MutableFst difference(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?) # <<<<<<<<<<<<<<
+ * cpdef _MutableFst difference(_Fst ifst1, _Fst ifst2, compose_filter=?, # <<<<<<<<<<<<<<
+ * bool connect=?)
*
- * cpdef _MutableFst disambiguate(_Fst ifst, float delta=?, int64 nstate=?,
*/
struct __pyx_opt_args_9pywrapfst_difference {
int __pyx_n;
- PyObject *cf;
+ PyObject *compose_filter;
bool connect;
};
-/* "pywrapfst.pxd":447
- * cpdef _MutableFst difference(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?)
+/* "pywrapfst.pxd":451
+ * bool connect=?)
*
* cpdef _MutableFst disambiguate(_Fst ifst, float delta=?, int64 nstate=?, # <<<<<<<<<<<<<<
- * int64 subsequential_label=?, weight=?)
+ * int64 subsequential_label=?, weight=?)
*
*/
struct __pyx_opt_args_9pywrapfst_disambiguate {
PyObject *weight;
};
-/* "pywrapfst.pxd":450
- * int64 subsequential_label=?, weight=?)
+/* "pywrapfst.pxd":454
+ * int64 subsequential_label=?, weight=?)
*
* cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=?) # <<<<<<<<<<<<<<
*
bool eps_norm_output;
};
-/* "pywrapfst.pxd":452
+/* "pywrapfst.pxd":456
* cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=?)
*
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=?) # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":454
+/* "pywrapfst.pxd":458
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=?)
*
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=?) except * # <<<<<<<<<<<<<<
*
- * cpdef _MutableFst intersect(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?)
+ * cpdef _MutableFst intersect(_Fst ifst1, _Fst ifst2, compose_filter=?,
*/
struct __pyx_opt_args_9pywrapfst_equivalent {
int __pyx_n;
float delta;
};
-/* "pywrapfst.pxd":456
+/* "pywrapfst.pxd":460
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=?) except *
*
- * cpdef _MutableFst intersect(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?) # <<<<<<<<<<<<<<
+ * cpdef _MutableFst intersect(_Fst ifst1, _Fst ifst2, compose_filter=?, # <<<<<<<<<<<<<<
+ * bool connect=?)
*
- * cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=?)
*/
struct __pyx_opt_args_9pywrapfst_intersect {
int __pyx_n;
- PyObject *cf;
+ PyObject *compose_filter;
bool connect;
};
-/* "pywrapfst.pxd":458
- * cpdef _MutableFst intersect(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?)
+/* "pywrapfst.pxd":463
+ * bool connect=?)
*
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=?) # <<<<<<<<<<<<<<
*
float delta;
};
-/* "pywrapfst.pxd":460
+/* "pywrapfst.pxd":465
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=?)
*
* cpdef _MutableFst prune(_Fst ifst, float delta=?, int64 nstate=?, # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":463
+/* "pywrapfst.pxd":468
* weight=?)
*
* cpdef _MutableFst push(_Fst ifst, float delta=?, bool push_weights=?, # <<<<<<<<<<<<<<
bool to_final;
};
-/* "pywrapfst.pxd":467
+/* "pywrapfst.pxd":472
* bool remove_total_weight=?, bool to_final=?)
*
* cpdef bool randequivalent(_Fst ifst1, _Fst ifst2, int32 npath=?, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int32 max_length;
};
-/* "pywrapfst.pxd":471
+/* "pywrapfst.pxd":476
* int32 max_length=?) except *
*
* cpdef _MutableFst randgen(_Fst ifst, int32 npath=?, time_t seed=?, # <<<<<<<<<<<<<<
bool weighted;
};
-/* "pywrapfst.pxd":478
+/* "pywrapfst.pxd":483
* bool epsilon_on_replace) except *
*
- * cpdef _MutableFst replace(pairs, call_arc_labeling=?, # <<<<<<<<<<<<<<
- * return_arc_labeling=?, bool epsilon_on_replace=?,
- * int64 return_label=?)
+ * cpdef _MutableFst replace(pairs, call_arc_labeling=?, return_arc_labeling=?, # <<<<<<<<<<<<<<
+ * bool epsilon_on_replace=?, int64 return_label=?)
+ *
*/
struct __pyx_opt_args_9pywrapfst_replace {
int __pyx_n;
__pyx_t_10basictypes_int64 return_label;
};
-/* "pywrapfst.pxd":482
- * int64 return_label=?)
+/* "pywrapfst.pxd":486
+ * bool epsilon_on_replace=?, int64 return_label=?)
*
* cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=?) # <<<<<<<<<<<<<<
*
bool require_superinitial;
};
-/* "pywrapfst.pxd":484
+/* "pywrapfst.pxd":488
* cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=?)
*
* cpdef _MutableFst rmepsilon(_Fst ifst, bool connect=?, float delta=?, # <<<<<<<<<<<<<<
- * int64 nstate=?, qt=?, bool reverse=?,
+ * int64 nstate=?, queue_type=?, bool reverse=?,
* weight=?)
*/
struct __pyx_opt_args_9pywrapfst_rmepsilon {
bool connect;
float delta;
__pyx_t_10basictypes_int64 nstate;
- PyObject *qt;
+ PyObject *queue_type;
bool reverse;
PyObject *weight;
};
-/* "pywrapfst.pxd":488
+/* "pywrapfst.pxd":492
* weight=?)
*
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, float delta=?, # <<<<<<<<<<<<<<
- * int64 nstate=?, qt=?,
+ * int64 nstate=?, queue_type=?,
* bool reverse=?) except *
*/
struct __pyx_opt_args_9pywrapfst__shortestdistance {
int __pyx_n;
float delta;
__pyx_t_10basictypes_int64 nstate;
- PyObject *qt;
+ PyObject *queue_type;
bool reverse;
};
-/* "pywrapfst.pxd":492
+/* "pywrapfst.pxd":496
* bool reverse=?) except *
*
* cpdef _MutableFst shortestpath(_Fst ifst, float delta=?, int32 nshortest=?, # <<<<<<<<<<<<<<
- * int64 nstate=?, qt=?, bool unique=?,
+ * int64 nstate=?, queue_type=?, bool unique=?,
* weight=?)
*/
struct __pyx_opt_args_9pywrapfst_shortestpath {
float delta;
__pyx_t_10basictypes_int32 nshortest;
__pyx_t_10basictypes_int64 nstate;
- PyObject *qt;
+ PyObject *queue_type;
bool unique;
PyObject *weight;
};
-/* "pywrapfst.pxd":66
+/* "pywrapfst.pxd":68
*
*
* cdef class Weight(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":99
+/* "pywrapfst.pxd":101
*
*
* cdef class _SymbolTable(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":124
+/* "pywrapfst.pxd":126
*
*
* cdef class _EncodeMapperSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":129
+/* "pywrapfst.pxd":131
*
*
* cdef class _FstSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":134
+/* "pywrapfst.pxd":136
*
*
* cdef class _MutableSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":143
+/* "pywrapfst.pxd":145
*
*
* cdef class _MutableFstSymbolTable(_MutableSymbolTable): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":148
+/* "pywrapfst.pxd":150
*
*
* cdef class SymbolTable(_MutableSymbolTable): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":169
+/* "pywrapfst.pxd":171
*
*
* cdef class SymbolTableIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":188
+/* "pywrapfst.pxd":190
*
*
* cdef class EncodeMapper(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":217
+/* "pywrapfst.pxd":219
*
*
* cdef class _Fst(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":268
+/* "pywrapfst.pxd":270
*
*
* cdef class _MutableFst(_Fst): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":360
+/* "pywrapfst.pxd":362
*
*
* cdef class Arc(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":370
+/* "pywrapfst.pxd":372
*
*
* cdef class ArcIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":392
+/* "pywrapfst.pxd":394
*
*
* cdef class MutableArcIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":416
+/* "pywrapfst.pxd":418
*
*
* cdef class StateIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":504
+/* "pywrapfst.pxd":508
*
*
* cdef class Compiler(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":525
+/* "pywrapfst.pxd":529
* # FarReader.
*
* cdef class FarReader(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":550
+/* "pywrapfst.pxd":554
* # FarWriter.
*
* cdef class FarWriter(object): # <<<<<<<<<<<<<<
-/* "pywrapfst.pyx":344
+/* "pywrapfst.pyx":348
*
*
* cdef class Weight(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Weight *__pyx_vtabptr_9pywrapfst_Weight;
-/* "pywrapfst.pyx":665
+/* "pywrapfst.pyx":669
*
*
* cdef class _SymbolTable(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__SymbolTable *__pyx_vtabptr_9pywrapfst__SymbolTable;
-/* "pywrapfst.pyx":817
+/* "pywrapfst.pyx":821
*
*
* cdef class _EncodeMapperSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTable *__pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTable;
-/* "pywrapfst.pyx":837
+/* "pywrapfst.pyx":841
*
*
* cdef class _FstSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__FstSymbolTable *__pyx_vtabptr_9pywrapfst__FstSymbolTable;
-/* "pywrapfst.pyx":856
+/* "pywrapfst.pyx":860
*
*
* cdef class _MutableSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
-/* "pywrapfst.pyx":907
+/* "pywrapfst.pyx":911
*
*
* cdef class _MutableFstSymbolTable(_MutableSymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTable *__pyx_vtabptr_9pywrapfst__MutableFstSymbolTable;
-/* "pywrapfst.pyx":927
+/* "pywrapfst.pyx":931
*
*
* cdef class SymbolTable(_MutableSymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_SymbolTable *__pyx_vtabptr_9pywrapfst_SymbolTable;
-/* "pywrapfst.pyx":1117
+/* "pywrapfst.pyx":1121
*
*
* cdef class SymbolTableIterator(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *__pyx_vtabptr_9pywrapfst_SymbolTableIterator;
-/* "pywrapfst.pyx":1217
+/* "pywrapfst.pyx":1221
*
*
* cdef class EncodeMapper(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *__pyx_vtabptr_9pywrapfst_EncodeMapper;
-/* "pywrapfst.pyx":1348
+/* "pywrapfst.pyx":1352
*
*
* cdef class _Fst(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__Fst *__pyx_vtabptr_9pywrapfst__Fst;
-/* "pywrapfst.pyx":1714
+/* "pywrapfst.pyx":1718
*
*
* cdef class _MutableFst(_Fst): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__MutableFst *__pyx_vtabptr_9pywrapfst__MutableFst;
-/* "pywrapfst.pyx":2795
+/* "pywrapfst.pyx":2799
*
*
* cdef class Arc(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Arc *__pyx_vtabptr_9pywrapfst_Arc;
-/* "pywrapfst.pyx":2863
+/* "pywrapfst.pyx":2867
*
*
* cdef class ArcIterator(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_ArcIterator *__pyx_vtabptr_9pywrapfst_ArcIterator;
-/* "pywrapfst.pyx":3000
+/* "pywrapfst.pyx":3004
*
*
* cdef class MutableArcIterator(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *__pyx_vtabptr_9pywrapfst_MutableArcIterator;
-/* "pywrapfst.pyx":3152
+/* "pywrapfst.pyx":3156
*
*
* cdef class StateIterator(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_StateIterator *__pyx_vtabptr_9pywrapfst_StateIterator;
-/* "pywrapfst.pyx":4099
+/* "pywrapfst.pyx":4111
*
*
* cdef class Compiler(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Compiler *__pyx_vtabptr_9pywrapfst_Compiler;
-/* "pywrapfst.pyx":4225
+/* "pywrapfst.pyx":4237
*
*
* cdef class FarReader(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_FarReader *__pyx_vtabptr_9pywrapfst_FarReader;
-/* "pywrapfst.pyx":4399
+/* "pywrapfst.pyx":4411
*
*
* cdef class FarWriter(object): # <<<<<<<<<<<<<<
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value);
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__fst_3a__3a_script_3a__3a_ArcSortType(enum fst::script::ArcSortType value);
-
/* CppExceptionConversion.proto */
#ifndef __Pyx_CppExn2PyErr
#include <new>
}
#endif
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__fst_3a__3a_script_3a__3a_MapType(enum fst::script::MapType value);
-
/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
static const char __pyx_k_g[] = "g";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_w[] = "w";
-static const char __pyx_k_cf[] = "cf";
-static const char __pyx_k_dt[] = "dt";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_it[] = "it";
-static const char __pyx_k_mt[] = "mt";
-static const char __pyx_k_qt[] = "qt";
-static const char __pyx_k_st[] = "st";
static const char __pyx_k_Fst[] = "Fst";
static const char __pyx_k_One[] = "One";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_acceptor[] = "acceptor";
static const char __pyx_k_arc_type[] = "arc_type";
static const char __pyx_k_checksum[] = "checksum";
+static const char __pyx_k_det_type[] = "det_type";
static const char __pyx_k_distance[] = "distance";
static const char __pyx_k_far_type[] = "far_type";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_fst_type[] = "fst_type";
static const char __pyx_k_identity[] = "identity";
static const char __pyx_k_isymbols[] = "isymbols";
+static const char __pyx_k_map_type[] = "map_type";
static const char __pyx_k_num_arcs[] = "num_arcs";
static const char __pyx_k_osymbols[] = "osymbols";
static const char __pyx_k_portrait[] = "portrait";
static const char __pyx_k_read_text[] = "read_text";
static const char __pyx_k_set_flags[] = "set_flags";
static const char __pyx_k_set_value[] = "set_value";
+static const char __pyx_k_sort_type[] = "sort_type";
static const char __pyx_k_to_string[] = "to_string";
static const char __pyx_k_ACCESSIBLE[] = "ACCESSIBLE";
static const char __pyx_k_FstIOError[] = "FstIOError";
static const char __pyx_k_potentials[] = "potentials";
static const char __pyx_k_properties[] = "properties";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_queue_type[] = "queue_type";
static const char __pyx_k_returncode[] = "returncode";
static const char __pyx_k_subprocess[] = "subprocess";
static const char __pyx_k_write_text[] = "write_text";
static const char __pyx_k_O_LABEL_SORTED[] = "O_LABEL_SORTED";
static const char __pyx_k_Weight_at_0x_x[] = "<{} Weight {} at 0x{:x}>";
static const char __pyx_k_Write_failed_r[] = "Write failed: {!r}";
+static const char __pyx_k_compose_filter[] = "compose_filter";
static const char __pyx_k_encode_weights[] = "encode_weights";
static const char __pyx_k_output_symbols[] = "output_symbols";
static const char __pyx_k_project_output[] = "project_output";
static PyObject *__pyx_n_b_auto;
static PyObject *__pyx_n_s_available_key;
static PyObject *__pyx_n_s_call_arc_labeling;
-static PyObject *__pyx_n_s_cf;
static PyObject *__pyx_n_s_checksum;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_closure_plus;
static PyObject *__pyx_n_s_cls;
static PyObject *__pyx_n_s_communicate;
static PyObject *__pyx_n_s_compile;
+static PyObject *__pyx_n_s_compose_filter;
static PyObject *__pyx_n_s_connect;
static PyObject *__pyx_kp_s_const_EncodeMapper_SymbolTable;
static PyObject *__pyx_kp_s_const_Fst_SymbolTable_r_at_0x_x;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_b_default;
static PyObject *__pyx_n_s_delta;
+static PyObject *__pyx_n_s_det_type;
static PyObject *__pyx_n_s_distance;
static PyObject *__pyx_n_s_divide;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_done;
static PyObject *__pyx_n_s_dot;
static PyObject *__pyx_n_s_draw;
-static PyObject *__pyx_n_s_dt;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_encode_labels;
static PyObject *__pyx_n_s_encode_weights;
static PyObject *__pyx_n_s_lhs;
static PyObject *__pyx_n_s_logging;
static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_map_type;
static PyObject *__pyx_n_s_mask;
static PyObject *__pyx_n_s_max_length;
static PyObject *__pyx_n_s_member;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_missing_sym;
static PyObject *__pyx_n_s_module;
-static PyObject *__pyx_n_s_mt;
static PyObject *__pyx_n_s_mutable_arcs;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_kp_b_pywrapfst;
static PyObject *__pyx_n_s_pywrapfst_2;
static PyObject *__pyx_n_s_pyx_vtable;
-static PyObject *__pyx_n_s_qt;
static PyObject *__pyx_n_s_qualname;
+static PyObject *__pyx_n_s_queue_type;
static PyObject *__pyx_n_s_ranksep;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_read_from_string;
static PyObject *__pyx_n_s_set_value;
static PyObject *__pyx_n_s_shortestdistance;
static PyObject *__pyx_n_s_show_weight_one;
+static PyObject *__pyx_n_s_sort_type;
static PyObject *__pyx_n_s_ssymbols;
-static PyObject *__pyx_n_s_st;
static PyObject *__pyx_n_b_standard;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_pf_9pywrapfst_4_Fst_44WriteToString(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_st); /* 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_13StateIterator_10next(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_13StateIterator_12reset(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_13StateIterator_14value(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12arcmap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_mt, PyObject *__pyx_v_weight); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_14compose(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_cf, bool __pyx_v_connect); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_12arcmap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_map_type, PyObject *__pyx_v_weight); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_14compose(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect); /* proto */
static PyObject *__pyx_pf_9pywrapfst_16convert(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, PyObject *__pyx_v_fst_type); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_18determinize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_dt, __pyx_t_10basictypes_int64 __pyx_v_nstate, __pyx_t_10basictypes_int64 __pyx_v_subsequential_label, PyObject *__pyx_v_weight, bool __pyx_v_increment_subsequential_label); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_20difference(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_cf, bool __pyx_v_connect); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_18determinize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_det_type, __pyx_t_10basictypes_int64 __pyx_v_nstate, __pyx_t_10basictypes_int64 __pyx_v_subsequential_label, PyObject *__pyx_v_weight, bool __pyx_v_increment_subsequential_label); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_20difference(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect); /* proto */
static PyObject *__pyx_pf_9pywrapfst_22disambiguate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, __pyx_t_10basictypes_int64 __pyx_v_subsequential_label, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_24epsnormalize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, bool __pyx_v_eps_norm_output); /* proto */
static PyObject *__pyx_pf_9pywrapfst_26equal(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_9pywrapfst_28equivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, float __pyx_v_delta); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_30intersect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_cf, bool __pyx_v_connect); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_30intersect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect); /* proto */
static PyObject *__pyx_pf_9pywrapfst_32isomorphic(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_9pywrapfst_34prune(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_36push(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, bool __pyx_v_push_weights, bool __pyx_v_push_labels, bool __pyx_v_remove_common_affix, bool __pyx_v_remove_total_weight, bool __pyx_v_to_final); /* proto */
static PyObject *__pyx_pf_9pywrapfst_40randgen(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, __pyx_t_10basictypes_int32 __pyx_v_npath, time_t __pyx_v_seed, PyObject *__pyx_v_select, __pyx_t_10basictypes_int32 __pyx_v_max_length, bool __pyx_v_weighted, bool __pyx_v_remove_total_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_42replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pairs, PyObject *__pyx_v_call_arc_labeling, PyObject *__pyx_v_return_arc_labeling, bool __pyx_v_epsilon_on_replace, __pyx_t_10basictypes_int64 __pyx_v_return_label); /* proto */
static PyObject *__pyx_pf_9pywrapfst_44reverse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, bool __pyx_v_require_superinitial); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_46rmepsilon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, bool __pyx_v_connect, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_qt, bool __pyx_v_reverse, PyObject *__pyx_v_weight); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_qt, bool __pyx_v_reverse); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_50shortestpath(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int32 __pyx_v_nshortest, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_qt, bool __pyx_v_unique, PyObject *__pyx_v_weight); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_52statemap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, PyObject *__pyx_v_mt); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_46rmepsilon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, bool __pyx_v_connect, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_reverse, PyObject *__pyx_v_weight); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_reverse); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_50shortestpath(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int32 __pyx_v_nshortest, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_unique, PyObject *__pyx_v_weight); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_52statemap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, PyObject *__pyx_v_map_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_54synchronize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto */
static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, std::string __pyx_v_fst_type, std::string __pyx_v_arc_type, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_keep_isymbols, bool __pyx_v_keep_osymbols, bool __pyx_v_keep_state_numbering, bool __pyx_v_allow_negative_labels); /* proto */
static PyObject *__pyx_pf_9pywrapfst_8Compiler_2compile(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self); /* proto */
/* "pywrapfst.pyx":220
*
*
- * cdef fst.ComposeFilter _get_compose_filter(const string &cf) except *: # <<<<<<<<<<<<<<
+ * cdef fst.ComposeFilter _get_compose_filter( # <<<<<<<<<<<<<<
+ * const string &compose_filter) except *:
* """Matches string with the appropriate ComposeFilter enum value.
- *
*/
-static enum fst::ComposeFilter __pyx_f_9pywrapfst__get_compose_filter(std::string const &__pyx_v_cf) {
- enum fst::ComposeFilter __pyx_v_compose_filter;
+static enum fst::ComposeFilter __pyx_f_9pywrapfst__get_compose_filter(std::string const &__pyx_v_compose_filter) {
+ enum fst::ComposeFilter __pyx_v_compose_filter_enum;
enum fst::ComposeFilter __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("_get_compose_filter", 0);
- /* "pywrapfst.pyx":240
+ /* "pywrapfst.pyx":241
* """
- * cdef fst.ComposeFilter compose_filter
- * if not fst.GetComposeFilter(cf, addr(compose_filter)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown compose filter type: {!r}".format(cf))
- * return compose_filter
+ * cdef fst.ComposeFilter compose_filter_enum
+ * if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)): # <<<<<<<<<<<<<<
+ * raise FstArgError("Unknown compose filter type: {!r}".format(
+ * compose_filter))
*/
- __pyx_t_1 = ((!(fst::script::GetComposeFilter(__pyx_v_cf, (&__pyx_v_compose_filter)) != 0)) != 0);
+ __pyx_t_1 = ((!(fst::script::GetComposeFilter(__pyx_v_compose_filter, (&__pyx_v_compose_filter_enum)) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":241
- * cdef fst.ComposeFilter compose_filter
- * if not fst.GetComposeFilter(cf, addr(compose_filter)):
- * raise FstArgError("Unknown compose filter type: {!r}".format(cf)) # <<<<<<<<<<<<<<
- * return compose_filter
- *
+ /* "pywrapfst.pyx":242
+ * cdef fst.ComposeFilter compose_filter_enum
+ * if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)):
+ * raise FstArgError("Unknown compose filter type: {!r}".format( # <<<<<<<<<<<<<<
+ * compose_filter))
+ * return compose_filter_enum
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_compose_filter_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_compose_filter_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_cf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error)
+
+ /* "pywrapfst.pyx":243
+ * if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)):
+ * raise FstArgError("Unknown compose filter type: {!r}".format(
+ * compose_filter)) # <<<<<<<<<<<<<<
+ * return compose_filter_enum
+ *
+ */
+ __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_compose_filter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 241, __pyx_L1_error)
+ __PYX_ERR(0, 242, __pyx_L1_error)
- /* "pywrapfst.pyx":240
+ /* "pywrapfst.pyx":241
* """
- * cdef fst.ComposeFilter compose_filter
- * if not fst.GetComposeFilter(cf, addr(compose_filter)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown compose filter type: {!r}".format(cf))
- * return compose_filter
+ * cdef fst.ComposeFilter compose_filter_enum
+ * if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)): # <<<<<<<<<<<<<<
+ * raise FstArgError("Unknown compose filter type: {!r}".format(
+ * compose_filter))
*/
}
- /* "pywrapfst.pyx":242
- * if not fst.GetComposeFilter(cf, addr(compose_filter)):
- * raise FstArgError("Unknown compose filter type: {!r}".format(cf))
- * return compose_filter # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":244
+ * raise FstArgError("Unknown compose filter type: {!r}".format(
+ * compose_filter))
+ * return compose_filter_enum # <<<<<<<<<<<<<<
*
*
*/
- __pyx_r = __pyx_v_compose_filter;
+ __pyx_r = __pyx_v_compose_filter_enum;
goto __pyx_L0;
/* "pywrapfst.pyx":220
*
*
- * cdef fst.ComposeFilter _get_compose_filter(const string &cf) except *: # <<<<<<<<<<<<<<
+ * cdef fst.ComposeFilter _get_compose_filter( # <<<<<<<<<<<<<<
+ * const string &compose_filter) except *:
* """Matches string with the appropriate ComposeFilter enum value.
- *
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":245
+/* "pywrapfst.pyx":247
*
*
- * cdef fst.DeterminizeType _get_determinize_type(const string &dt) except *: # <<<<<<<<<<<<<<
+ * cdef fst.DeterminizeType _get_determinize_type(const string &det_type) except *: # <<<<<<<<<<<<<<
* """Matches string with the appropriate DeterminizeType enum value.
*
*/
-static enum fst::DeterminizeType __pyx_f_9pywrapfst__get_determinize_type(std::string const &__pyx_v_dt) {
- enum fst::DeterminizeType __pyx_v_determinize_type;
+static enum fst::DeterminizeType __pyx_f_9pywrapfst__get_determinize_type(std::string const &__pyx_v_det_type) {
+ enum fst::DeterminizeType __pyx_v_det_type_enum;
enum fst::DeterminizeType __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("_get_determinize_type", 0);
- /* "pywrapfst.pyx":261
+ /* "pywrapfst.pyx":263
* """
- * cdef fst.DeterminizeType determinize_type
- * if not fst.GetDeterminizeType(dt, addr(determinize_type)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown determinization type: {!r}".format(dt))
- * return determinize_type
+ * cdef fst.DeterminizeType det_type_enum
+ * if not fst.GetDeterminizeType(det_type, addr(det_type_enum)): # <<<<<<<<<<<<<<
+ * raise FstArgError("Unknown determinization type: {!r}".format(det_type))
+ * return det_type_enum
*/
- __pyx_t_1 = ((!(fst::script::GetDeterminizeType(__pyx_v_dt, (&__pyx_v_determinize_type)) != 0)) != 0);
+ __pyx_t_1 = ((!(fst::script::GetDeterminizeType(__pyx_v_det_type, (&__pyx_v_det_type_enum)) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":262
- * cdef fst.DeterminizeType determinize_type
- * if not fst.GetDeterminizeType(dt, addr(determinize_type)):
- * raise FstArgError("Unknown determinization type: {!r}".format(dt)) # <<<<<<<<<<<<<<
- * return determinize_type
+ /* "pywrapfst.pyx":264
+ * cdef fst.DeterminizeType det_type_enum
+ * if not fst.GetDeterminizeType(det_type, addr(det_type_enum)):
+ * raise FstArgError("Unknown determinization type: {!r}".format(det_type)) # <<<<<<<<<<<<<<
+ * return det_type_enum
*
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_determinization_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_determinization_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_dt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_det_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 262, __pyx_L1_error)
+ __PYX_ERR(0, 264, __pyx_L1_error)
- /* "pywrapfst.pyx":261
+ /* "pywrapfst.pyx":263
* """
- * cdef fst.DeterminizeType determinize_type
- * if not fst.GetDeterminizeType(dt, addr(determinize_type)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown determinization type: {!r}".format(dt))
- * return determinize_type
+ * cdef fst.DeterminizeType det_type_enum
+ * if not fst.GetDeterminizeType(det_type, addr(det_type_enum)): # <<<<<<<<<<<<<<
+ * raise FstArgError("Unknown determinization type: {!r}".format(det_type))
+ * return det_type_enum
*/
}
- /* "pywrapfst.pyx":263
- * if not fst.GetDeterminizeType(dt, addr(determinize_type)):
- * raise FstArgError("Unknown determinization type: {!r}".format(dt))
- * return determinize_type # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":265
+ * if not fst.GetDeterminizeType(det_type, addr(det_type_enum)):
+ * raise FstArgError("Unknown determinization type: {!r}".format(det_type))
+ * return det_type_enum # <<<<<<<<<<<<<<
*
*
*/
- __pyx_r = __pyx_v_determinize_type;
+ __pyx_r = __pyx_v_det_type_enum;
goto __pyx_L0;
- /* "pywrapfst.pyx":245
+ /* "pywrapfst.pyx":247
*
*
- * cdef fst.DeterminizeType _get_determinize_type(const string &dt) except *: # <<<<<<<<<<<<<<
+ * cdef fst.DeterminizeType _get_determinize_type(const string &det_type) except *: # <<<<<<<<<<<<<<
* """Matches string with the appropriate DeterminizeType enum value.
*
*/
return __pyx_r;
}
-/* "pywrapfst.pyx":266
+/* "pywrapfst.pyx":268
*
*
- * cdef fst.QueueType _get_queue_type(const string &qt) except *: # <<<<<<<<<<<<<<
+ * cdef fst.QueueType _get_queue_type(const string &queue_type) except *: # <<<<<<<<<<<<<<
* """Matches string with the appropriate QueueType enum value.
*
*/
-static enum fst::QueueType __pyx_f_9pywrapfst__get_queue_type(std::string const &__pyx_v_qt) {
- enum fst::QueueType __pyx_v_queue_type;
+static enum fst::QueueType __pyx_f_9pywrapfst__get_queue_type(std::string const &__pyx_v_queue_type) {
+ enum fst::QueueType __pyx_v_queue_type_enum;
enum fst::QueueType __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("_get_queue_type", 0);
- /* "pywrapfst.pyx":285
+ /* "pywrapfst.pyx":287
* """
- * cdef fst.QueueType queue_type
- * if not fst.GetQueueType(qt, addr(queue_type)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown queue type: {!r}".format(qt))
- * return queue_type
+ * cdef fst.QueueType queue_type_enum
+ * if not fst.GetQueueType(queue_type, addr(queue_type_enum)): # <<<<<<<<<<<<<<
+ * raise FstArgError("Unknown queue type: {!r}".format(queue_type))
+ * return queue_type_enum
*/
- __pyx_t_1 = ((!(fst::script::GetQueueType(__pyx_v_qt, (&__pyx_v_queue_type)) != 0)) != 0);
+ __pyx_t_1 = ((!(fst::script::GetQueueType(__pyx_v_queue_type, (&__pyx_v_queue_type_enum)) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":286
- * cdef fst.QueueType queue_type
- * if not fst.GetQueueType(qt, addr(queue_type)):
- * raise FstArgError("Unknown queue type: {!r}".format(qt)) # <<<<<<<<<<<<<<
- * return queue_type
+ /* "pywrapfst.pyx":288
+ * cdef fst.QueueType queue_type_enum
+ * if not fst.GetQueueType(queue_type, addr(queue_type_enum)):
+ * raise FstArgError("Unknown queue type: {!r}".format(queue_type)) # <<<<<<<<<<<<<<
+ * return queue_type_enum
*
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_queue_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_queue_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_qt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_queue_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 286, __pyx_L1_error)
+ __PYX_ERR(0, 288, __pyx_L1_error)
- /* "pywrapfst.pyx":285
+ /* "pywrapfst.pyx":287
* """
- * cdef fst.QueueType queue_type
- * if not fst.GetQueueType(qt, addr(queue_type)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown queue type: {!r}".format(qt))
- * return queue_type
+ * cdef fst.QueueType queue_type_enum
+ * if not fst.GetQueueType(queue_type, addr(queue_type_enum)): # <<<<<<<<<<<<<<
+ * raise FstArgError("Unknown queue type: {!r}".format(queue_type))
+ * return queue_type_enum
*/
}
- /* "pywrapfst.pyx":287
- * if not fst.GetQueueType(qt, addr(queue_type)):
- * raise FstArgError("Unknown queue type: {!r}".format(qt))
- * return queue_type # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":289
+ * if not fst.GetQueueType(queue_type, addr(queue_type_enum)):
+ * raise FstArgError("Unknown queue type: {!r}".format(queue_type))
+ * return queue_type_enum # <<<<<<<<<<<<<<
*
*
*/
- __pyx_r = __pyx_v_queue_type;
+ __pyx_r = __pyx_v_queue_type_enum;
goto __pyx_L0;
- /* "pywrapfst.pyx":266
+ /* "pywrapfst.pyx":268
*
*
- * cdef fst.QueueType _get_queue_type(const string &qt) except *: # <<<<<<<<<<<<<<
+ * cdef fst.QueueType _get_queue_type(const string &queue_type) except *: # <<<<<<<<<<<<<<
* """Matches string with the appropriate QueueType enum value.
*
*/
return __pyx_r;
}
-/* "pywrapfst.pyx":290
+/* "pywrapfst.pyx":292
*
*
- * cdef fst.RandArcSelection _get_rand_arc_selection(const string &ras) except *: # <<<<<<<<<<<<<<
+ * cdef fst.RandArcSelection _get_rand_arc_selection( # <<<<<<<<<<<<<<
+ * const string &select) except *:
* """Matches string with the appropriate RandArcSelection enum value.
- *
*/
-static enum fst::script::RandArcSelection __pyx_f_9pywrapfst__get_rand_arc_selection(std::string const &__pyx_v_ras) {
- enum fst::script::RandArcSelection __pyx_v_rand_arc_selection;
+static enum fst::script::RandArcSelection __pyx_f_9pywrapfst__get_rand_arc_selection(std::string const &__pyx_v_select) {
+ enum fst::script::RandArcSelection __pyx_v_select_enum;
enum fst::script::RandArcSelection __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("_get_rand_arc_selection", 0);
- /* "pywrapfst.pyx":309
+ /* "pywrapfst.pyx":312
* """
- * cdef fst.RandArcSelection rand_arc_selection
- * if not fst.GetRandArcSelection(ras, addr(rand_arc_selection)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown random arc selection type: {!r}".format(ras))
- * return rand_arc_selection
+ * cdef fst.RandArcSelection select_enum
+ * if not fst.GetRandArcSelection(select, addr(select_enum)): # <<<<<<<<<<<<<<
+ * raise FstArgError("Unknown random arc selection type: {!r}".format(select))
+ * return select_enum
*/
- __pyx_t_1 = ((!(fst::script::GetRandArcSelection(__pyx_v_ras, (&__pyx_v_rand_arc_selection)) != 0)) != 0);
+ __pyx_t_1 = ((!(fst::script::GetRandArcSelection(__pyx_v_select, (&__pyx_v_select_enum)) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":310
- * cdef fst.RandArcSelection rand_arc_selection
- * if not fst.GetRandArcSelection(ras, addr(rand_arc_selection)):
- * raise FstArgError("Unknown random arc selection type: {!r}".format(ras)) # <<<<<<<<<<<<<<
- * return rand_arc_selection
+ /* "pywrapfst.pyx":313
+ * cdef fst.RandArcSelection select_enum
+ * if not fst.GetRandArcSelection(select, addr(select_enum)):
+ * raise FstArgError("Unknown random arc selection type: {!r}".format(select)) # <<<<<<<<<<<<<<
+ * return select_enum
*
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_random_arc_selection_typ, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_random_arc_selection_typ, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_ras); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_select); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 310, __pyx_L1_error)
+ __PYX_ERR(0, 313, __pyx_L1_error)
- /* "pywrapfst.pyx":309
+ /* "pywrapfst.pyx":312
* """
- * cdef fst.RandArcSelection rand_arc_selection
- * if not fst.GetRandArcSelection(ras, addr(rand_arc_selection)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown random arc selection type: {!r}".format(ras))
- * return rand_arc_selection
+ * cdef fst.RandArcSelection select_enum
+ * if not fst.GetRandArcSelection(select, addr(select_enum)): # <<<<<<<<<<<<<<
+ * raise FstArgError("Unknown random arc selection type: {!r}".format(select))
+ * return select_enum
*/
}
- /* "pywrapfst.pyx":311
- * if not fst.GetRandArcSelection(ras, addr(rand_arc_selection)):
- * raise FstArgError("Unknown random arc selection type: {!r}".format(ras))
- * return rand_arc_selection # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":314
+ * if not fst.GetRandArcSelection(select, addr(select_enum)):
+ * raise FstArgError("Unknown random arc selection type: {!r}".format(select))
+ * return select_enum # <<<<<<<<<<<<<<
*
*
*/
- __pyx_r = __pyx_v_rand_arc_selection;
+ __pyx_r = __pyx_v_select_enum;
goto __pyx_L0;
- /* "pywrapfst.pyx":290
+ /* "pywrapfst.pyx":292
*
*
- * cdef fst.RandArcSelection _get_rand_arc_selection(const string &ras) except *: # <<<<<<<<<<<<<<
+ * cdef fst.RandArcSelection _get_rand_arc_selection( # <<<<<<<<<<<<<<
+ * const string &select) except *:
* """Matches string with the appropriate RandArcSelection enum value.
- *
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":314
+/* "pywrapfst.pyx":317
*
*
- * cdef fst.ReplaceLabelType _get_replace_label_type(const string &rlt, # <<<<<<<<<<<<<<
- * bool epsilon_on_replace) except *:
+ * cdef fst.ReplaceLabelType _get_replace_label_type( # <<<<<<<<<<<<<<
+ * const string &replace_label_type, bool epsilon_on_replace) except *:
* """Matches string with the appropriate ReplaceLabelType enum value.
*/
-static enum fst::ReplaceLabelType __pyx_f_9pywrapfst__get_replace_label_type(std::string const &__pyx_v_rlt, bool __pyx_v_epsilon_on_replace) {
- enum fst::ReplaceLabelType __pyx_v_replace_label_type;
+static enum fst::ReplaceLabelType __pyx_f_9pywrapfst__get_replace_label_type(std::string const &__pyx_v_replace_label_type, bool __pyx_v_epsilon_on_replace) {
+ enum fst::ReplaceLabelType __pyx_v_replace_label_type_enum;
enum fst::ReplaceLabelType __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("_get_replace_label_type", 0);
- /* "pywrapfst.pyx":335
+ /* "pywrapfst.pyx":338
* """
- * cdef fst.ReplaceLabelType replace_label_type
- * if not fst.GetReplaceLabelType(rlt, epsilon_on_replace, # <<<<<<<<<<<<<<
- * addr(replace_label_type)):
- * raise FstArgError("Unknown replace label type: {!r}".format(rlt))
+ * cdef fst.ReplaceLabelType replace_label_type_enum
+ * if not fst.GetReplaceLabelType(replace_label_type, epsilon_on_replace, # <<<<<<<<<<<<<<
+ * addr(replace_label_type_enum)):
+ * raise FstArgError("Unknown replace label type: {!r}".format(
*/
- __pyx_t_1 = ((!(fst::script::GetReplaceLabelType(__pyx_v_rlt, __pyx_v_epsilon_on_replace, (&__pyx_v_replace_label_type)) != 0)) != 0);
+ __pyx_t_1 = ((!(fst::script::GetReplaceLabelType(__pyx_v_replace_label_type, __pyx_v_epsilon_on_replace, (&__pyx_v_replace_label_type_enum)) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":337
- * if not fst.GetReplaceLabelType(rlt, epsilon_on_replace,
- * addr(replace_label_type)):
- * raise FstArgError("Unknown replace label type: {!r}".format(rlt)) # <<<<<<<<<<<<<<
- * return replace_label_type
- *
+ /* "pywrapfst.pyx":340
+ * if not fst.GetReplaceLabelType(replace_label_type, epsilon_on_replace,
+ * addr(replace_label_type_enum)):
+ * raise FstArgError("Unknown replace label type: {!r}".format( # <<<<<<<<<<<<<<
+ * replace_label_type))
+ * return replace_label_type_enum
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_replace_label_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_replace_label_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_rlt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
+
+ /* "pywrapfst.pyx":341
+ * addr(replace_label_type_enum)):
+ * raise FstArgError("Unknown replace label type: {!r}".format(
+ * replace_label_type)) # <<<<<<<<<<<<<<
+ * return replace_label_type_enum
+ *
+ */
+ __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_replace_label_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 337, __pyx_L1_error)
+ __PYX_ERR(0, 340, __pyx_L1_error)
- /* "pywrapfst.pyx":335
+ /* "pywrapfst.pyx":338
* """
- * cdef fst.ReplaceLabelType replace_label_type
- * if not fst.GetReplaceLabelType(rlt, epsilon_on_replace, # <<<<<<<<<<<<<<
- * addr(replace_label_type)):
- * raise FstArgError("Unknown replace label type: {!r}".format(rlt))
+ * cdef fst.ReplaceLabelType replace_label_type_enum
+ * if not fst.GetReplaceLabelType(replace_label_type, epsilon_on_replace, # <<<<<<<<<<<<<<
+ * addr(replace_label_type_enum)):
+ * raise FstArgError("Unknown replace label type: {!r}".format(
*/
}
- /* "pywrapfst.pyx":338
- * addr(replace_label_type)):
- * raise FstArgError("Unknown replace label type: {!r}".format(rlt))
- * return replace_label_type # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":342
+ * raise FstArgError("Unknown replace label type: {!r}".format(
+ * replace_label_type))
+ * return replace_label_type_enum # <<<<<<<<<<<<<<
*
*
*/
- __pyx_r = __pyx_v_replace_label_type;
+ __pyx_r = __pyx_v_replace_label_type_enum;
goto __pyx_L0;
- /* "pywrapfst.pyx":314
+ /* "pywrapfst.pyx":317
*
*
- * cdef fst.ReplaceLabelType _get_replace_label_type(const string &rlt, # <<<<<<<<<<<<<<
- * bool epsilon_on_replace) except *:
+ * cdef fst.ReplaceLabelType _get_replace_label_type( # <<<<<<<<<<<<<<
+ * const string &replace_label_type, bool epsilon_on_replace) except *:
* """Matches string with the appropriate ReplaceLabelType enum value.
*/
return __pyx_r;
}
-/* "pywrapfst.pyx":364
+/* "pywrapfst.pyx":368
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":365
+ /* "pywrapfst.pyx":369
*
* def __repr__(self):
* return "<{} Weight {} at 0x{:x}>".format(self.type(), self.to_string(), # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Weight_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Weight_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __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 '%s'", "type");
- __PYX_ERR(0, 365, __pyx_L1_error)
+ __PYX_ERR(0, 369, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "to_string");
- __PYX_ERR(0, 365, __pyx_L1_error)
+ __PYX_ERR(0, 369, __pyx_L1_error)
}
- __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- /* "pywrapfst.pyx":366
+ /* "pywrapfst.pyx":370
* def __repr__(self):
* return "<{} Weight {} at 0x{:x}>".format(self.type(), self.to_string(),
* id(self)) # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 366, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_t_6};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __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[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_t_6};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __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_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_6 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":364
+ /* "pywrapfst.pyx":368
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":368
+/* "pywrapfst.pyx":372
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "pywrapfst.pyx":369
+ /* "pywrapfst.pyx":373
*
* def __str__(self):
* return self.to_string() # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "to_string");
- __PYX_ERR(0, 369, __pyx_L1_error)
+ __PYX_ERR(0, 373, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":368
+ /* "pywrapfst.pyx":372
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":374
+/* "pywrapfst.pyx":378
* # ValueError when that is not appropriate.
*
* def __float__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__float__", 0);
- /* "pywrapfst.pyx":375
+ /* "pywrapfst.pyx":379
*
* def __float__(self):
* return float(self.to_string()) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "to_string");
- __PYX_ERR(0, 375, __pyx_L1_error)
+ __PYX_ERR(0, 379, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":374
+ /* "pywrapfst.pyx":378
* # ValueError when that is not appropriate.
*
* def __float__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":377
+/* "pywrapfst.pyx":381
* return float(self.to_string())
*
* def __init__(self, weight_type, weight): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 377, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 381, __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, 377, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 381, __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("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 377, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 381, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Weight.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
std::string __pyx_t_2;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":378
+ /* "pywrapfst.pyx":382
*
* def __init__(self, weight_type, weight):
* self._weight.reset(new fst.WeightClass(tostring(weight_type), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 378, __pyx_L1_error)
+ __PYX_ERR(0, 382, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L1_error)
- /* "pywrapfst.pyx":379
+ /* "pywrapfst.pyx":383
* def __init__(self, weight_type, weight):
* self._weight.reset(new fst.WeightClass(tostring(weight_type),
* weighttostring(weight))) # <<<<<<<<<<<<<<
* self._check_weight()
*
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error)
- /* "pywrapfst.pyx":378
+ /* "pywrapfst.pyx":382
*
* def __init__(self, weight_type, weight):
* self._weight.reset(new fst.WeightClass(tostring(weight_type), # <<<<<<<<<<<<<<
*/
__pyx_v_self->_weight.reset(new fst::script::WeightClass(__pyx_t_1, __pyx_t_2));
- /* "pywrapfst.pyx":380
+ /* "pywrapfst.pyx":384
* self._weight.reset(new fst.WeightClass(tostring(weight_type),
* weighttostring(weight)))
* self._check_weight() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_weight");
- __PYX_ERR(0, 380, __pyx_L1_error)
+ __PYX_ERR(0, 384, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->_check_weight(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->_check_weight(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 384, __pyx_L1_error)
- /* "pywrapfst.pyx":377
+ /* "pywrapfst.pyx":381
* return float(self.to_string())
*
* def __init__(self, weight_type, weight): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":382
+/* "pywrapfst.pyx":386
* self._check_weight()
*
* cdef void _check_weight(self) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("_check_weight", 0);
- /* "pywrapfst.pyx":383
+ /* "pywrapfst.pyx":387
*
* cdef void _check_weight(self) except *:
* if self.type() == b"none": # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "type");
- __PYX_ERR(0, 383, __pyx_L1_error)
+ __PYX_ERR(0, 387, __pyx_L1_error)
}
__pyx_t_1 = ((((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->type(__pyx_v_self, 0) == ((char *)"none")) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":384
+ /* "pywrapfst.pyx":388
* cdef void _check_weight(self) except *:
* if self.type() == b"none":
* raise FstUnknownWeightTypeError(self.type()) # <<<<<<<<<<<<<<
* if self.to_string() == b"BadNumber":
* raise FstBadWeightError(self.to_string())
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstUnknownWeightTypeError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstUnknownWeightTypeError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "type");
- __PYX_ERR(0, 384, __pyx_L1_error)
+ __PYX_ERR(0, 388, __pyx_L1_error)
}
- __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__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, 384, __pyx_L1_error)
+ __PYX_ERR(0, 388, __pyx_L1_error)
- /* "pywrapfst.pyx":383
+ /* "pywrapfst.pyx":387
*
* cdef void _check_weight(self) except *:
* if self.type() == b"none": # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":385
+ /* "pywrapfst.pyx":389
* if self.type() == b"none":
* raise FstUnknownWeightTypeError(self.type())
* if self.to_string() == b"BadNumber": # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "to_string");
- __PYX_ERR(0, 385, __pyx_L1_error)
+ __PYX_ERR(0, 389, __pyx_L1_error)
}
__pyx_t_1 = ((((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0) == ((char *)"BadNumber")) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":386
+ /* "pywrapfst.pyx":390
* raise FstUnknownWeightTypeError(self.type())
* if self.to_string() == b"BadNumber":
* raise FstBadWeightError(self.to_string()) # <<<<<<<<<<<<<<
*
* cpdef Weight copy(self):
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "to_string");
- __PYX_ERR(0, 386, __pyx_L1_error)
+ __PYX_ERR(0, 390, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__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, 386, __pyx_L1_error)
+ __PYX_ERR(0, 390, __pyx_L1_error)
- /* "pywrapfst.pyx":385
+ /* "pywrapfst.pyx":389
* if self.type() == b"none":
* raise FstUnknownWeightTypeError(self.type())
* if self.to_string() == b"BadNumber": # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":382
+ /* "pywrapfst.pyx":386
* self._check_weight()
*
* cdef void _check_weight(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":388
+/* "pywrapfst.pyx":392
* raise FstBadWeightError(self.to_string())
*
* cpdef Weight copy(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __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, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_6Weight_9copy)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __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_Weight))))) __PYX_ERR(0, 388, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 392, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":394
+ /* "pywrapfst.pyx":398
* Returns a copy of the Weight.
* """
* cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* result._weight.reset(new
* fst.WeightClass(<fst.WeightClass> deref(self._weight)))
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 394, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 398, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":395
+ /* "pywrapfst.pyx":399
* """
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 395, __pyx_L1_error)
+ __PYX_ERR(0, 399, __pyx_L1_error)
}
- /* "pywrapfst.pyx":396
+ /* "pywrapfst.pyx":400
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new
* fst.WeightClass(<fst.WeightClass> deref(self._weight))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 396, __pyx_L1_error)
+ __PYX_ERR(0, 400, __pyx_L1_error)
}
- /* "pywrapfst.pyx":395
+ /* "pywrapfst.pyx":399
* """
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new # <<<<<<<<<<<<<<
*/
__pyx_v_result->_weight.reset(new fst::script::WeightClass(((fst::script::WeightClass)(*__pyx_v_self->_weight))));
- /* "pywrapfst.pyx":397
+ /* "pywrapfst.pyx":401
* result._weight.reset(new
* fst.WeightClass(<fst.WeightClass> deref(self._weight)))
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":388
+ /* "pywrapfst.pyx":392
* raise FstBadWeightError(self.to_string())
*
* cpdef Weight copy(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("copy", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_6Weight_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_6Weight_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":403
+/* "pywrapfst.pyx":407
*
* @classmethod
* def Zero(cls, weight_type): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("Zero", 0);
- /* "pywrapfst.pyx":407
+ /* "pywrapfst.pyx":411
* Weight.Zero(weight_type)
* """
* return _Weight_Zero(weight_type) # <<<<<<<<<<<<<<
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__Weight_Zero(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__Weight_Zero(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":403
+ /* "pywrapfst.pyx":407
*
* @classmethod
* def Zero(cls, weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":410
+/* "pywrapfst.pyx":414
*
* @classmethod
* def One(cls, weight_type): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("One", 0);
- /* "pywrapfst.pyx":414
+ /* "pywrapfst.pyx":418
* Weight.One(weight_type)
* """
* return _Weight_One(weight_type) # <<<<<<<<<<<<<<
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__Weight_One(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__Weight_One(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":410
+ /* "pywrapfst.pyx":414
*
* @classmethod
* def One(cls, weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":417
+/* "pywrapfst.pyx":421
*
* @classmethod
* def NoWeight(cls, weight_type): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("NoWeight", 0);
- /* "pywrapfst.pyx":421
+ /* "pywrapfst.pyx":425
* Weight.NoWeight(weight_type)
* """
* return _Weight_NoWeight(weight_type) # <<<<<<<<<<<<<<
* def __richcmp__(Weight x, Weight y, int op):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__Weight_NoWeight(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__Weight_NoWeight(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":417
+ /* "pywrapfst.pyx":421
*
* @classmethod
* def NoWeight(cls, weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":423
+/* "pywrapfst.pyx":427
* return _Weight_NoWeight(weight_type)
*
* def __richcmp__(Weight x, Weight y, int op): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_9pywrapfst_Weight, 1, "x", 0))) __PYX_ERR(0, 423, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_9pywrapfst_Weight, 1, "y", 0))) __PYX_ERR(0, 423, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_9pywrapfst_Weight, 1, "x", 0))) __PYX_ERR(0, 427, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_9pywrapfst_Weight, 1, "y", 0))) __PYX_ERR(0, 427, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_6Weight_16__richcmp__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_x), ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_y), ((int)__pyx_v_op));
/* function exit code */
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__richcmp__", 0);
- /* "pywrapfst.pyx":425
+ /* "pywrapfst.pyx":429
* def __richcmp__(Weight x, Weight y, int op):
* # This is useful for unit tests.
* if op == 2: # `==` # <<<<<<<<<<<<<<
switch (__pyx_v_op) {
case 2:
- /* "pywrapfst.pyx":426
+ /* "pywrapfst.pyx":430
* # This is useful for unit tests.
* if op == 2: # `==`
* return (x.type() == y.type() and x.to_string() == y.to_string()) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_x) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "type");
- __PYX_ERR(0, 426, __pyx_L1_error)
+ __PYX_ERR(0, 430, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_y) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "type");
- __PYX_ERR(0, 426, __pyx_L1_error)
+ __PYX_ERR(0, 430, __pyx_L1_error)
}
__pyx_t_2 = (((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_x->__pyx_vtab)->type(__pyx_v_x, 0) == ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_y->__pyx_vtab)->type(__pyx_v_y, 0));
if (__pyx_t_2) {
} else {
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __pyx_t_3;
__pyx_t_3 = 0;
}
if (unlikely(((PyObject *)__pyx_v_x) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "to_string");
- __PYX_ERR(0, 426, __pyx_L1_error)
+ __PYX_ERR(0, 430, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_y) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "to_string");
- __PYX_ERR(0, 426, __pyx_L1_error)
+ __PYX_ERR(0, 430, __pyx_L1_error)
}
__pyx_t_2 = (((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_x->__pyx_vtab)->to_string(__pyx_v_x, 0) == ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_y->__pyx_vtab)->to_string(__pyx_v_y, 0));
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __pyx_t_3;
__pyx_t_3 = 0;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":425
+ /* "pywrapfst.pyx":429
* def __richcmp__(Weight x, Weight y, int op):
* # This is useful for unit tests.
* if op == 2: # `==` # <<<<<<<<<<<<<<
*/
break;
- /* "pywrapfst.pyx":427
+ /* "pywrapfst.pyx":431
* if op == 2: # `==`
* return (x.type() == y.type() and x.to_string() == y.to_string())
* elif op == 3: # `!=` # <<<<<<<<<<<<<<
*/
case 3:
- /* "pywrapfst.pyx":428
+ /* "pywrapfst.pyx":432
* return (x.type() == y.type() and x.to_string() == y.to_string())
* elif op == 3: # `!=`
* return not (x == y) # <<<<<<<<<<<<<<
* raise NotImplementedError("Invalid operator {!r}".format(op))
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_x), ((PyObject *)__pyx_v_y), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
+ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_x), ((PyObject *)__pyx_v_y), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 432, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":427
+ /* "pywrapfst.pyx":431
* if op == 2: # `==`
* return (x.type() == y.type() and x.to_string() == y.to_string())
* elif op == 3: # `!=` # <<<<<<<<<<<<<<
break;
default:
- /* "pywrapfst.pyx":430
+ /* "pywrapfst.pyx":434
* return not (x == y)
* else:
* raise NotImplementedError("Invalid operator {!r}".format(op)) # <<<<<<<<<<<<<<
*
* cpdef string to_string(self):
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_operator_r, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_operator_r, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_op); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_op); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
}
}
if (!__pyx_t_5) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __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, 430, __pyx_L1_error)
+ __PYX_ERR(0, 434, __pyx_L1_error)
break;
}
- /* "pywrapfst.pyx":423
+ /* "pywrapfst.pyx":427
* return _Weight_NoWeight(weight_type)
*
* def __richcmp__(Weight x, Weight y, int op): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":432
+/* "pywrapfst.pyx":436
* raise NotImplementedError("Invalid operator {!r}".format(op))
*
* cpdef string to_string(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_6Weight_19to_string)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __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, 432, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":433
+ /* "pywrapfst.pyx":437
*
* cpdef string to_string(self):
* return self._weight.get().ToString() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 433, __pyx_L1_error)
+ __PYX_ERR(0, 437, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_weight.get()->ToString();
goto __pyx_L0;
- /* "pywrapfst.pyx":432
+ /* "pywrapfst.pyx":436
* raise NotImplementedError("Invalid operator {!r}".format(op))
*
* cpdef string to_string(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("to_string", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_6Weight_to_string(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_6Weight_to_string(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":435
+/* "pywrapfst.pyx":439
* return self._weight.get().ToString()
*
* cpdef string type(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_6Weight_21type)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __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, 435, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 439, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":436
+ /* "pywrapfst.pyx":440
*
* cpdef string type(self):
* return self._weight.get().Type() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 436, __pyx_L1_error)
+ __PYX_ERR(0, 440, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_weight.get()->Type();
goto __pyx_L0;
- /* "pywrapfst.pyx":435
+ /* "pywrapfst.pyx":439
* return self._weight.get().ToString()
*
* cpdef string type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_6Weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_6Weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":439
+/* "pywrapfst.pyx":443
*
*
* cdef Weight _plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_plus", 0);
- /* "pywrapfst.pyx":440
+ /* "pywrapfst.pyx":444
*
* cdef Weight _plus(Weight lhs, Weight rhs):
* cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
* deref(rhs._weight))))
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 440, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 444, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":441
+ /* "pywrapfst.pyx":445
* cdef Weight _plus(Weight lhs, Weight rhs):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 441, __pyx_L1_error)
+ __PYX_ERR(0, 445, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 441, __pyx_L1_error)
+ __PYX_ERR(0, 445, __pyx_L1_error)
}
- /* "pywrapfst.pyx":442
+ /* "pywrapfst.pyx":446
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
* deref(rhs._weight)))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 442, __pyx_L1_error)
+ __PYX_ERR(0, 446, __pyx_L1_error)
}
- /* "pywrapfst.pyx":441
+ /* "pywrapfst.pyx":445
* cdef Weight _plus(Weight lhs, Weight rhs):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight), # <<<<<<<<<<<<<<
*/
__pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::Plus((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));
- /* "pywrapfst.pyx":443
+ /* "pywrapfst.pyx":447
* result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
* deref(rhs._weight))))
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":439
+ /* "pywrapfst.pyx":443
*
*
* cdef Weight _plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":446
+/* "pywrapfst.pyx":450
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, 1); __PYX_ERR(0, 446, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, 1); __PYX_ERR(0, 450, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "plus") < 0)) __PYX_ERR(0, 446, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "plus") < 0)) __PYX_ERR(0, 450, __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("plus", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 446, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 450, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.plus", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 446, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 446, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 450, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 450, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_plus(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("plus", 0);
- /* "pywrapfst.pyx":466
+ /* "pywrapfst.pyx":470
* FstUnknownWeightTypeError: weights are null or not in the same semiring.
* """
* cdef Weight result = _plus(lhs, rhs) # <<<<<<<<<<<<<<
* result._check_weight()
* return result
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__plus(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__plus(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":467
+ /* "pywrapfst.pyx":471
* """
* cdef Weight result = _plus(lhs, rhs)
* result._check_weight() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_weight");
- __PYX_ERR(0, 467, __pyx_L1_error)
+ __PYX_ERR(0, 471, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_result->__pyx_vtab)->_check_weight(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_result->__pyx_vtab)->_check_weight(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L1_error)
- /* "pywrapfst.pyx":468
+ /* "pywrapfst.pyx":472
* cdef Weight result = _plus(lhs, rhs)
* result._check_weight()
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":446
+ /* "pywrapfst.pyx":450
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":471
+/* "pywrapfst.pyx":475
*
*
* cdef Weight _times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_times", 0);
- /* "pywrapfst.pyx":472
+ /* "pywrapfst.pyx":476
*
* cdef Weight _times(Weight lhs, Weight rhs):
* cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
* deref(rhs._weight))))
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 472, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 476, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":473
+ /* "pywrapfst.pyx":477
* cdef Weight _times(Weight lhs, Weight rhs):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 473, __pyx_L1_error)
+ __PYX_ERR(0, 477, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 473, __pyx_L1_error)
+ __PYX_ERR(0, 477, __pyx_L1_error)
}
- /* "pywrapfst.pyx":474
+ /* "pywrapfst.pyx":478
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
* deref(rhs._weight)))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 474, __pyx_L1_error)
+ __PYX_ERR(0, 478, __pyx_L1_error)
}
- /* "pywrapfst.pyx":473
+ /* "pywrapfst.pyx":477
* cdef Weight _times(Weight lhs, Weight rhs):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight), # <<<<<<<<<<<<<<
*/
__pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::Times((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));
- /* "pywrapfst.pyx":475
+ /* "pywrapfst.pyx":479
* result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
* deref(rhs._weight))))
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":471
+ /* "pywrapfst.pyx":475
*
*
* cdef Weight _times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":478
+/* "pywrapfst.pyx":482
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, 1); __PYX_ERR(0, 478, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, 1); __PYX_ERR(0, 482, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "times") < 0)) __PYX_ERR(0, 478, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "times") < 0)) __PYX_ERR(0, 482, __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("times", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 478, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 482, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.times", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 478, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 478, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 482, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 482, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_2times(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("times", 0);
- /* "pywrapfst.pyx":498
+ /* "pywrapfst.pyx":502
* FstUnknownWeightTypeError: weights are null or not in the same semiring.
* """
* cdef Weight result = _times(lhs, rhs) # <<<<<<<<<<<<<<
* result._check_weight()
* return result
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__times(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__times(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":499
+ /* "pywrapfst.pyx":503
* """
* cdef Weight result = _times(lhs, rhs)
* result._check_weight() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_weight");
- __PYX_ERR(0, 499, __pyx_L1_error)
+ __PYX_ERR(0, 503, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_result->__pyx_vtab)->_check_weight(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 499, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_result->__pyx_vtab)->_check_weight(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L1_error)
- /* "pywrapfst.pyx":500
+ /* "pywrapfst.pyx":504
* cdef Weight result = _times(lhs, rhs)
* result._check_weight()
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":478
+ /* "pywrapfst.pyx":482
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":503
+/* "pywrapfst.pyx":507
*
*
* cdef Weight _divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_divide", 0);
- /* "pywrapfst.pyx":504
+ /* "pywrapfst.pyx":508
*
* cdef Weight _divide(Weight lhs, Weight rhs):
* cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
* deref(rhs._weight))))
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 504, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 508, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":505
+ /* "pywrapfst.pyx":509
* cdef Weight _divide(Weight lhs, Weight rhs):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 505, __pyx_L1_error)
+ __PYX_ERR(0, 509, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 505, __pyx_L1_error)
+ __PYX_ERR(0, 509, __pyx_L1_error)
}
- /* "pywrapfst.pyx":506
+ /* "pywrapfst.pyx":510
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
* deref(rhs._weight)))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 506, __pyx_L1_error)
+ __PYX_ERR(0, 510, __pyx_L1_error)
}
- /* "pywrapfst.pyx":505
+ /* "pywrapfst.pyx":509
* cdef Weight _divide(Weight lhs, Weight rhs):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight), # <<<<<<<<<<<<<<
*/
__pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::Divide((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));
- /* "pywrapfst.pyx":507
+ /* "pywrapfst.pyx":511
* result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
* deref(rhs._weight))))
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":503
+ /* "pywrapfst.pyx":507
*
*
* cdef Weight _divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":510
+/* "pywrapfst.pyx":514
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, 1); __PYX_ERR(0, 510, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "divide") < 0)) __PYX_ERR(0, 510, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "divide") < 0)) __PYX_ERR(0, 514, __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("divide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 510, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.divide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 510, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 510, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 514, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 514, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_4divide(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("divide", 0);
- /* "pywrapfst.pyx":532
+ /* "pywrapfst.pyx":536
* FstUnknownWeightTypeError: weights are null or not in the same semiring.
* """
* cdef Weight result = _divide(lhs, rhs) # <<<<<<<<<<<<<<
* result._check_weight()
* return result
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__divide(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__divide(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":533
+ /* "pywrapfst.pyx":537
* """
* cdef Weight result = _divide(lhs, rhs)
* result._check_weight() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_weight");
- __PYX_ERR(0, 533, __pyx_L1_error)
+ __PYX_ERR(0, 537, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_result->__pyx_vtab)->_check_weight(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 533, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_result->__pyx_vtab)->_check_weight(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 537, __pyx_L1_error)
- /* "pywrapfst.pyx":534
+ /* "pywrapfst.pyx":538
* cdef Weight result = _divide(lhs, rhs)
* result._check_weight()
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":510
+ /* "pywrapfst.pyx":514
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":537
+/* "pywrapfst.pyx":541
*
*
* cdef Weight _power(Weight w, size_t n): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_power", 0);
- /* "pywrapfst.pyx":538
+ /* "pywrapfst.pyx":542
*
* cdef Weight _power(Weight w, size_t n):
* cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* result._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
* return result
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 538, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 542, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":539
+ /* "pywrapfst.pyx":543
* cdef Weight _power(Weight w, size_t n):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 539, __pyx_L1_error)
+ __PYX_ERR(0, 543, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_w) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 539, __pyx_L1_error)
+ __PYX_ERR(0, 543, __pyx_L1_error)
}
__pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::Power((*__pyx_v_w->_weight), __pyx_v_n)));
- /* "pywrapfst.pyx":540
+ /* "pywrapfst.pyx":544
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":537
+ /* "pywrapfst.pyx":541
*
*
* cdef Weight _power(Weight w, size_t n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":543
+/* "pywrapfst.pyx":547
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, 1); __PYX_ERR(0, 543, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, 1); __PYX_ERR(0, 547, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "power") < 0)) __PYX_ERR(0, 543, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "power") < 0)) __PYX_ERR(0, 547, __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_w = ((struct __pyx_obj_9pywrapfst_Weight *)values[0]);
- __pyx_v_n = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 543, __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, 547, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 543, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.power", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_9pywrapfst_Weight, 1, "w", 0))) __PYX_ERR(0, 543, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_9pywrapfst_Weight, 1, "w", 0))) __PYX_ERR(0, 547, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_6power(__pyx_self, __pyx_v_w, __pyx_v_n);
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("power", 0);
- /* "pywrapfst.pyx":560
+ /* "pywrapfst.pyx":564
* FstUnknownWeightTypeError: weights are null or not in the same semiring.
* """
* cdef Weight result = _power(w, n) # <<<<<<<<<<<<<<
* result._check_weight()
* return result
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__power(__pyx_v_w, __pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__power(__pyx_v_w, __pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":561
+ /* "pywrapfst.pyx":565
* """
* cdef Weight result = _power(w, n)
* result._check_weight() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_weight");
- __PYX_ERR(0, 561, __pyx_L1_error)
+ __PYX_ERR(0, 565, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_result->__pyx_vtab)->_check_weight(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 561, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_result->__pyx_vtab)->_check_weight(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 565, __pyx_L1_error)
- /* "pywrapfst.pyx":562
+ /* "pywrapfst.pyx":566
* cdef Weight result = _power(w, n)
* result._check_weight()
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":543
+ /* "pywrapfst.pyx":547
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":565
+/* "pywrapfst.pyx":569
*
*
* cdef fst.WeightClass _get_WeightClass_or_Zero(const string &weight_type, # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("_get_WeightClass_or_Zero", 0);
- /* "pywrapfst.pyx":583
+ /* "pywrapfst.pyx":587
* """
* cdef fst.WeightClass result
* if weight is None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":584
+ /* "pywrapfst.pyx":588
* cdef fst.WeightClass result
* if weight is None:
* result = fst.WeightClass.Zero(weight_type) # <<<<<<<<<<<<<<
*/
__pyx_v_result = fst::script::WeightClass::Zero(__pyx_v_weight_type);
- /* "pywrapfst.pyx":583
+ /* "pywrapfst.pyx":587
* """
* cdef fst.WeightClass result
* if weight is None: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":585
+ /* "pywrapfst.pyx":589
* if weight is None:
* result = fst.WeightClass.Zero(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":586
+ /* "pywrapfst.pyx":590
* result = fst.WeightClass.Zero(weight_type)
* elif isinstance(weight, Weight):
* result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(__pyx_v_weight == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 586, __pyx_L1_error)
+ __PYX_ERR(0, 590, __pyx_L1_error)
}
__pyx_v_result = (*((fst::script::WeightClass *)((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));
- /* "pywrapfst.pyx":585
+ /* "pywrapfst.pyx":589
* if weight is None:
* result = fst.WeightClass.Zero(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":588
+ /* "pywrapfst.pyx":592
* result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
* else:
* result = fst.WeightClass(weight_type, weighttostring(weight)) # <<<<<<<<<<<<<<
* raise FstBadWeightError(weighttostring(weight))
*/
/*else*/ {
- __pyx_t_3 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 592, __pyx_L1_error)
__pyx_v_result = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);
- /* "pywrapfst.pyx":589
+ /* "pywrapfst.pyx":593
* else:
* result = fst.WeightClass(weight_type, weighttostring(weight))
* if result.ToString() == b"BadNumber": # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_result.ToString() == ((char *)"BadNumber")) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":590
+ /* "pywrapfst.pyx":594
* result = fst.WeightClass(weight_type, weighttostring(weight))
* if result.ToString() == b"BadNumber":
* raise FstBadWeightError(weighttostring(weight)) # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error)
- __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 594, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 590, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 594, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 590, __pyx_L1_error)
+ __PYX_ERR(0, 594, __pyx_L1_error)
- /* "pywrapfst.pyx":589
+ /* "pywrapfst.pyx":593
* else:
* result = fst.WeightClass(weight_type, weighttostring(weight))
* if result.ToString() == b"BadNumber": # <<<<<<<<<<<<<<
}
__pyx_L3:;
- /* "pywrapfst.pyx":591
+ /* "pywrapfst.pyx":595
* if result.ToString() == b"BadNumber":
* raise FstBadWeightError(weighttostring(weight))
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":565
+ /* "pywrapfst.pyx":569
*
*
* cdef fst.WeightClass _get_WeightClass_or_Zero(const string &weight_type, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":594
+/* "pywrapfst.pyx":598
*
*
* cdef fst.WeightClass _get_WeightClass_or_One(const string &weight_type, # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("_get_WeightClass_or_One", 0);
- /* "pywrapfst.pyx":612
+ /* "pywrapfst.pyx":616
* """
* cdef fst.WeightClass result
* if weight is None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":613
+ /* "pywrapfst.pyx":617
* cdef fst.WeightClass result
* if weight is None:
* result = fst.WeightClass.One(weight_type) # <<<<<<<<<<<<<<
*/
__pyx_v_result = fst::script::WeightClass::One(__pyx_v_weight_type);
- /* "pywrapfst.pyx":612
+ /* "pywrapfst.pyx":616
* """
* cdef fst.WeightClass result
* if weight is None: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":614
+ /* "pywrapfst.pyx":618
* if weight is None:
* result = fst.WeightClass.One(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":615
+ /* "pywrapfst.pyx":619
* result = fst.WeightClass.One(weight_type)
* elif isinstance(weight, Weight):
* result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(__pyx_v_weight == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 615, __pyx_L1_error)
+ __PYX_ERR(0, 619, __pyx_L1_error)
}
__pyx_v_result = (*((fst::script::WeightClass *)((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));
- /* "pywrapfst.pyx":614
+ /* "pywrapfst.pyx":618
* if weight is None:
* result = fst.WeightClass.One(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":617
+ /* "pywrapfst.pyx":621
* result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
* else:
* result = fst.WeightClass(weight_type, weighttostring(weight)) # <<<<<<<<<<<<<<
* raise FstBadWeightError(weighttostring(weight))
*/
/*else*/ {
- __pyx_t_3 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 617, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 621, __pyx_L1_error)
__pyx_v_result = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);
- /* "pywrapfst.pyx":618
+ /* "pywrapfst.pyx":622
* else:
* result = fst.WeightClass(weight_type, weighttostring(weight))
* if result.ToString() == b"BadNumber": # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_result.ToString() == ((char *)"BadNumber")) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":619
+ /* "pywrapfst.pyx":623
* result = fst.WeightClass(weight_type, weighttostring(weight))
* if result.ToString() == b"BadNumber":
* raise FstBadWeightError(weighttostring(weight)) # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 619, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L1_error)
- __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 619, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 619, __pyx_L1_error)
+ __PYX_ERR(0, 623, __pyx_L1_error)
- /* "pywrapfst.pyx":618
+ /* "pywrapfst.pyx":622
* else:
* result = fst.WeightClass(weight_type, weighttostring(weight))
* if result.ToString() == b"BadNumber": # <<<<<<<<<<<<<<
}
__pyx_L3:;
- /* "pywrapfst.pyx":620
+ /* "pywrapfst.pyx":624
* if result.ToString() == b"BadNumber":
* raise FstBadWeightError(weighttostring(weight))
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":594
+ /* "pywrapfst.pyx":598
*
*
* cdef fst.WeightClass _get_WeightClass_or_One(const string &weight_type, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":623
+/* "pywrapfst.pyx":627
*
*
* cdef Weight _Weight_Zero(weight_type): # <<<<<<<<<<<<<<
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("_Weight_Zero", 0);
- /* "pywrapfst.pyx":624
+ /* "pywrapfst.pyx":628
*
* cdef Weight _Weight_Zero(weight_type):
* cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
* tostring(weight_type))))
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 624, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 628, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":625
+ /* "pywrapfst.pyx":629
* cdef Weight _Weight_Zero(weight_type):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero( # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 625, __pyx_L1_error)
+ __PYX_ERR(0, 629, __pyx_L1_error)
}
- /* "pywrapfst.pyx":626
+ /* "pywrapfst.pyx":630
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
* tostring(weight_type)))) # <<<<<<<<<<<<<<
* if result._weight.get().Type() == b"none":
* raise FstUnknownWeightTypeError(weight_type)
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L1_error)
- /* "pywrapfst.pyx":625
+ /* "pywrapfst.pyx":629
* cdef Weight _Weight_Zero(weight_type):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero( # <<<<<<<<<<<<<<
*/
__pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::Zero(__pyx_t_2)));
- /* "pywrapfst.pyx":627
+ /* "pywrapfst.pyx":631
* result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
* tostring(weight_type))))
* if result._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 627, __pyx_L1_error)
+ __PYX_ERR(0, 631, __pyx_L1_error)
}
__pyx_t_3 = ((__pyx_v_result->_weight.get()->Type() == ((char *)"none")) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":628
+ /* "pywrapfst.pyx":632
* tostring(weight_type))))
* if result._weight.get().Type() == b"none":
* raise FstUnknownWeightTypeError(weight_type) # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstUnknownWeightTypeError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstUnknownWeightTypeError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
}
}
if (!__pyx_t_5) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_weight_type};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_weight_type};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 628, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_INCREF(__pyx_v_weight_type);
__Pyx_GIVEREF(__pyx_v_weight_type);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_weight_type);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 628, __pyx_L1_error)
+ __PYX_ERR(0, 632, __pyx_L1_error)
- /* "pywrapfst.pyx":627
+ /* "pywrapfst.pyx":631
* result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
* tostring(weight_type))))
* if result._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":629
+ /* "pywrapfst.pyx":633
* if result._weight.get().Type() == b"none":
* raise FstUnknownWeightTypeError(weight_type)
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":623
+ /* "pywrapfst.pyx":627
*
*
* cdef Weight _Weight_Zero(weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":632
+/* "pywrapfst.pyx":636
*
*
* cdef Weight _Weight_One(weight_type): # <<<<<<<<<<<<<<
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("_Weight_One", 0);
- /* "pywrapfst.pyx":633
+ /* "pywrapfst.pyx":637
*
* cdef Weight _Weight_One(weight_type):
* cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* result._weight.reset(new fst.WeightClass(
* fst.WeightClass.One(tostring(weight_type))))
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 633, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 637, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":634
+ /* "pywrapfst.pyx":638
* cdef Weight _Weight_One(weight_type):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass( # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 634, __pyx_L1_error)
+ __PYX_ERR(0, 638, __pyx_L1_error)
}
- /* "pywrapfst.pyx":635
+ /* "pywrapfst.pyx":639
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(
* fst.WeightClass.One(tostring(weight_type)))) # <<<<<<<<<<<<<<
* if result._weight.get().Type() == b"none":
* raise FstUnknownWeightTypeError(weight_type)
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 635, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L1_error)
- /* "pywrapfst.pyx":634
+ /* "pywrapfst.pyx":638
* cdef Weight _Weight_One(weight_type):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass( # <<<<<<<<<<<<<<
*/
__pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::One(__pyx_t_2)));
- /* "pywrapfst.pyx":636
+ /* "pywrapfst.pyx":640
* result._weight.reset(new fst.WeightClass(
* fst.WeightClass.One(tostring(weight_type))))
* if result._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 636, __pyx_L1_error)
+ __PYX_ERR(0, 640, __pyx_L1_error)
}
__pyx_t_3 = ((__pyx_v_result->_weight.get()->Type() == ((char *)"none")) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":637
+ /* "pywrapfst.pyx":641
* fst.WeightClass.One(tostring(weight_type))))
* if result._weight.get().Type() == b"none":
* raise FstUnknownWeightTypeError(weight_type) # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstUnknownWeightTypeError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstUnknownWeightTypeError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
}
}
if (!__pyx_t_5) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_weight_type};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_weight_type};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_INCREF(__pyx_v_weight_type);
__Pyx_GIVEREF(__pyx_v_weight_type);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_weight_type);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 637, __pyx_L1_error)
+ __PYX_ERR(0, 641, __pyx_L1_error)
- /* "pywrapfst.pyx":636
+ /* "pywrapfst.pyx":640
* result._weight.reset(new fst.WeightClass(
* fst.WeightClass.One(tostring(weight_type))))
* if result._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":638
+ /* "pywrapfst.pyx":642
* if result._weight.get().Type() == b"none":
* raise FstUnknownWeightTypeError(weight_type)
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":632
+ /* "pywrapfst.pyx":636
*
*
* cdef Weight _Weight_One(weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":641
+/* "pywrapfst.pyx":645
*
*
* cdef Weight _Weight_NoWeight(weight_type): # <<<<<<<<<<<<<<
std::string __pyx_t_2;
__Pyx_RefNannySetupContext("_Weight_NoWeight", 0);
- /* "pywrapfst.pyx":642
+ /* "pywrapfst.pyx":646
*
* cdef Weight _Weight_NoWeight(weight_type):
* cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* result._weight.reset(new fst.WeightClass(
* fst.WeightClass.NoWeight(tostring(weight_type))))
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 642, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 646, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":643
+ /* "pywrapfst.pyx":647
* cdef Weight _Weight_NoWeight(weight_type):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass( # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 643, __pyx_L1_error)
+ __PYX_ERR(0, 647, __pyx_L1_error)
}
- /* "pywrapfst.pyx":644
+ /* "pywrapfst.pyx":648
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass(
* fst.WeightClass.NoWeight(tostring(weight_type)))) # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error)
- /* "pywrapfst.pyx":643
+ /* "pywrapfst.pyx":647
* cdef Weight _Weight_NoWeight(weight_type):
* cdef Weight result = Weight.__new__(Weight)
* result._weight.reset(new fst.WeightClass( # <<<<<<<<<<<<<<
*/
__pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::NoWeight(__pyx_t_2)));
- /* "pywrapfst.pyx":645
+ /* "pywrapfst.pyx":649
* result._weight.reset(new fst.WeightClass(
* fst.WeightClass.NoWeight(tostring(weight_type))))
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":641
+ /* "pywrapfst.pyx":645
*
*
* cdef Weight _Weight_NoWeight(weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":679
+/* "pywrapfst.pyx":683
* # Doing so will allow undefined behavior.
*
* def __init__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":680
+ /* "pywrapfst.pyx":684
*
* def __init__(self):
* raise FstDeletedConstructorError( # <<<<<<<<<<<<<<
* "Cannot construct {}".format(self.__class__.__name__))
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":681
+ /* "pywrapfst.pyx":685
* def __init__(self):
* raise FstDeletedConstructorError(
* "Cannot construct {}".format(self.__class__.__name__)) # <<<<<<<<<<<<<<
*
* def __iter__(self):
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __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, 681, __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, 685, __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, 681, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 685, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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[2] = {__pyx_t_4, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 684, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__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, 680, __pyx_L1_error)
+ __PYX_ERR(0, 684, __pyx_L1_error)
- /* "pywrapfst.pyx":679
+ /* "pywrapfst.pyx":683
* # Doing so will allow undefined behavior.
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":683
+/* "pywrapfst.pyx":687
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __iter__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":684
+ /* "pywrapfst.pyx":688
*
* def __iter__(self):
* return SymbolTableIterator(self) # <<<<<<<<<<<<<<
* cpdef int64 available_key(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_SymbolTableIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_SymbolTableIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":683
+ /* "pywrapfst.pyx":687
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":686
+/* "pywrapfst.pyx":690
* return SymbolTableIterator(self)
*
* cpdef int64 available_key(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_available_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_available_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_5available_key)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __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, 686, __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, 690, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":687
+ /* "pywrapfst.pyx":691
*
* cpdef int64 available_key(self):
* return self._table.AvailableKey() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 687, __pyx_L1_error)
+ __PYX_ERR(0, 691, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_table->AvailableKey();
goto __pyx_L0;
- /* "pywrapfst.pyx":686
+ /* "pywrapfst.pyx":690
* return SymbolTableIterator(self)
*
* cpdef int64 available_key(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("available_key", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_12_SymbolTable_available_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_12_SymbolTable_available_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":689
+/* "pywrapfst.pyx":693
* return self._table.AvailableKey()
*
* cpdef string checksum(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_7checksum)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __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, 689, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 693, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":690
+ /* "pywrapfst.pyx":694
*
* cpdef string checksum(self):
* return self._table.CheckSum() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 690, __pyx_L1_error)
+ __PYX_ERR(0, 694, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_table->CheckSum();
goto __pyx_L0;
- /* "pywrapfst.pyx":689
+ /* "pywrapfst.pyx":693
* return self._table.AvailableKey()
*
* cpdef string checksum(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("checksum", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12_SymbolTable_checksum(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12_SymbolTable_checksum(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":692
+/* "pywrapfst.pyx":696
* return self._table.CheckSum()
*
* cpdef SymbolTable copy(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __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, 696, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_9copy)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __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_SymbolTable))))) __PYX_ERR(0, 692, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_SymbolTable))))) __PYX_ERR(0, 696, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":698
+ /* "pywrapfst.pyx":702
* Returns a mutable copy of the SymbolTable.
* """
* return _init_SymbolTable(self._table.Copy()) # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 698, __pyx_L1_error)
+ __PYX_ERR(0, 702, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_self->_table->Copy())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_self->_table->Copy())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":692
+ /* "pywrapfst.pyx":696
* return self._table.CheckSum()
*
* cpdef SymbolTable copy(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("copy", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_12_SymbolTable_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_12_SymbolTable_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":700
+/* "pywrapfst.pyx":704
* return _init_SymbolTable(self._table.Copy())
*
* def find(self, key): # <<<<<<<<<<<<<<
PyObject *__pyx_t_12 = NULL;
__Pyx_RefNannySetupContext("find", 0);
- /* "pywrapfst.pyx":719
+ /* "pywrapfst.pyx":723
* KeyError: Key not found.
* """
* try: # <<<<<<<<<<<<<<
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
- /* "pywrapfst.pyx":720
+ /* "pywrapfst.pyx":724
* """
* try:
* result = self._table.FindIndex(tostring(key)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 720, __pyx_L3_error)
+ __PYX_ERR(0, 724, __pyx_L3_error)
}
- __pyx_t_4 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 720, __pyx_L3_error)
- __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_table->Find(__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 720, __pyx_L3_error)
+ __pyx_t_4 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 724, __pyx_L3_error)
+ __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_table->Find(__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_v_result = __pyx_t_5;
__pyx_t_5 = 0;
- /* "pywrapfst.pyx":721
+ /* "pywrapfst.pyx":725
* try:
* result = self._table.FindIndex(tostring(key))
* if result == -1: # <<<<<<<<<<<<<<
* raise KeyError(key)
* except FstArgError:
*/
- __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_v_result, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L3_error)
+ __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_v_result, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 725, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 721, __pyx_L3_error)
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 725, __pyx_L3_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
- /* "pywrapfst.pyx":722
+ /* "pywrapfst.pyx":726
* result = self._table.FindIndex(tostring(key))
* if result == -1:
* raise KeyError(key) # <<<<<<<<<<<<<<
* except FstArgError:
* result = self._table.FindSymbol(key)
*/
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L3_error)
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 726, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_key);
__Pyx_GIVEREF(__pyx_v_key);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __pyx_L3_error)
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __PYX_ERR(0, 722, __pyx_L3_error)
+ __PYX_ERR(0, 726, __pyx_L3_error)
- /* "pywrapfst.pyx":721
+ /* "pywrapfst.pyx":725
* try:
* result = self._table.FindIndex(tostring(key))
* if result == -1: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":719
+ /* "pywrapfst.pyx":723
* KeyError: Key not found.
* """
* try: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "pywrapfst.pyx":723
+ /* "pywrapfst.pyx":727
* if result == -1:
* raise KeyError(key)
* except FstArgError: # <<<<<<<<<<<<<<
* result = self._table.FindSymbol(key)
* if result == b"":
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 723, __pyx_L5_except_error)
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_8) {
__Pyx_AddTraceback("pywrapfst._SymbolTable.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(0, 723, __pyx_L5_except_error)
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(0, 727, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_9);
- /* "pywrapfst.pyx":724
+ /* "pywrapfst.pyx":728
* raise KeyError(key)
* except FstArgError:
* result = self._table.FindSymbol(key) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 724, __pyx_L5_except_error)
+ __PYX_ERR(0, 728, __pyx_L5_except_error)
}
- __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 724, __pyx_L5_except_error)
- __pyx_t_11 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->_table->Find(__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 724, __pyx_L5_except_error)
+ __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L5_except_error)
+ __pyx_t_11 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->_table->Find(__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 728, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_11);
__pyx_t_11 = 0;
- /* "pywrapfst.pyx":725
+ /* "pywrapfst.pyx":729
* except FstArgError:
* result = self._table.FindSymbol(key)
* if result == b"": # <<<<<<<<<<<<<<
* raise KeyError(key)
* return result
*/
- __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_v_result, __pyx_kp_b_, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 725, __pyx_L5_except_error)
+ __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_v_result, __pyx_kp_b_, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 729, __pyx_L5_except_error)
if (__pyx_t_6) {
- /* "pywrapfst.pyx":726
+ /* "pywrapfst.pyx":730
* result = self._table.FindSymbol(key)
* if result == b"":
* raise KeyError(key) # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 726, __pyx_L5_except_error)
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 730, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(__pyx_v_key);
__Pyx_GIVEREF(__pyx_v_key);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_key);
- __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 726, __pyx_L5_except_error)
+ __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 730, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_Raise(__pyx_t_12, 0, 0, 0);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __PYX_ERR(0, 726, __pyx_L5_except_error)
+ __PYX_ERR(0, 730, __pyx_L5_except_error)
- /* "pywrapfst.pyx":725
+ /* "pywrapfst.pyx":729
* except FstArgError:
* result = self._table.FindSymbol(key)
* if result == b"": # <<<<<<<<<<<<<<
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
- /* "pywrapfst.pyx":719
+ /* "pywrapfst.pyx":723
* KeyError: Key not found.
* """
* try: # <<<<<<<<<<<<<<
__pyx_L10_try_end:;
}
- /* "pywrapfst.pyx":727
+ /* "pywrapfst.pyx":731
* if result == b"":
* raise KeyError(key)
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":700
+ /* "pywrapfst.pyx":704
* return _init_SymbolTable(self._table.Copy())
*
* def find(self, key): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":729
+/* "pywrapfst.pyx":733
* return result
*
* cpdef bool member(self, key): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_member); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_member); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_13member)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 733, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 733, __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[2] = {__pyx_t_4, __pyx_v_key};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 733, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 733, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(__pyx_v_key);
__Pyx_GIVEREF(__pyx_v_key);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 733, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_6;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":745
+ /* "pywrapfst.pyx":749
* Whether or not the key is present (as a string or a index) in the table.
* """
* try: # <<<<<<<<<<<<<<
__Pyx_XGOTREF(__pyx_t_9);
/*try:*/ {
- /* "pywrapfst.pyx":746
+ /* "pywrapfst.pyx":750
* """
* try:
* return self._table.MemberSymbol(tostring(key)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 746, __pyx_L3_error)
+ __PYX_ERR(0, 750, __pyx_L3_error)
}
- __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 746, __pyx_L3_error)
+ __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L3_error)
__pyx_r = __pyx_v_self->_table->Member(__pyx_t_10);
goto __pyx_L7_try_return;
- /* "pywrapfst.pyx":745
+ /* "pywrapfst.pyx":749
* Whether or not the key is present (as a string or a index) in the table.
* """
* try: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":747
+ /* "pywrapfst.pyx":751
* try:
* return self._table.MemberSymbol(tostring(key))
* except FstArgError: # <<<<<<<<<<<<<<
* return self._table.MemberIndex(key)
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L5_except_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_11) {
__Pyx_AddTraceback("pywrapfst._SymbolTable.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 747, __pyx_L5_except_error)
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 751, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":748
+ /* "pywrapfst.pyx":752
* return self._table.MemberSymbol(tostring(key))
* except FstArgError:
* return self._table.MemberIndex(key) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 748, __pyx_L5_except_error)
+ __PYX_ERR(0, 752, __pyx_L5_except_error)
}
- __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L5_except_error)
+ __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 752, __pyx_L5_except_error)
__pyx_r = __pyx_v_self->_table->Member(__pyx_t_12);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
- /* "pywrapfst.pyx":745
+ /* "pywrapfst.pyx":749
* Whether or not the key is present (as a string or a index) in the table.
* """
* try: # <<<<<<<<<<<<<<
goto __pyx_L0;
}
- /* "pywrapfst.pyx":729
+ /* "pywrapfst.pyx":733
* return result
*
* cpdef bool member(self, key): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("member", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_12_SymbolTable_member(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_12_SymbolTable_member(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":750
+/* "pywrapfst.pyx":754
* return self._table.MemberIndex(key)
*
* def __contains__(self, key): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__contains__", 0);
- /* "pywrapfst.pyx":751
+ /* "pywrapfst.pyx":755
*
* def __contains__(self, key):
* return self.member(key) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "member");
- __PYX_ERR(0, 751, __pyx_L1_error)
+ __PYX_ERR(0, 755, __pyx_L1_error)
}
__pyx_r = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->member(__pyx_v_self, __pyx_v_key, 0);
goto __pyx_L0;
- /* "pywrapfst.pyx":750
+ /* "pywrapfst.pyx":754
* return self._table.MemberIndex(key)
*
* def __contains__(self, key): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":753
+/* "pywrapfst.pyx":757
* return self.member(key)
*
* cpdef int64 get_nth_key(self, ssize_t pos) except *: # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nth_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nth_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_17get_nth_key)) {
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error)
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 753, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_7;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":768
+ /* "pywrapfst.pyx":772
* KeyError: index not found.
* """
* cdef int64 result = self._table.GetNthKey(pos) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 768, __pyx_L1_error)
+ __PYX_ERR(0, 772, __pyx_L1_error)
}
__pyx_v_result = __pyx_v_self->_table->GetNthKey(__pyx_v_pos);
- /* "pywrapfst.pyx":769
+ /* "pywrapfst.pyx":773
* """
* cdef int64 result = self._table.GetNthKey(pos)
* if result == -1: # <<<<<<<<<<<<<<
__pyx_t_8 = ((__pyx_v_result == -1L) != 0);
if (__pyx_t_8) {
- /* "pywrapfst.pyx":770
+ /* "pywrapfst.pyx":774
* cdef int64 result = self._table.GetNthKey(pos)
* if result == -1:
* raise KeyError(pos) # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __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, 770, __pyx_L1_error)
+ __PYX_ERR(0, 774, __pyx_L1_error)
- /* "pywrapfst.pyx":769
+ /* "pywrapfst.pyx":773
* """
* cdef int64 result = self._table.GetNthKey(pos)
* if result == -1: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":771
+ /* "pywrapfst.pyx":775
* if result == -1:
* raise KeyError(pos)
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":753
+ /* "pywrapfst.pyx":757
* return self.member(key)
*
* cpdef int64 get_nth_key(self, ssize_t pos) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_nth_key (wrapper)", 0);
assert(__pyx_arg_pos); {
- __pyx_v_pos = PyInt_AsSsize_t(__pyx_arg_pos); if (unlikely((__pyx_v_pos == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L3_error)
+ __pyx_v_pos = PyInt_AsSsize_t(__pyx_arg_pos); if (unlikely((__pyx_v_pos == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 757, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("get_nth_key", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_12_SymbolTable_get_nth_key(__pyx_v_self, __pyx_v_pos, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_12_SymbolTable_get_nth_key(__pyx_v_self, __pyx_v_pos, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 757, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":773
+/* "pywrapfst.pyx":777
* return result
*
* cpdef string labeled_checksum(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_labeled_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_labeled_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_19labeled_checksum)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __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, 773, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 777, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":774
+ /* "pywrapfst.pyx":778
*
* cpdef string labeled_checksum(self):
* return self._table.LabeledCheckSum() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 774, __pyx_L1_error)
+ __PYX_ERR(0, 778, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_table->LabeledCheckSum();
goto __pyx_L0;
- /* "pywrapfst.pyx":773
+ /* "pywrapfst.pyx":777
* return result
*
* cpdef string labeled_checksum(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("labeled_checksum", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12_SymbolTable_labeled_checksum(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12_SymbolTable_labeled_checksum(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":776
+/* "pywrapfst.pyx":780
* return self._table.LabeledCheckSum()
*
* cpdef string name(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_21name)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __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, 776, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 780, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":777
+ /* "pywrapfst.pyx":781
*
* cpdef string name(self):
* return self._table.Name() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 777, __pyx_L1_error)
+ __PYX_ERR(0, 781, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_table->Name();
goto __pyx_L0;
- /* "pywrapfst.pyx":776
+ /* "pywrapfst.pyx":780
* return self._table.LabeledCheckSum()
*
* cpdef string name(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("name", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12_SymbolTable_name(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12_SymbolTable_name(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":779
+/* "pywrapfst.pyx":783
* return self._table.Name()
*
* cpdef size_t num_symbols(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_23num_symbols)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __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, 779, __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, 783, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":780
+ /* "pywrapfst.pyx":784
*
* cpdef size_t num_symbols(self):
* return self._table.NumSymbols() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 780, __pyx_L1_error)
+ __PYX_ERR(0, 784, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_table->NumSymbols();
goto __pyx_L0;
- /* "pywrapfst.pyx":779
+ /* "pywrapfst.pyx":783
* return self._table.Name()
*
* cpdef size_t num_symbols(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("num_symbols", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_9pywrapfst_12_SymbolTable_num_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_9pywrapfst_12_SymbolTable_num_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":782
+/* "pywrapfst.pyx":786
* return self._table.NumSymbols()
*
* cpdef void write(self, filename) except *: # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __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, 786, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_25write)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __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[2] = {__pyx_t_4, __pyx_v_filename};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 782, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 786, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(__pyx_v_filename);
__Pyx_GIVEREF(__pyx_v_filename);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_filename);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":796
+ /* "pywrapfst.pyx":800
* FstIOError: Write failed.
* """
* if not self._table.Write(tostring(filename)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 796, __pyx_L1_error)
+ __PYX_ERR(0, 800, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 800, __pyx_L1_error)
__pyx_t_7 = ((!(__pyx_v_self->_table->Write(__pyx_t_6) != 0)) != 0);
if (__pyx_t_7) {
- /* "pywrapfst.pyx":797
+ /* "pywrapfst.pyx":801
* """
* if not self._table.Write(tostring(filename)):
* raise FstIOError("Write failed: {!r}".format(filename)) # <<<<<<<<<<<<<<
*
* cpdef void write_text(self, filename) except *:
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 801, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
}
if (!__pyx_t_4) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 801, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(__pyx_v_filename);
__Pyx_GIVEREF(__pyx_v_filename);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_5) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __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[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __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_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 801, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 797, __pyx_L1_error)
+ __PYX_ERR(0, 801, __pyx_L1_error)
- /* "pywrapfst.pyx":796
+ /* "pywrapfst.pyx":800
* FstIOError: Write failed.
* """
* if not self._table.Write(tostring(filename)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":782
+ /* "pywrapfst.pyx":786
* return self._table.NumSymbols()
*
* cpdef void write(self, filename) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("write", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_12_SymbolTable_write(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 782, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L1_error)
+ __pyx_f_9pywrapfst_12_SymbolTable_write(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 786, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":799
+/* "pywrapfst.pyx":803
* raise FstIOError("Write failed: {!r}".format(filename))
*
* cpdef void write_text(self, filename) except *: # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 799, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_27write_text)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 799, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 799, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __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[2] = {__pyx_t_4, __pyx_v_filename};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 799, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 799, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 803, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(__pyx_v_filename);
__Pyx_GIVEREF(__pyx_v_filename);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_filename);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 799, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":813
+ /* "pywrapfst.pyx":817
* FstIOError: Write failed.
* """
* if not self._table.WriteText(tostring(filename)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 813, __pyx_L1_error)
+ __PYX_ERR(0, 817, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 813, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L1_error)
__pyx_t_7 = ((!(__pyx_v_self->_table->WriteText(__pyx_t_6) != 0)) != 0);
if (__pyx_t_7) {
- /* "pywrapfst.pyx":814
+ /* "pywrapfst.pyx":818
* """
* if not self._table.WriteText(tostring(filename)):
* raise FstIOError("Write failed: {!r}".format(filename)) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 814, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
}
if (!__pyx_t_4) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 814, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(__pyx_v_filename);
__Pyx_GIVEREF(__pyx_v_filename);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_5) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __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[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __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_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 814, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 814, __pyx_L1_error)
+ __PYX_ERR(0, 818, __pyx_L1_error)
- /* "pywrapfst.pyx":813
+ /* "pywrapfst.pyx":817
* FstIOError: Write failed.
* """
* if not self._table.WriteText(tostring(filename)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":799
+ /* "pywrapfst.pyx":803
* raise FstIOError("Write failed: {!r}".format(filename))
*
* cpdef void write_text(self, filename) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("write_text", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_12_SymbolTable_write_text(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 799, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 799, __pyx_L1_error)
+ __pyx_f_9pywrapfst_12_SymbolTable_write_text(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 803, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":832
+/* "pywrapfst.pyx":836
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":833
+ /* "pywrapfst.pyx":837
*
* def __repr__(self):
* return "<const EncodeMapper SymbolTable {!r} at 0x{:x}>".format(self.name(), # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_const_EncodeMapper_SymbolTable, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_const_EncodeMapper_SymbolTable, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __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 '%s'", "name");
- __PYX_ERR(0, 833, __pyx_L1_error)
+ __PYX_ERR(0, 837, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":834
+ /* "pywrapfst.pyx":838
* def __repr__(self):
* return "<const EncodeMapper SymbolTable {!r} at 0x{:x}>".format(self.name(),
* id(self)) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 834, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
- __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, 833, __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, 837, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_t_3, __pyx_t_5};
- __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, 833, __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, 837, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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, 833, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 837, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __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":832
+ /* "pywrapfst.pyx":836
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":851
+/* "pywrapfst.pyx":855
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":852
+ /* "pywrapfst.pyx":856
*
* def __repr__(self):
* return "<const Fst SymbolTable {!r} at 0x{:x}>".format(self.name(), # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_const_Fst_SymbolTable_r_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_const_Fst_SymbolTable_r_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __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 '%s'", "name");
- __PYX_ERR(0, 852, __pyx_L1_error)
+ __PYX_ERR(0, 856, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__FstSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__FstSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":853
+ /* "pywrapfst.pyx":857
* def __repr__(self):
* return "<const Fst SymbolTable {!r} at 0x{:x}>".format(self.name(),
* id(self)) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 853, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
- __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, 852, __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, 856, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_t_3, __pyx_t_5};
- __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, 852, __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, 856, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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, 852, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 856, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __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":851
+ /* "pywrapfst.pyx":855
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":867
+/* "pywrapfst.pyx":871
* """
*
* cpdef int64 add_symbol(self, symbol, int64 key=-1): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol)) {
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __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_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_symbol, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_symbol, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__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, 867, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 871, __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;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 867, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_8;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":883
+ /* "pywrapfst.pyx":887
* The integer key of the new symbol.
* """
* cdef symbol_string = tostring(symbol) # <<<<<<<<<<<<<<
* if key != -1:
* return self._table.AddSymbol(symbol_string, key)
*/
- __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_symbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error)
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error)
+ __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_symbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_symbol_string = __pyx_t_1;
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":884
+ /* "pywrapfst.pyx":888
* """
* cdef symbol_string = tostring(symbol)
* if key != -1: # <<<<<<<<<<<<<<
__pyx_t_10 = ((__pyx_v_key != -1L) != 0);
if (__pyx_t_10) {
- /* "pywrapfst.pyx":885
+ /* "pywrapfst.pyx":889
* cdef symbol_string = tostring(symbol)
* if key != -1:
* return self._table.AddSymbol(symbol_string, key) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 885, __pyx_L1_error)
+ __PYX_ERR(0, 889, __pyx_L1_error)
}
- __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_v_symbol_string); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error)
+ __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_v_symbol_string); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error)
__pyx_r = __pyx_v_self->__pyx_base._table->AddSymbol(__pyx_t_9, __pyx_v_key);
goto __pyx_L0;
- /* "pywrapfst.pyx":884
+ /* "pywrapfst.pyx":888
* """
* cdef symbol_string = tostring(symbol)
* if key != -1: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":887
+ /* "pywrapfst.pyx":891
* return self._table.AddSymbol(symbol_string, key)
* else:
* return self._table.AddSymbol(symbol_string) # <<<<<<<<<<<<<<
/*else*/ {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 887, __pyx_L1_error)
+ __PYX_ERR(0, 891, __pyx_L1_error)
}
- __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_v_symbol_string); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L1_error)
+ __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_v_symbol_string); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 891, __pyx_L1_error)
__pyx_r = __pyx_v_self->__pyx_base._table->AddSymbol(__pyx_t_9);
goto __pyx_L0;
}
- /* "pywrapfst.pyx":867
+ /* "pywrapfst.pyx":871
* """
*
* cpdef int64 add_symbol(self, symbol, int64 key=-1): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symbol") < 0)) __PYX_ERR(0, 867, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symbol") < 0)) __PYX_ERR(0, 871, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_symbol = values[0];
if (values[1]) {
- __pyx_v_key = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_key == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 867, __pyx_L3_error)
+ __pyx_v_key = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_key == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L3_error)
} else {
__pyx_v_key = ((__pyx_t_10basictypes_int64)-1L);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("add_symbol", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 867, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add_symbol", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 871, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableSymbolTable.add_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.key = __pyx_v_key;
__pyx_t_1 = __pyx_vtabptr_9pywrapfst__MutableSymbolTable->add_symbol(__pyx_v_self, __pyx_v_symbol, 1, &__pyx_t_2);
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":889
+/* "pywrapfst.pyx":893
* return self._table.AddSymbol(symbol_string)
*
* cpdef void add_table(self, _SymbolTable syms): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_syms)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_syms)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_syms)};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __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[2] = {__pyx_t_4, ((PyObject *)__pyx_v_syms)};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 889, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(((PyObject *)__pyx_v_syms));
__Pyx_GIVEREF(((PyObject *)__pyx_v_syms));
PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_syms));
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":901
+ /* "pywrapfst.pyx":905
* syms: A SymbolTable to be merged with the current table.
* """
* self._table.AddTable(deref(syms._table)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 901, __pyx_L1_error)
+ __PYX_ERR(0, 905, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 901, __pyx_L1_error)
+ __PYX_ERR(0, 905, __pyx_L1_error)
}
__pyx_v_self->__pyx_base._table->AddTable((*__pyx_v_syms->_table));
- /* "pywrapfst.pyx":889
+ /* "pywrapfst.pyx":893
* return self._table.AddSymbol(symbol_string)
*
* cpdef void add_table(self, _SymbolTable syms): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_table (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 889, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 893, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_19_MutableSymbolTable_2add_table(((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("add_table", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(__pyx_v_self, __pyx_v_syms, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(__pyx_v_self, __pyx_v_syms, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":903
+/* "pywrapfst.pyx":907
* self._table.AddTable(deref(syms._table))
*
* cpdef void set_name(self, new_name) except *: # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19_MutableSymbolTable_5set_name)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_new_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_new_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_new_name};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __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[2] = {__pyx_t_4, __pyx_v_new_name};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 903, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(__pyx_v_new_name);
__Pyx_GIVEREF(__pyx_v_new_name);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_new_name);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":904
+ /* "pywrapfst.pyx":908
*
* cpdef void set_name(self, new_name) except *:
* self._table.SetName(tostring(new_name)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 904, __pyx_L1_error)
+ __PYX_ERR(0, 908, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_new_name, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_new_name, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 908, __pyx_L1_error)
__pyx_v_self->__pyx_base._table->SetName(__pyx_t_6);
- /* "pywrapfst.pyx":903
+ /* "pywrapfst.pyx":907
* self._table.AddTable(deref(syms._table))
*
* cpdef void set_name(self, new_name) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("set_name", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_19_MutableSymbolTable_set_name(__pyx_v_self, __pyx_v_new_name, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 903, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error)
+ __pyx_f_9pywrapfst_19_MutableSymbolTable_set_name(__pyx_v_self, __pyx_v_new_name, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 907, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":923
+/* "pywrapfst.pyx":927
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":924
+ /* "pywrapfst.pyx":928
*
* def __repr__(self):
* return "<Fst SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self)) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Fst_SymbolTable_r_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Fst_SymbolTable_r_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 928, __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 '%s'", "name");
- __PYX_ERR(0, 924, __pyx_L1_error)
+ __PYX_ERR(0, 928, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTable *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTable *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 924, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 928, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
- __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, 924, __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, 928, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_t_3, __pyx_t_5};
- __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, 924, __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, 928, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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, 924, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 928, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 928, __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":923
+ /* "pywrapfst.pyx":927
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":952
+/* "pywrapfst.pyx":956
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":953
+ /* "pywrapfst.pyx":957
*
* def __repr__(self):
* return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self)) # <<<<<<<<<<<<<<
* def __init__(self, name=b"<unspecified>"):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_SymbolTable_r_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_SymbolTable_r_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __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 '%s'", "name");
- __PYX_ERR(0, 953, __pyx_L1_error)
+ __PYX_ERR(0, 957, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 953, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 957, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 953, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 957, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 953, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 957, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
- __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, 953, __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, 957, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_t_3, __pyx_t_5};
- __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, 953, __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, 957, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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, 953, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 957, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __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":952
+ /* "pywrapfst.pyx":956
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":955
+/* "pywrapfst.pyx":959
* return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))
*
* def __init__(self, name=b"<unspecified>"): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 955, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 959, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 955, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 959, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.SymbolTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
std::string __pyx_t_1;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":956
+ /* "pywrapfst.pyx":960
*
* def __init__(self, name=b"<unspecified>"):
* self._table = new fst.SymbolTable(tostring(name)) # <<<<<<<<<<<<<<
* self._smart_table.reset(self._table)
*
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_name, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 956, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_name, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 960, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 956, __pyx_L1_error)
+ __PYX_ERR(0, 960, __pyx_L1_error)
}
__pyx_v_self->__pyx_base.__pyx_base._table = new fst::SymbolTable(__pyx_t_1);
- /* "pywrapfst.pyx":957
+ /* "pywrapfst.pyx":961
* def __init__(self, name=b"<unspecified>"):
* self._table = new fst.SymbolTable(tostring(name))
* self._smart_table.reset(self._table) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_smart_table");
- __PYX_ERR(0, 957, __pyx_L1_error)
+ __PYX_ERR(0, 961, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 957, __pyx_L1_error)
+ __PYX_ERR(0, 961, __pyx_L1_error)
}
__pyx_v_self->_smart_table.reset(__pyx_v_self->__pyx_base.__pyx_base._table);
- /* "pywrapfst.pyx":955
+ /* "pywrapfst.pyx":959
* return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))
*
* def __init__(self, name=b"<unspecified>"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":960
+/* "pywrapfst.pyx":964
*
* @classmethod
* def read(cls, filename): # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("read", 0);
- /* "pywrapfst.pyx":976
+ /* "pywrapfst.pyx":980
* See also: `SymbolTable.read_fst`, `SymbolTable.read_text`.
* """
* cdef fst.SymbolTable *tsyms = fst.SymbolTable.Read(tostring(filename)) # <<<<<<<<<<<<<<
* if tsyms == NULL:
* raise FstIOError("Read failed: {!r}".format(filename))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 980, __pyx_L1_error)
__pyx_v_tsyms = fst::SymbolTable::Read(__pyx_t_1);
- /* "pywrapfst.pyx":977
+ /* "pywrapfst.pyx":981
* """
* cdef fst.SymbolTable *tsyms = fst.SymbolTable.Read(tostring(filename))
* if tsyms == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_tsyms == NULL) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":978
+ /* "pywrapfst.pyx":982
* cdef fst.SymbolTable *tsyms = fst.SymbolTable.Read(tostring(filename))
* if tsyms == NULL:
* raise FstIOError("Read failed: {!r}".format(filename)) # <<<<<<<<<<<<<<
* return _init_SymbolTable(tsyms)
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 978, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 978, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(__pyx_v_filename);
__Pyx_GIVEREF(__pyx_v_filename);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_6) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 978, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 978, __pyx_L1_error)
+ __PYX_ERR(0, 982, __pyx_L1_error)
- /* "pywrapfst.pyx":977
+ /* "pywrapfst.pyx":981
* """
* cdef fst.SymbolTable *tsyms = fst.SymbolTable.Read(tostring(filename))
* if tsyms == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":979
+ /* "pywrapfst.pyx":983
* if tsyms == NULL:
* raise FstIOError("Read failed: {!r}".format(filename))
* return _init_SymbolTable(tsyms) # <<<<<<<<<<<<<<
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_tsyms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 979, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_tsyms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":960
+ /* "pywrapfst.pyx":964
*
* @classmethod
* def read(cls, filename): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":982
+/* "pywrapfst.pyx":986
*
* @classmethod
* def read_text(cls, filename, bool allow_negative_labels=False): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_text") < 0)) __PYX_ERR(0, 982, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_text") < 0)) __PYX_ERR(0, 986, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_filename = values[0];
if (values[1]) {
- __pyx_v_allow_negative_labels = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_allow_negative_labels == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 982, __pyx_L3_error)
+ __pyx_v_allow_negative_labels = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_allow_negative_labels == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 986, __pyx_L3_error)
} else {
__pyx_v_allow_negative_labels = ((bool)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("read_text", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 982, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_text", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 986, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.SymbolTable.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "pywrapfst.pyx":1001
+ /* "pywrapfst.pyx":1005
* """
* cdef unique_ptr[fst.SymbolTableTextOptions] opts
* opts.reset(new fst.SymbolTableTextOptions(allow_negative_labels)) # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::SymbolTableTextOptions(__pyx_v_allow_negative_labels));
- /* "pywrapfst.pyx":1002
+ /* "pywrapfst.pyx":1006
* cdef unique_ptr[fst.SymbolTableTextOptions] opts
* opts.reset(new fst.SymbolTableTextOptions(allow_negative_labels))
* cdef fst.SymbolTable *tsyms = fst.SymbolTable.ReadText(tostring(filename), # <<<<<<<<<<<<<<
* deref(opts))
* if tsyms == NULL:
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1002, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1006, __pyx_L1_error)
- /* "pywrapfst.pyx":1003
+ /* "pywrapfst.pyx":1007
* opts.reset(new fst.SymbolTableTextOptions(allow_negative_labels))
* cdef fst.SymbolTable *tsyms = fst.SymbolTable.ReadText(tostring(filename),
* deref(opts)) # <<<<<<<<<<<<<<
*/
__pyx_v_tsyms = fst::SymbolTable::ReadText(__pyx_t_1, (*__pyx_v_opts));
- /* "pywrapfst.pyx":1004
+ /* "pywrapfst.pyx":1008
* cdef fst.SymbolTable *tsyms = fst.SymbolTable.ReadText(tostring(filename),
* deref(opts))
* if tsyms == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_tsyms == NULL) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":1005
+ /* "pywrapfst.pyx":1009
* deref(opts))
* if tsyms == NULL:
* raise FstIOError("Read failed: {!r}".format(filename)) # <<<<<<<<<<<<<<
* return _init_SymbolTable(tsyms)
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1005, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1009, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1005, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1009, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1005, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1009, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(__pyx_v_filename);
__Pyx_GIVEREF(__pyx_v_filename);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_6) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1005, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1009, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 1005, __pyx_L1_error)
+ __PYX_ERR(0, 1009, __pyx_L1_error)
- /* "pywrapfst.pyx":1004
+ /* "pywrapfst.pyx":1008
* cdef fst.SymbolTable *tsyms = fst.SymbolTable.ReadText(tostring(filename),
* deref(opts))
* if tsyms == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1006
+ /* "pywrapfst.pyx":1010
* if tsyms == NULL:
* raise FstIOError("Read failed: {!r}".format(filename))
* return _init_SymbolTable(tsyms) # <<<<<<<<<<<<<<
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_tsyms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_tsyms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":982
+ /* "pywrapfst.pyx":986
*
* @classmethod
* def read_text(cls, filename, bool allow_negative_labels=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1009
+/* "pywrapfst.pyx":1013
*
* @classmethod
* def read_fst(cls, filename, bool input_table): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_table)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, 1); __PYX_ERR(0, 1009, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, 1); __PYX_ERR(0, 1013, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_fst") < 0)) __PYX_ERR(0, 1009, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_fst") < 0)) __PYX_ERR(0, 1013, __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_filename = values[0];
- __pyx_v_input_table = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_input_table == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L3_error)
+ __pyx_v_input_table = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_input_table == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1013, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1009, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1013, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.SymbolTable.read_fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("read_fst", 0);
- /* "pywrapfst.pyx":1031
+ /* "pywrapfst.pyx":1035
* See also: `SymbolTable.read`, `SymbolTable.read_text`.
* """
* cdef fst.SymbolTable *tsyms = fst.FstReadSymbols(filename, input_table) # <<<<<<<<<<<<<<
* if tsyms == NULL:
* raise FstIOError("Read failed: {!r}".format(filename))
*/
- __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_filename); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1031, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_filename); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1035, __pyx_L1_error)
__pyx_v_tsyms = fst::FstReadSymbols(__pyx_t_1, __pyx_v_input_table);
- /* "pywrapfst.pyx":1032
+ /* "pywrapfst.pyx":1036
* """
* cdef fst.SymbolTable *tsyms = fst.FstReadSymbols(filename, input_table)
* if tsyms == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_tsyms == NULL) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":1033
+ /* "pywrapfst.pyx":1037
* cdef fst.SymbolTable *tsyms = fst.FstReadSymbols(filename, input_table)
* if tsyms == NULL:
* raise FstIOError("Read failed: {!r}".format(filename)) # <<<<<<<<<<<<<<
* return _init_SymbolTable(tsyms)
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1037, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1037, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(__pyx_v_filename);
__Pyx_GIVEREF(__pyx_v_filename);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_6) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1037, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 1033, __pyx_L1_error)
+ __PYX_ERR(0, 1037, __pyx_L1_error)
- /* "pywrapfst.pyx":1032
+ /* "pywrapfst.pyx":1036
* """
* cdef fst.SymbolTable *tsyms = fst.FstReadSymbols(filename, input_table)
* if tsyms == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1034
+ /* "pywrapfst.pyx":1038
* if tsyms == NULL:
* raise FstIOError("Read failed: {!r}".format(filename))
* return _init_SymbolTable(tsyms) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_tsyms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1034, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_tsyms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1009
+ /* "pywrapfst.pyx":1013
*
* @classmethod
* def read_fst(cls, filename, bool input_table): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1037
+/* "pywrapfst.pyx":1041
*
*
* cdef _EncodeMapperSymbolTable _init_EncodeMapperSymbolTable( # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_init_EncodeMapperSymbolTable", 0);
- /* "pywrapfst.pyx":1040
+ /* "pywrapfst.pyx":1044
* fst.SymbolTable *table, shared_ptr[fst.EncodeMapperClass] encoder):
* cdef _EncodeMapperSymbolTable result = (
* _EncodeMapperSymbolTable.__new__(_EncodeMapperSymbolTable)) # <<<<<<<<<<<<<<
* result._table = table
* result._encoder = encoder
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst__EncodeMapperSymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst__EncodeMapperSymbolTable), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1040, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst__EncodeMapperSymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst__EncodeMapperSymbolTable), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTable)))) __PYX_ERR(0, 1040, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTable)))) __PYX_ERR(0, 1044, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1041
+ /* "pywrapfst.pyx":1045
* cdef _EncodeMapperSymbolTable result = (
* _EncodeMapperSymbolTable.__new__(_EncodeMapperSymbolTable))
* result._table = table # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1041, __pyx_L1_error)
+ __PYX_ERR(0, 1045, __pyx_L1_error)
}
__pyx_v_result->__pyx_base._table = __pyx_v_table;
- /* "pywrapfst.pyx":1042
+ /* "pywrapfst.pyx":1046
* _EncodeMapperSymbolTable.__new__(_EncodeMapperSymbolTable))
* result._table = table
* result._encoder = encoder # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1042, __pyx_L1_error)
+ __PYX_ERR(0, 1046, __pyx_L1_error)
}
__pyx_v_result->_encoder = __pyx_v_encoder;
- /* "pywrapfst.pyx":1043
+ /* "pywrapfst.pyx":1047
* result._table = table
* result._encoder = encoder
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1037
+ /* "pywrapfst.pyx":1041
*
*
* cdef _EncodeMapperSymbolTable _init_EncodeMapperSymbolTable( # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1045
+/* "pywrapfst.pyx":1049
* return result
*
* cdef _FstSymbolTable _init_FstSymbolTable(fst.SymbolTable *table, # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_init_FstSymbolTable", 0);
- /* "pywrapfst.pyx":1047
+ /* "pywrapfst.pyx":1051
* cdef _FstSymbolTable _init_FstSymbolTable(fst.SymbolTable *table,
* shared_ptr[fst.FstClass] ifst):
* cdef _FstSymbolTable result = _FstSymbolTable.__new__(_FstSymbolTable) # <<<<<<<<<<<<<<
* result._table = table
* result._fst = ifst
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst__FstSymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst__FstSymbolTable), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst__FstSymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst__FstSymbolTable), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1051, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__FstSymbolTable)))) __PYX_ERR(0, 1047, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__FstSymbolTable)))) __PYX_ERR(0, 1051, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1048
+ /* "pywrapfst.pyx":1052
* shared_ptr[fst.FstClass] ifst):
* cdef _FstSymbolTable result = _FstSymbolTable.__new__(_FstSymbolTable)
* result._table = table # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1048, __pyx_L1_error)
+ __PYX_ERR(0, 1052, __pyx_L1_error)
}
__pyx_v_result->__pyx_base._table = __pyx_v_table;
- /* "pywrapfst.pyx":1049
+ /* "pywrapfst.pyx":1053
* cdef _FstSymbolTable result = _FstSymbolTable.__new__(_FstSymbolTable)
* result._table = table
* result._fst = ifst # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1049, __pyx_L1_error)
+ __PYX_ERR(0, 1053, __pyx_L1_error)
}
__pyx_v_result->_fst = __pyx_v_ifst;
- /* "pywrapfst.pyx":1050
+ /* "pywrapfst.pyx":1054
* result._table = table
* result._fst = ifst
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1045
+ /* "pywrapfst.pyx":1049
* return result
*
* cdef _FstSymbolTable _init_FstSymbolTable(fst.SymbolTable *table, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1053
+/* "pywrapfst.pyx":1057
*
*
* cdef _MutableFstSymbolTable _init_MutableFstSymbolTable(fst.SymbolTable *table, # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_init_MutableFstSymbolTable", 0);
- /* "pywrapfst.pyx":1056
+ /* "pywrapfst.pyx":1060
* shared_ptr[fst.MutableFstClass] ifst):
* cdef _MutableFstSymbolTable result = (
* _MutableFstSymbolTable.__new__(_MutableFstSymbolTable)) # <<<<<<<<<<<<<<
* result._table = table
* result._mfst = ifst
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst__MutableFstSymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst__MutableFstSymbolTable), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1056, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst__MutableFstSymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst__MutableFstSymbolTable), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__MutableFstSymbolTable)))) __PYX_ERR(0, 1056, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__MutableFstSymbolTable)))) __PYX_ERR(0, 1060, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1057
+ /* "pywrapfst.pyx":1061
* cdef _MutableFstSymbolTable result = (
* _MutableFstSymbolTable.__new__(_MutableFstSymbolTable))
* result._table = table # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1057, __pyx_L1_error)
+ __PYX_ERR(0, 1061, __pyx_L1_error)
}
__pyx_v_result->__pyx_base.__pyx_base._table = __pyx_v_table;
- /* "pywrapfst.pyx":1058
+ /* "pywrapfst.pyx":1062
* _MutableFstSymbolTable.__new__(_MutableFstSymbolTable))
* result._table = table
* result._mfst = ifst # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 1058, __pyx_L1_error)
+ __PYX_ERR(0, 1062, __pyx_L1_error)
}
__pyx_v_result->_mfst = __pyx_v_ifst;
- /* "pywrapfst.pyx":1059
+ /* "pywrapfst.pyx":1063
* result._table = table
* result._mfst = ifst
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1053
+ /* "pywrapfst.pyx":1057
*
*
* cdef _MutableFstSymbolTable _init_MutableFstSymbolTable(fst.SymbolTable *table, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1062
+/* "pywrapfst.pyx":1066
*
*
* cdef SymbolTable _init_SymbolTable(fst.SymbolTable *table): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_init_SymbolTable", 0);
- /* "pywrapfst.pyx":1063
+ /* "pywrapfst.pyx":1067
*
* cdef SymbolTable _init_SymbolTable(fst.SymbolTable *table):
* cdef SymbolTable result = SymbolTable.__new__(SymbolTable) # <<<<<<<<<<<<<<
* result._table = table
* return result
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_SymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst_SymbolTable), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_SymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst_SymbolTable), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_SymbolTable)))) __PYX_ERR(0, 1063, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_SymbolTable)))) __PYX_ERR(0, 1067, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1064
+ /* "pywrapfst.pyx":1068
* cdef SymbolTable _init_SymbolTable(fst.SymbolTable *table):
* cdef SymbolTable result = SymbolTable.__new__(SymbolTable)
* result._table = table # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1064, __pyx_L1_error)
+ __PYX_ERR(0, 1068, __pyx_L1_error)
}
__pyx_v_result->__pyx_base.__pyx_base._table = __pyx_v_table;
- /* "pywrapfst.pyx":1065
+ /* "pywrapfst.pyx":1069
* cdef SymbolTable result = SymbolTable.__new__(SymbolTable)
* result._table = table
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1062
+ /* "pywrapfst.pyx":1066
*
*
* cdef SymbolTable _init_SymbolTable(fst.SymbolTable *table): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1071
+/* "pywrapfst.pyx":1075
*
*
* cpdef SymbolTable compact_symbol_table(_SymbolTable syms): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("compact_symbol_table", 0);
- /* "pywrapfst.pyx":1083
+ /* "pywrapfst.pyx":1087
* A new compacted SymbolTable.
* """
* return _init_SymbolTable(fst.CompactSymbolTable(deref(syms._table))) # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1083, __pyx_L1_error)
+ __PYX_ERR(0, 1087, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::CompactSymbolTable((*__pyx_v_syms->_table)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::CompactSymbolTable((*__pyx_v_syms->_table)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1087, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1071
+ /* "pywrapfst.pyx":1075
*
*
* cpdef SymbolTable compact_symbol_table(_SymbolTable syms): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("compact_symbol_table (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1071, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1075, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_8compact_symbol_table(__pyx_self, ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("compact_symbol_table", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_compact_symbol_table(__pyx_v_syms, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_compact_symbol_table(__pyx_v_syms, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1075, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1086
+/* "pywrapfst.pyx":1090
*
*
* cpdef SymbolTable merge_symbol_table(_SymbolTable lhs, _SymbolTable rhs): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("merge_symbol_table", 0);
- /* "pywrapfst.pyx":1110
+ /* "pywrapfst.pyx":1114
* See also: `relabel_symbols`.
* """
* return _init_SymbolTable(fst.MergeSymbolTable(deref(lhs._table), # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1110, __pyx_L1_error)
+ __PYX_ERR(0, 1114, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1111
+ /* "pywrapfst.pyx":1115
* """
* return _init_SymbolTable(fst.MergeSymbolTable(deref(lhs._table),
* deref(rhs._table), NULL)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1111, __pyx_L1_error)
+ __PYX_ERR(0, 1115, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1110
+ /* "pywrapfst.pyx":1114
* See also: `relabel_symbols`.
* """
* return _init_SymbolTable(fst.MergeSymbolTable(deref(lhs._table), # <<<<<<<<<<<<<<
* deref(rhs._table), NULL))
*
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::MergeSymbolTable((*__pyx_v_lhs->_table), (*__pyx_v_rhs->_table), NULL))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::MergeSymbolTable((*__pyx_v_lhs->_table), (*__pyx_v_rhs->_table), NULL))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1086
+ /* "pywrapfst.pyx":1090
*
*
* cpdef SymbolTable merge_symbol_table(_SymbolTable lhs, _SymbolTable rhs): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, 1); __PYX_ERR(0, 1086, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, 1); __PYX_ERR(0, 1090, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "merge_symbol_table") < 0)) __PYX_ERR(0, 1086, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "merge_symbol_table") < 0)) __PYX_ERR(0, 1090, __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("merge_symbol_table", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1086, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1090, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.merge_symbol_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst__SymbolTable, 1, "lhs", 0))) __PYX_ERR(0, 1086, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst__SymbolTable, 1, "rhs", 0))) __PYX_ERR(0, 1086, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst__SymbolTable, 1, "lhs", 0))) __PYX_ERR(0, 1090, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst__SymbolTable, 1, "rhs", 0))) __PYX_ERR(0, 1090, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_10merge_symbol_table(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("merge_symbol_table", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_merge_symbol_table(__pyx_v_lhs, __pyx_v_rhs, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_merge_symbol_table(__pyx_v_lhs, __pyx_v_rhs, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1090, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1128
+/* "pywrapfst.pyx":1132
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1129
+ /* "pywrapfst.pyx":1133
*
* def __repr__(self):
* return "<SymbolTableIterator at 0x{:x}>".format(id(self)) # <<<<<<<<<<<<<<
* def __init__(self, _SymbolTable syms):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_SymbolTableIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1129, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_SymbolTableIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
}
}
if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1129, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1128
+ /* "pywrapfst.pyx":1132
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1131
+/* "pywrapfst.pyx":1135
* return "<SymbolTableIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _SymbolTable syms): # <<<<<<<<<<<<<<
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, 1131, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1135, __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, 1131, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1135, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.SymbolTableIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1131, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1135, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_19SymbolTableIterator_2__init__(((struct __pyx_obj_9pywrapfst_SymbolTableIterator *)__pyx_v_self), __pyx_v_syms);
/* function exit code */
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":1132
+ /* "pywrapfst.pyx":1136
*
* def __init__(self, _SymbolTable syms):
* self._siter.reset(new fst.SymbolTableIterator(deref(syms._table))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
- __PYX_ERR(0, 1132, __pyx_L1_error)
+ __PYX_ERR(0, 1136, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1132, __pyx_L1_error)
+ __PYX_ERR(0, 1136, __pyx_L1_error)
}
__pyx_v_self->_siter.reset(new fst::SymbolTableIterator((*__pyx_v_syms->_table)));
- /* "pywrapfst.pyx":1131
+ /* "pywrapfst.pyx":1135
* return "<SymbolTableIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _SymbolTable syms): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1135
+/* "pywrapfst.pyx":1139
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":1136
+ /* "pywrapfst.pyx":1140
* # 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":1135
+ /* "pywrapfst.pyx":1139
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1139
+/* "pywrapfst.pyx":1143
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "pywrapfst.pyx":1140
+ /* "pywrapfst.pyx":1144
* # 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 '%s'", "done");
- __PYX_ERR(0, 1140, __pyx_L1_error)
+ __PYX_ERR(0, 1144, __pyx_L1_error)
}
__pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":1141
+ /* "pywrapfst.pyx":1145
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* cdef string symbol = self.symbol()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 1141, __pyx_L1_error)
+ __PYX_ERR(0, 1145, __pyx_L1_error)
- /* "pywrapfst.pyx":1140
+ /* "pywrapfst.pyx":1144
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1142
+ /* "pywrapfst.pyx":1146
* if self.done():
* raise StopIteration
* cdef int64 value = self.value() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "value");
- __PYX_ERR(0, 1142, __pyx_L1_error)
+ __PYX_ERR(0, 1146, __pyx_L1_error)
}
__pyx_v_value = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0);
- /* "pywrapfst.pyx":1143
+ /* "pywrapfst.pyx":1147
* raise StopIteration
* cdef int64 value = self.value()
* cdef string symbol = self.symbol() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "symbol");
- __PYX_ERR(0, 1143, __pyx_L1_error)
+ __PYX_ERR(0, 1147, __pyx_L1_error)
}
__pyx_v_symbol = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *)__pyx_v_self->__pyx_vtab)->symbol(__pyx_v_self, 0);
- /* "pywrapfst.pyx":1144
+ /* "pywrapfst.pyx":1148
* cdef int64 value = self.value()
* cdef string symbol = self.symbol()
* self.next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "next");
- __PYX_ERR(0, 1144, __pyx_L1_error)
+ __PYX_ERR(0, 1148, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":1145
+ /* "pywrapfst.pyx":1149
* cdef string symbol = self.symbol()
* self.next()
* return (value, symbol) # <<<<<<<<<<<<<<
* cpdef bool done(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_symbol); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1145, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_symbol); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1145, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1139
+ /* "pywrapfst.pyx":1143
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1147
+/* "pywrapfst.pyx":1151
* return (value, symbol)
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1147, __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, 1151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_9done)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1147, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1151, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1147, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1151, __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, 1147, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1151, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1159
+ /* "pywrapfst.pyx":1163
* 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 '%s'", "_siter");
- __PYX_ERR(0, 1159, __pyx_L1_error)
+ __PYX_ERR(0, 1163, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":1147
+ /* "pywrapfst.pyx":1151
* return (value, symbol)
*
* 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_19SymbolTableIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1147, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_19SymbolTableIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1161
+/* "pywrapfst.pyx":1165
* return self._siter.get().Done()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __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, 1165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_11next)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1161, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1161, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1170
+ /* "pywrapfst.pyx":1174
* should use the Pythonic API.
* """
* self._siter.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
- __PYX_ERR(0, 1170, __pyx_L1_error)
+ __PYX_ERR(0, 1174, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Next();
- /* "pywrapfst.pyx":1161
+ /* "pywrapfst.pyx":1165
* 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_19SymbolTableIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_19SymbolTableIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1172
+/* "pywrapfst.pyx":1176
* self._siter.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __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, 1176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_13reset)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1181
+ /* "pywrapfst.pyx":1185
* should use the Pythonic API.
* """
* self._siter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
- __PYX_ERR(0, 1181, __pyx_L1_error)
+ __PYX_ERR(0, 1185, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Reset();
- /* "pywrapfst.pyx":1172
+ /* "pywrapfst.pyx":1176
* 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_19SymbolTableIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_19SymbolTableIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1183
+/* "pywrapfst.pyx":1187
* self._siter.get().Reset()
*
* cpdef string symbol(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1183, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_15symbol)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __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, 1183, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1187, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1197
+ /* "pywrapfst.pyx":1201
* A symbol string.
* """
* return self._siter.get().Symbol() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
- __PYX_ERR(0, 1197, __pyx_L1_error)
+ __PYX_ERR(0, 1201, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Symbol();
goto __pyx_L0;
- /* "pywrapfst.pyx":1183
+ /* "pywrapfst.pyx":1187
* self._siter.get().Reset()
*
* cpdef string symbol(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("symbol", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_19SymbolTableIterator_symbol(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1183, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_19SymbolTableIterator_symbol(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1199
+/* "pywrapfst.pyx":1203
* return self._siter.get().Symbol()
*
* cpdef int64 value(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1199, __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, 1203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_17value)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1199, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1199, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __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, 1199, __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, 1203, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1211
+ /* "pywrapfst.pyx":1215
* An integer index.
* """
* return self._siter.get().Value() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
- __PYX_ERR(0, 1211, __pyx_L1_error)
+ __PYX_ERR(0, 1215, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Value();
goto __pyx_L0;
- /* "pywrapfst.pyx":1199
+ /* "pywrapfst.pyx":1203
* return self._siter.get().Symbol()
*
* 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_19SymbolTableIterator_value(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1199, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_19SymbolTableIterator_value(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1240
+/* "pywrapfst.pyx":1244
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1241
+ /* "pywrapfst.pyx":1245
*
* def __repr__(self):
* return "<EncodeMapper at 0x{:x}>".format(id(self)) # <<<<<<<<<<<<<<
* def __init__(self,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_EncodeMapper_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1241, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_EncodeMapper_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1241, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
}
}
if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1241, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1240
+ /* "pywrapfst.pyx":1244
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1243
+/* "pywrapfst.pyx":1247
* return "<EncodeMapper at 0x{:x}>".format(id(self))
*
* def __init__(self, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1243, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1247, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_arc_type = values[0];
if (values[1]) {
- __pyx_v_encode_labels = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_encode_labels == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L3_error)
+ __pyx_v_encode_labels = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_encode_labels == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1249, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1245
+ /* "pywrapfst.pyx":1249
* def __init__(self,
* arc_type=b"standard",
* bool encode_labels=False, # <<<<<<<<<<<<<<
__pyx_v_encode_labels = ((bool)0);
}
if (values[2]) {
- __pyx_v_encode_weights = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_encode_weights == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1246, __pyx_L3_error)
+ __pyx_v_encode_weights = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_encode_weights == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1250, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1246
+ /* "pywrapfst.pyx":1250
* arc_type=b"standard",
* bool encode_labels=False,
* bool encode_weights=False): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1243, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1247, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.EncodeMapper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_2__init__(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), __pyx_v_arc_type, __pyx_v_encode_labels, __pyx_v_encode_weights);
- /* "pywrapfst.pyx":1243
+ /* "pywrapfst.pyx":1247
* return "<EncodeMapper at 0x{:x}>".format(id(self))
*
* def __init__(self, # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":1247
+ /* "pywrapfst.pyx":1251
* bool encode_labels=False,
* bool encode_weights=False):
* cdef uint32 flags = fst.GetEncodeFlags(encode_labels, encode_weights) # <<<<<<<<<<<<<<
*/
__pyx_v_flags = fst::script::GetEncodeFlags(__pyx_v_encode_labels, __pyx_v_encode_weights);
- /* "pywrapfst.pyx":1248
+ /* "pywrapfst.pyx":1252
* bool encode_weights=False):
* cdef uint32 flags = fst.GetEncodeFlags(encode_labels, encode_weights)
* self._encoder.reset(new fst.EncodeMapperClass(tostring(arc_type), flags, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1248, __pyx_L1_error)
+ __PYX_ERR(0, 1252, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1248, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1252, __pyx_L1_error)
- /* "pywrapfst.pyx":1249
+ /* "pywrapfst.pyx":1253
* cdef uint32 flags = fst.GetEncodeFlags(encode_labels, encode_weights)
* self._encoder.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
* fst.ENCODE)) # <<<<<<<<<<<<<<
*/
__pyx_v_self->_encoder.reset(new fst::script::EncodeMapperClass(__pyx_t_1, __pyx_v_flags, fst::ENCODE));
- /* "pywrapfst.pyx":1250
+ /* "pywrapfst.pyx":1254
* self._encoder.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
* fst.ENCODE))
* if not self._encoder: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1250, __pyx_L1_error)
+ __PYX_ERR(0, 1254, __pyx_L1_error)
}
__pyx_t_2 = ((!__pyx_v_self->_encoder) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":1251
+ /* "pywrapfst.pyx":1255
* fst.ENCODE))
* if not self._encoder:
* raise FstOpError("Unknown arc type: {!r}".format(arc_type)) # <<<<<<<<<<<<<<
*
* cpdef string arc_type(self):
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_arc_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_arc_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_arc_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_arc_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_arc_type};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_arc_type};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(__pyx_v_arc_type);
__Pyx_GIVEREF(__pyx_v_arc_type);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_arc_type);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_6) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1251, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1251, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1251, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1251, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 1251, __pyx_L1_error)
+ __PYX_ERR(0, 1255, __pyx_L1_error)
- /* "pywrapfst.pyx":1250
+ /* "pywrapfst.pyx":1254
* self._encoder.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
* fst.ENCODE))
* if not self._encoder: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1243
+ /* "pywrapfst.pyx":1247
* return "<EncodeMapper at 0x{:x}>".format(id(self))
*
* def __init__(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1253
+/* "pywrapfst.pyx":1257
* raise FstOpError("Unknown arc type: {!r}".format(arc_type))
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __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, 1257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_5arc_type)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1253, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1257, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1253, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1257, __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, 1253, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1257, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1254
+ /* "pywrapfst.pyx":1258
*
* cpdef string arc_type(self):
* return self._encoder.get().ArcType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1254, __pyx_L1_error)
+ __PYX_ERR(0, 1258, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_encoder.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1253
+ /* "pywrapfst.pyx":1257
* raise FstOpError("Unknown arc type: {!r}".format(arc_type))
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("arc_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12EncodeMapper_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12EncodeMapper_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1258
+/* "pywrapfst.pyx":1262
* # Python's equivalent to operator().
*
* def __call__(self, Arc arc): # <<<<<<<<<<<<<<
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 1258, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 1262, __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("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1258, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1262, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.EncodeMapper.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1258, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1262, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_6__call__(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), __pyx_v_arc);
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__call__", 0);
- /* "pywrapfst.pyx":1274
+ /* "pywrapfst.pyx":1278
* FstOpError: Incompatible or invalid weight.
* """
* return _init_Arc(self._encoder.get().__call__(deref(arc._arc))) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1274, __pyx_L1_error)
+ __PYX_ERR(0, 1278, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
- __PYX_ERR(0, 1274, __pyx_L1_error)
+ __PYX_ERR(0, 1278, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_encoder.get()->operator()((*__pyx_v_arc->_arc)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1274, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_encoder.get()->operator()((*__pyx_v_arc->_arc)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1258
+ /* "pywrapfst.pyx":1262
* # Python's equivalent to operator().
*
* def __call__(self, Arc arc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1276
+/* "pywrapfst.pyx":1280
* return _init_Arc(self._encoder.get().__call__(deref(arc._arc)))
*
* cpdef uint32 flags(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1276, __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, 1280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_9flags)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1276, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1276, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __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, 1276, __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, 1280, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1277
+ /* "pywrapfst.pyx":1281
*
* cpdef uint32 flags(self):
* return self._encoder.get().Flags() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1277, __pyx_L1_error)
+ __PYX_ERR(0, 1281, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_encoder.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":1276
+ /* "pywrapfst.pyx":1280
* return _init_Arc(self._encoder.get().__call__(deref(arc._arc)))
*
* 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_12EncodeMapper_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1276, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_f_9pywrapfst_12EncodeMapper_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1279
+/* "pywrapfst.pyx":1283
* return self._encoder.get().Flags()
*
* cpdef _EncodeMapperSymbolTable input_symbols(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1283, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_11input_symbols)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __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__EncodeMapperSymbolTable))))) __PYX_ERR(0, 1279, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTable))))) __PYX_ERR(0, 1283, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1280
+ /* "pywrapfst.pyx":1284
*
* cpdef _EncodeMapperSymbolTable input_symbols(self):
* if self._encoder.get().InputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1280, __pyx_L1_error)
+ __PYX_ERR(0, 1284, __pyx_L1_error)
}
__pyx_t_5 = ((__pyx_v_self->_encoder.get()->InputSymbols() == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1281
+ /* "pywrapfst.pyx":1285
* cpdef _EncodeMapperSymbolTable input_symbols(self):
* if self._encoder.get().InputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1280
+ /* "pywrapfst.pyx":1284
*
* cpdef _EncodeMapperSymbolTable input_symbols(self):
* if self._encoder.get().InputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1282
+ /* "pywrapfst.pyx":1286
* if self._encoder.get().InputSymbols() == NULL:
* return
* return _init_EncodeMapperSymbolTable(const_cast[SymbolTable_ptr]( # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "pywrapfst.pyx":1283
+ /* "pywrapfst.pyx":1287
* return
* return _init_EncodeMapperSymbolTable(const_cast[SymbolTable_ptr](
* self._encoder.get().InputSymbols()), self._encoder) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1283, __pyx_L1_error)
+ __PYX_ERR(0, 1287, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1282
+ /* "pywrapfst.pyx":1286
* if self._encoder.get().InputSymbols() == NULL:
* return
* return _init_EncodeMapperSymbolTable(const_cast[SymbolTable_ptr]( # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1283, __pyx_L1_error)
+ __PYX_ERR(0, 1287, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1283
+ /* "pywrapfst.pyx":1287
* return
* return _init_EncodeMapperSymbolTable(const_cast[SymbolTable_ptr](
* self._encoder.get().InputSymbols()), self._encoder) # <<<<<<<<<<<<<<
*
* cpdef _EncodeMapperSymbolTable output_symbols(self):
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable(const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_encoder.get()->InputSymbols()), __pyx_v_self->_encoder)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable(const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_encoder.get()->InputSymbols()), __pyx_v_self->_encoder)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1286, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1279
+ /* "pywrapfst.pyx":1283
* return self._encoder.get().Flags()
*
* cpdef _EncodeMapperSymbolTable input_symbols(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("input_symbols", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_12EncodeMapper_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_12EncodeMapper_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1283, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1285
+/* "pywrapfst.pyx":1289
* self._encoder.get().InputSymbols()), self._encoder)
*
* cpdef _EncodeMapperSymbolTable output_symbols(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_13output_symbols)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1285, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1289, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1285, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1289, __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__EncodeMapperSymbolTable))))) __PYX_ERR(0, 1285, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTable))))) __PYX_ERR(0, 1289, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1286
+ /* "pywrapfst.pyx":1290
*
* cpdef _EncodeMapperSymbolTable output_symbols(self):
* if self._encoder.get().OutputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1286, __pyx_L1_error)
+ __PYX_ERR(0, 1290, __pyx_L1_error)
}
__pyx_t_5 = ((__pyx_v_self->_encoder.get()->OutputSymbols() == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1287
+ /* "pywrapfst.pyx":1291
* cpdef _EncodeMapperSymbolTable output_symbols(self):
* if self._encoder.get().OutputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1286
+ /* "pywrapfst.pyx":1290
*
* cpdef _EncodeMapperSymbolTable output_symbols(self):
* if self._encoder.get().OutputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1288
+ /* "pywrapfst.pyx":1292
* if self._encoder.get().OutputSymbols() == NULL:
* return
* return _init_EncodeMapperSymbolTable(const_cast[SymbolTable_ptr]( # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "pywrapfst.pyx":1289
+ /* "pywrapfst.pyx":1293
* return
* return _init_EncodeMapperSymbolTable(const_cast[SymbolTable_ptr](
* self._encoder.get().OutputSymbols()), self._encoder) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1289, __pyx_L1_error)
+ __PYX_ERR(0, 1293, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1288
+ /* "pywrapfst.pyx":1292
* if self._encoder.get().OutputSymbols() == NULL:
* return
* return _init_EncodeMapperSymbolTable(const_cast[SymbolTable_ptr]( # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1289, __pyx_L1_error)
+ __PYX_ERR(0, 1293, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1289
+ /* "pywrapfst.pyx":1293
* return
* return _init_EncodeMapperSymbolTable(const_cast[SymbolTable_ptr](
* self._encoder.get().OutputSymbols()), self._encoder) # <<<<<<<<<<<<<<
*
* cpdef uint64 properties(self, uint64 mask):
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable(const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_encoder.get()->OutputSymbols()), __pyx_v_self->_encoder)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable(const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_encoder.get()->OutputSymbols()), __pyx_v_self->_encoder)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1285
+ /* "pywrapfst.pyx":1289
* self._encoder.get().InputSymbols()), self._encoder)
*
* cpdef _EncodeMapperSymbolTable output_symbols(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("output_symbols", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_12EncodeMapper_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_12EncodeMapper_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1291
+/* "pywrapfst.pyx":1295
* self._encoder.get().OutputSymbols()), self._encoder)
*
* cpdef uint64 properties(self, uint64 mask): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1291, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_15properties)) {
- __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1291, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1291, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1295, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_7;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1307
+ /* "pywrapfst.pyx":1311
* A 64-bit bitmask representing the requested properties.
* """
* return self._encoder.get().Properties(mask) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1307, __pyx_L1_error)
+ __PYX_ERR(0, 1311, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_encoder.get()->Properties(__pyx_v_mask);
goto __pyx_L0;
- /* "pywrapfst.pyx":1291
+ /* "pywrapfst.pyx":1295
* self._encoder.get().OutputSymbols()), self._encoder)
*
* cpdef uint64 properties(self, uint64 mask): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("properties (wrapper)", 0);
assert(__pyx_arg_mask); {
- __pyx_v_mask = __Pyx_PyInt_As_uint64_t(__pyx_arg_mask); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1291, __pyx_L3_error)
+ __pyx_v_mask = __Pyx_PyInt_As_uint64_t(__pyx_arg_mask); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1295, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("properties", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_f_9pywrapfst_12EncodeMapper_properties(__pyx_v_self, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1291, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_f_9pywrapfst_12EncodeMapper_properties(__pyx_v_self, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1309
+/* "pywrapfst.pyx":1313
* return self._encoder.get().Properties(mask)
*
* cpdef void set_input_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_17set_input_symbols)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_syms)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_syms)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_syms)};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1313, __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[2] = {__pyx_t_4, ((PyObject *)__pyx_v_syms)};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1313, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1309, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(((PyObject *)__pyx_v_syms));
__Pyx_GIVEREF(((PyObject *)__pyx_v_syms));
PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_syms));
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1320
+ /* "pywrapfst.pyx":1324
* See also: `set_output_symbols`.
* """
* self._encoder.get().SetInputSymbols(syms._table) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1320, __pyx_L1_error)
+ __PYX_ERR(0, 1324, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1320, __pyx_L1_error)
+ __PYX_ERR(0, 1324, __pyx_L1_error)
}
__pyx_v_self->_encoder.get()->SetInputSymbols(__pyx_v_syms->_table);
- /* "pywrapfst.pyx":1309
+ /* "pywrapfst.pyx":1313
* return self._encoder.get().Properties(mask)
*
* cpdef void set_input_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
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, 1309, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1313, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_16set_input_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("set_input_symbols", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_12EncodeMapper_set_input_symbols(__pyx_v_self, __pyx_v_syms, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1309, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __pyx_L1_error)
+ __pyx_f_9pywrapfst_12EncodeMapper_set_input_symbols(__pyx_v_self, __pyx_v_syms, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1313, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1322
+/* "pywrapfst.pyx":1326
* self._encoder.get().SetInputSymbols(syms._table)
*
* cpdef void set_output_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_19set_output_symbols)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_syms)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_syms)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_syms)};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __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[2] = {__pyx_t_4, ((PyObject *)__pyx_v_syms)};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1322, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(((PyObject *)__pyx_v_syms));
__Pyx_GIVEREF(((PyObject *)__pyx_v_syms));
PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_syms));
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1333
+ /* "pywrapfst.pyx":1337
* See also: `set_input_symbols`.
* """
* self._encoder.get().SetOutputSymbols(syms._table) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1333, __pyx_L1_error)
+ __PYX_ERR(0, 1337, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1333, __pyx_L1_error)
+ __PYX_ERR(0, 1337, __pyx_L1_error)
}
__pyx_v_self->_encoder.get()->SetOutputSymbols(__pyx_v_syms->_table);
- /* "pywrapfst.pyx":1322
+ /* "pywrapfst.pyx":1326
* self._encoder.get().SetInputSymbols(syms._table)
*
* cpdef void set_output_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
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, 1322, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1326, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_18set_output_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
/* function exit code */
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("set_output_symbols", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_12EncodeMapper_set_output_symbols(__pyx_v_self, __pyx_v_syms, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1322, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error)
+ __pyx_f_9pywrapfst_12EncodeMapper_set_output_symbols(__pyx_v_self, __pyx_v_syms, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1326, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1335
+/* "pywrapfst.pyx":1339
* self._encoder.get().SetOutputSymbols(syms._table)
*
* cpdef string weight_type(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_21weight_type)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1335, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1339, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1335, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1339, __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, 1335, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1339, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1336
+ /* "pywrapfst.pyx":1340
*
* cpdef string weight_type(self):
* return self._encoder.get().WeightType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1336, __pyx_L1_error)
+ __PYX_ERR(0, 1340, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_encoder.get()->WeightType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1335
+ /* "pywrapfst.pyx":1339
* self._encoder.get().SetOutputSymbols(syms._table)
*
* cpdef string weight_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("weight_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12EncodeMapper_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12EncodeMapper_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1360
+/* "pywrapfst.pyx":1364
*
* # IPython notebook magic to produce an SVG of the FST.
* def _repr_svg_(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_12 = NULL;
__Pyx_RefNannySetupContext("_repr_svg_", 0);
- /* "pywrapfst.pyx":1374
+ /* "pywrapfst.pyx":1378
* """
* # Throws OSError if the dot executable is not found.
* proc = subprocess.Popen(["dot", "-Tsvg"], stdin=subprocess.PIPE, # <<<<<<<<<<<<<<
* stdout=subprocess.PIPE, stderr=subprocess.PIPE)
* cdef stringstream sstrm
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Popen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Popen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_dot);
__Pyx_GIVEREF(__pyx_n_s_dot);
__Pyx_INCREF(__pyx_kp_s_Tsvg);
__Pyx_GIVEREF(__pyx_kp_s_Tsvg);
PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_Tsvg);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1374, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1374, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1374, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdin, __pyx_t_5) < 0) __PYX_ERR(0, 1374, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdin, __pyx_t_5) < 0) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "pywrapfst.pyx":1375
+ /* "pywrapfst.pyx":1379
* # Throws OSError if the dot executable is not found.
* proc = subprocess.Popen(["dot", "-Tsvg"], stdin=subprocess.PIPE,
* stdout=subprocess.PIPE, stderr=subprocess.PIPE) # <<<<<<<<<<<<<<
* cdef stringstream sstrm
* fst.DrawFst(deref(self._fst), self._fst.get().InputSymbols(),
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1375, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1375, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdout, __pyx_t_4) < 0) __PYX_ERR(0, 1374, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdout, __pyx_t_4) < 0) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1375, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1375, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stderr, __pyx_t_5) < 0) __PYX_ERR(0, 1374, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stderr, __pyx_t_5) < 0) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "pywrapfst.pyx":1374
+ /* "pywrapfst.pyx":1378
* """
* # Throws OSError if the dot executable is not found.
* proc = subprocess.Popen(["dot", "-Tsvg"], stdin=subprocess.PIPE, # <<<<<<<<<<<<<<
* stdout=subprocess.PIPE, stderr=subprocess.PIPE)
* cdef stringstream sstrm
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1374, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_proc = __pyx_t_5;
__pyx_t_5 = 0;
- /* "pywrapfst.pyx":1377
+ /* "pywrapfst.pyx":1381
* stdout=subprocess.PIPE, stderr=subprocess.PIPE)
* cdef stringstream sstrm
* fst.DrawFst(deref(self._fst), self._fst.get().InputSymbols(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1377, __pyx_L1_error)
+ __PYX_ERR(0, 1381, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1377, __pyx_L1_error)
+ __PYX_ERR(0, 1381, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1378
+ /* "pywrapfst.pyx":1382
* cdef stringstream sstrm
* fst.DrawFst(deref(self._fst), self._fst.get().InputSymbols(),
* self._fst.get().OutputSymbols(), NULL, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1378, __pyx_L1_error)
+ __PYX_ERR(0, 1382, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1379
+ /* "pywrapfst.pyx":1383
* fst.DrawFst(deref(self._fst), self._fst.get().InputSymbols(),
* self._fst.get().OutputSymbols(), NULL,
* self._fst.get().Properties(fst.kAcceptor, True) == # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1379, __pyx_L1_error)
+ __PYX_ERR(0, 1383, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1381
+ /* "pywrapfst.pyx":1385
* self._fst.get().Properties(fst.kAcceptor, True) ==
* fst.kAcceptor,
* b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, b"g", False, # <<<<<<<<<<<<<<
* addr(sstrm), b"_repr_svg")
* (sout, serr) = proc.communicate(sstrm.str())
*/
- __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1381, __pyx_L1_error)
- __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_g); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1381, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1385, __pyx_L1_error)
+ __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_g); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1385, __pyx_L1_error)
- /* "pywrapfst.pyx":1382
+ /* "pywrapfst.pyx":1386
* fst.kAcceptor,
* b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, b"g", False,
* addr(sstrm), b"_repr_svg") # <<<<<<<<<<<<<<
* (sout, serr) = proc.communicate(sstrm.str())
* if proc.returncode != 0: # Just to be explicit.
*/
- __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_repr_svg); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1382, __pyx_L1_error)
+ __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_repr_svg); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1386, __pyx_L1_error)
- /* "pywrapfst.pyx":1377
+ /* "pywrapfst.pyx":1381
* stdout=subprocess.PIPE, stderr=subprocess.PIPE)
* cdef stringstream sstrm
* fst.DrawFst(deref(self._fst), self._fst.get().InputSymbols(), # <<<<<<<<<<<<<<
*/
fst::script::DrawFst((*__pyx_v_self->_fst), __pyx_v_self->_fst.get()->InputSymbols(), __pyx_v_self->_fst.get()->OutputSymbols(), NULL, (__pyx_v_self->_fst.get()->Properties(fst::kAcceptor, 1) == fst::kAcceptor), __pyx_t_6, 8.5, 11.0, 1, 0, 0.4, 0.25, 14, 5, __pyx_t_7, 0, (&__pyx_v_sstrm), __pyx_t_8);
- /* "pywrapfst.pyx":1383
+ /* "pywrapfst.pyx":1387
* b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, b"g", False,
* addr(sstrm), b"_repr_svg")
* (sout, serr) = proc.communicate(sstrm.str()) # <<<<<<<<<<<<<<
* if proc.returncode != 0: # Just to be explicit.
* raise subprocess.CalledProcessError(proc.returncode, self._DOT_TSVG)
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_communicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_communicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_sstrm.str()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1383, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_sstrm.str()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
}
}
if (!__pyx_t_2) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1387, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1387, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1387, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1383, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 1383, __pyx_L1_error)
+ __PYX_ERR(0, 1387, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
#else
- __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1383, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1383, __pyx_L1_error)
+ __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1383, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1387, __pyx_L1_error)
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L4_unpacking_done;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 1383, __pyx_L1_error)
+ __PYX_ERR(0, 1387, __pyx_L1_error)
__pyx_L4_unpacking_done:;
}
__pyx_v_sout = __pyx_t_1;
__pyx_v_serr = __pyx_t_4;
__pyx_t_4 = 0;
- /* "pywrapfst.pyx":1384
+ /* "pywrapfst.pyx":1388
* addr(sstrm), b"_repr_svg")
* (sout, serr) = proc.communicate(sstrm.str())
* if proc.returncode != 0: # Just to be explicit. # <<<<<<<<<<<<<<
* raise subprocess.CalledProcessError(proc.returncode, self._DOT_TSVG)
* return sout.decode("utf8")
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1384, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1384, __pyx_L1_error)
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1388, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1384, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1388, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_10) {
- /* "pywrapfst.pyx":1385
+ /* "pywrapfst.pyx":1389
* (sout, serr) = proc.communicate(sstrm.str())
* if proc.returncode != 0: # Just to be explicit.
* raise subprocess.CalledProcessError(proc.returncode, self._DOT_TSVG) # <<<<<<<<<<<<<<
* return sout.decode("utf8")
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1385, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1385, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DOT_TSVG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DOT_TSVG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = NULL;
__pyx_t_11 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_3};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_3};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
- __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1385, __pyx_L1_error)
+ __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
if (__pyx_t_2) {
__Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = NULL;
PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_3);
__pyx_t_5 = 0;
__pyx_t_3 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 1385, __pyx_L1_error)
+ __PYX_ERR(0, 1389, __pyx_L1_error)
- /* "pywrapfst.pyx":1384
+ /* "pywrapfst.pyx":1388
* addr(sstrm), b"_repr_svg")
* (sout, serr) = proc.communicate(sstrm.str())
* if proc.returncode != 0: # Just to be explicit. # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1386
+ /* "pywrapfst.pyx":1390
* if proc.returncode != 0: # Just to be explicit.
* raise subprocess.CalledProcessError(proc.returncode, self._DOT_TSVG)
* return sout.decode("utf8") # <<<<<<<<<<<<<<
* def __repr__(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sout, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1386, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sout, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1360
+ /* "pywrapfst.pyx":1364
*
* # IPython notebook magic to produce an SVG of the FST.
* def _repr_svg_(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1388
+/* "pywrapfst.pyx":1392
* return sout.decode("utf8")
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1389
+ /* "pywrapfst.pyx":1393
*
* def __repr__(self):
* return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self)) # <<<<<<<<<<<<<<
* def __init__(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Fst_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1389, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Fst_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1393, __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 '%s'", "fst_type");
- __PYX_ERR(0, 1389, __pyx_L1_error)
+ __PYX_ERR(0, 1393, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_self->__pyx_vtab)->fst_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1389, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_self->__pyx_vtab)->fst_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1389, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
- __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, 1389, __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, 1393, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_t_3, __pyx_t_5};
- __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, 1389, __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, 1393, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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, 1389, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1389, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __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":1388
+ /* "pywrapfst.pyx":1392
* return sout.decode("utf8")
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1391
+/* "pywrapfst.pyx":1395
* return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self))
*
* def __init__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":1392
+ /* "pywrapfst.pyx":1396
*
* def __init__(self):
* raise FstDeletedConstructorError( # <<<<<<<<<<<<<<
* "Cannot construct {}".format(self.__class__.__name__))
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1392, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":1393
+ /* "pywrapfst.pyx":1397
* def __init__(self):
* raise FstDeletedConstructorError(
* "Cannot construct {}".format(self.__class__.__name__)) # <<<<<<<<<<<<<<
*
* # Other magic methods.
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1393, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1397, __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, 1393, __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, 1397, __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, 1393, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1397, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1393, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1393, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1393, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1393, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1397, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1393, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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[2] = {__pyx_t_4, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1392, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__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, 1392, __pyx_L1_error)
+ __PYX_ERR(0, 1396, __pyx_L1_error)
- /* "pywrapfst.pyx":1391
+ /* "pywrapfst.pyx":1395
* return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self))
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1397
+/* "pywrapfst.pyx":1401
* # Other magic methods.
*
* def __str__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "pywrapfst.pyx":1398
+ /* "pywrapfst.pyx":1402
*
* def __str__(self):
* return self.text(acceptor=self._fst.get().Properties(fst.kAcceptor, True) == # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "text");
- __PYX_ERR(0, 1398, __pyx_L1_error)
+ __PYX_ERR(0, 1402, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1398, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1398, __pyx_L1_error)
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1402, __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 '%s'", "_fst");
- __PYX_ERR(0, 1398, __pyx_L1_error)
+ __PYX_ERR(0, 1402, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1399
+ /* "pywrapfst.pyx":1403
* def __str__(self):
* return self.text(acceptor=self._fst.get().Properties(fst.kAcceptor, True) ==
* fst.kAcceptor, # <<<<<<<<<<<<<<
* show_weight_one=self._fst.get().Properties(fst.kWeighted, True) ==
* fst.kWeighted)
*/
- __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_v_self->_fst.get()->Properties(fst::kAcceptor, 1) == fst::kAcceptor)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1398, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_v_self->_fst.get()->Properties(fst::kAcceptor, 1) == fst::kAcceptor)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1402, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_acceptor, __pyx_t_3) < 0) __PYX_ERR(0, 1398, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_acceptor, __pyx_t_3) < 0) __PYX_ERR(0, 1402, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "pywrapfst.pyx":1400
+ /* "pywrapfst.pyx":1404
* return self.text(acceptor=self._fst.get().Properties(fst.kAcceptor, True) ==
* fst.kAcceptor,
* show_weight_one=self._fst.get().Properties(fst.kWeighted, True) == # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1400, __pyx_L1_error)
+ __PYX_ERR(0, 1404, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1401
+ /* "pywrapfst.pyx":1405
* fst.kAcceptor,
* show_weight_one=self._fst.get().Properties(fst.kWeighted, True) ==
* fst.kWeighted) # <<<<<<<<<<<<<<
*
* cpdef string arc_type(self):
*/
- __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_v_self->_fst.get()->Properties(fst::kWeighted, 1) == fst::kWeighted)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1400, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_v_self->_fst.get()->Properties(fst::kWeighted, 1) == fst::kWeighted)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_show_weight_one, __pyx_t_3) < 0) __PYX_ERR(0, 1398, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_show_weight_one, __pyx_t_3) < 0) __PYX_ERR(0, 1402, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "pywrapfst.pyx":1398
+ /* "pywrapfst.pyx":1402
*
* def __str__(self):
* return self.text(acceptor=self._fst.get().Properties(fst.kAcceptor, True) == # <<<<<<<<<<<<<<
* fst.kAcceptor,
* show_weight_one=self._fst.get().Properties(fst.kWeighted, True) ==
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1398, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1402, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1397
+ /* "pywrapfst.pyx":1401
* # Other magic methods.
*
* def __str__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1403
+/* "pywrapfst.pyx":1407
* fst.kWeighted)
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __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, 1407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_9arc_type)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __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, 1403, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1407, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1404
+ /* "pywrapfst.pyx":1408
*
* cpdef string arc_type(self):
* return self._fst.get().ArcType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1404, __pyx_L1_error)
+ __PYX_ERR(0, 1408, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1403
+ /* "pywrapfst.pyx":1407
* fst.kWeighted)
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("arc_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1406
+/* "pywrapfst.pyx":1410
* return self._fst.get().ArcType()
*
* cpdef ArcIterator arcs(self, int64 state): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_11arcs)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1406, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1406, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1406, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1406, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1406, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1406, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
}
__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_ArcIterator))))) __PYX_ERR(0, 1406, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_ArcIterator))))) __PYX_ERR(0, 1410, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1420
+ /* "pywrapfst.pyx":1424
* See also: `mutable_arcs`, `states`.
* """
* return ArcIterator(self, state) # <<<<<<<<<<<<<<
* cpdef _Fst copy(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, 1420, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1424, __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_ArcIterator), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_ArcIterator), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = ((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1406
+ /* "pywrapfst.pyx":1410
* return self._fst.get().ArcType()
*
* cpdef ArcIterator arcs(self, int64 state): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("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, 1406, __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, 1410, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("arcs", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1422
+/* "pywrapfst.pyx":1426
* return ArcIterator(self, state)
*
* cpdef _Fst copy(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __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, 1426, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_13copy)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1426, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1426, __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, 1422, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 1426, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1428
+ /* "pywrapfst.pyx":1432
* Makes a copy of the FST.
* """
* return _init_XFst(new fst.FstClass(deref(self._fst))) # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1428, __pyx_L1_error)
+ __PYX_ERR(0, 1432, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(new fst::script::FstClass((*__pyx_v_self->_fst)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(new fst::script::FstClass((*__pyx_v_self->_fst)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1432, __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":1422
+ /* "pywrapfst.pyx":1426
* return ArcIterator(self, state)
*
* cpdef _Fst copy(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("copy", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1430
+/* "pywrapfst.pyx":1434
* return _init_XFst(new fst.FstClass(deref(self._fst)))
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_4_Fst_15draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_4_Fst_draw *__pyx_optional_args) {
- /* "pywrapfst.pyx":1432
+ /* "pywrapfst.pyx":1436
* cpdef void draw(self,
* filename,
* _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
*/
struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":1433
+ /* "pywrapfst.pyx":1437
* filename,
* _SymbolTable isymbols=None,
* _SymbolTable osymbols=None, # <<<<<<<<<<<<<<
*/
struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":1434
+ /* "pywrapfst.pyx":1438
* _SymbolTable isymbols=None,
* _SymbolTable osymbols=None,
* SymbolTable ssymbols=None, # <<<<<<<<<<<<<<
*/
struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
- /* "pywrapfst.pyx":1435
+ /* "pywrapfst.pyx":1439
* _SymbolTable osymbols=None,
* SymbolTable ssymbols=None,
* bool acceptor=False, # <<<<<<<<<<<<<<
double __pyx_v_width = ((double)8.5);
double __pyx_v_height = ((double)11.0);
- /* "pywrapfst.pyx":1439
+ /* "pywrapfst.pyx":1443
* double width=8.5,
* double height=11,
* bool portrait=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_portrait = ((bool)0);
- /* "pywrapfst.pyx":1440
+ /* "pywrapfst.pyx":1444
* double height=11,
* bool portrait=False,
* bool vertical=False, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int32 __pyx_v_precision = ((__pyx_t_10basictypes_int32)5);
PyObject *__pyx_v_float_format = ((PyObject *)__pyx_n_b_g);
- /* "pywrapfst.pyx":1446
+ /* "pywrapfst.pyx":1450
* int32 precision=5,
* float_format=b"g",
* bool show_weight_one=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1430
+ /* "pywrapfst.pyx":1434
* return _init_XFst(new fst.FstClass(deref(self._fst)))
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_draw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_draw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_15draw)) {
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_4 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_5 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_portrait); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_portrait); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_vertical); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_vertical); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyFloat_FromDouble(__pyx_v_ranksep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_8 = PyFloat_FromDouble(__pyx_v_ranksep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = PyFloat_FromDouble(__pyx_v_nodesep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_9 = PyFloat_FromDouble(__pyx_v_nodesep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_fontsize); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_fontsize); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyInt_From_int32_t(__pyx_v_precision); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyInt_From_int32_t(__pyx_v_precision); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_13 = __pyx_t_1; __pyx_t_14 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_13)) {
PyObject *__pyx_temp[17] = {__pyx_t_14, __pyx_v_filename, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_3, __pyx_v_title, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_float_format, __pyx_t_12};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_15, 16+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_15, 16+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 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_13)) {
PyObject *__pyx_temp[17] = {__pyx_t_14, __pyx_v_filename, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_3, __pyx_v_title, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_float_format, __pyx_t_12};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_15, 16+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_15, 16+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_16 = PyTuple_New(16+__pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_16 = PyTuple_New(16+__pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_16);
if (__pyx_t_14) {
__Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL;
__pyx_t_10 = 0;
__pyx_t_11 = 0;
__pyx_t_12 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1482
+ /* "pywrapfst.pyx":1486
* See also: `text`.
* """
* cdef string filename_string = tostring(filename) # <<<<<<<<<<<<<<
* cdef unique_ptr[ofstream] ostrm
* ostrm.reset(new ofstream(filename_string.c_str()))
*/
- __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1482, __pyx_L1_error)
+ __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1486, __pyx_L1_error)
__pyx_v_filename_string = __pyx_t_17;
- /* "pywrapfst.pyx":1484
+ /* "pywrapfst.pyx":1488
* cdef string filename_string = tostring(filename)
* cdef unique_ptr[ofstream] ostrm
* ostrm.reset(new ofstream(filename_string.c_str())) # <<<<<<<<<<<<<<
*/
__pyx_v_ostrm.reset(new std::ofstream(__pyx_v_filename_string.c_str()));
- /* "pywrapfst.pyx":1485
+ /* "pywrapfst.pyx":1489
* cdef unique_ptr[ofstream] ostrm
* ostrm.reset(new ofstream(filename_string.c_str()))
* cdef fst.SymbolTable *ssymbols_ptr = NULL # <<<<<<<<<<<<<<
*/
__pyx_v_ssymbols_ptr = NULL;
- /* "pywrapfst.pyx":1486
+ /* "pywrapfst.pyx":1490
* ostrm.reset(new ofstream(filename_string.c_str()))
* cdef fst.SymbolTable *ssymbols_ptr = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_19 = (__pyx_t_18 != 0);
if (__pyx_t_19) {
- /* "pywrapfst.pyx":1487
+ /* "pywrapfst.pyx":1491
* cdef fst.SymbolTable *ssymbols_ptr = NULL
* if ssymbols is not None:
* ssymbols_ptr = ssymbols._table # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1487, __pyx_L1_error)
+ __PYX_ERR(0, 1491, __pyx_L1_error)
}
__pyx_t_20 = __pyx_v_ssymbols->__pyx_base.__pyx_base._table;
__pyx_v_ssymbols_ptr = __pyx_t_20;
- /* "pywrapfst.pyx":1486
+ /* "pywrapfst.pyx":1490
* ostrm.reset(new ofstream(filename_string.c_str()))
* cdef fst.SymbolTable *ssymbols_ptr = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1488
+ /* "pywrapfst.pyx":1492
* if ssymbols is not None:
* ssymbols_ptr = ssymbols._table
* fst.DrawFst(deref(self._fst), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1488, __pyx_L1_error)
+ __PYX_ERR(0, 1492, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1489
+ /* "pywrapfst.pyx":1493
* ssymbols_ptr = ssymbols._table
* fst.DrawFst(deref(self._fst),
* self._fst.get().InputSymbols() if isymbols is None # <<<<<<<<<<<<<<
if ((__pyx_t_19 != 0)) {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1489, __pyx_L1_error)
+ __PYX_ERR(0, 1493, __pyx_L1_error)
}
__pyx_t_21 = __pyx_v_self->_fst.get()->InputSymbols();
} else {
- /* "pywrapfst.pyx":1490
+ /* "pywrapfst.pyx":1494
* fst.DrawFst(deref(self._fst),
* self._fst.get().InputSymbols() if isymbols is None
* else isymbols._table, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1490, __pyx_L1_error)
+ __PYX_ERR(0, 1494, __pyx_L1_error)
}
__pyx_t_21 = __pyx_v_isymbols->_table;
}
- /* "pywrapfst.pyx":1491
+ /* "pywrapfst.pyx":1495
* self._fst.get().InputSymbols() if isymbols is None
* else isymbols._table,
* self._fst.get().OutputSymbols() if osymbols is None # <<<<<<<<<<<<<<
if ((__pyx_t_19 != 0)) {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1491, __pyx_L1_error)
+ __PYX_ERR(0, 1495, __pyx_L1_error)
}
__pyx_t_22 = __pyx_v_self->_fst.get()->OutputSymbols();
} else {
- /* "pywrapfst.pyx":1492
+ /* "pywrapfst.pyx":1496
* else isymbols._table,
* self._fst.get().OutputSymbols() if osymbols is None
* else osymbols._table, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1492, __pyx_L1_error)
+ __PYX_ERR(0, 1496, __pyx_L1_error)
}
__pyx_t_22 = __pyx_v_osymbols->_table;
}
- /* "pywrapfst.pyx":1493
+ /* "pywrapfst.pyx":1497
* self._fst.get().OutputSymbols() if osymbols is None
* else osymbols._table,
* ssymbols_ptr, acceptor, tostring(title), width, height, portrait, # <<<<<<<<<<<<<<
* vertical, ranksep, nodesep, fontsize, precision,
* tostring(float_format), show_weight_one, ostrm.get(),
*/
- __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_title, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1493, __pyx_L1_error)
+ __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_title, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1497, __pyx_L1_error)
- /* "pywrapfst.pyx":1495
+ /* "pywrapfst.pyx":1499
* ssymbols_ptr, acceptor, tostring(title), width, height, portrait,
* vertical, ranksep, nodesep, fontsize, precision,
* tostring(float_format), show_weight_one, ostrm.get(), # <<<<<<<<<<<<<<
* filename_string)
*
*/
- __pyx_t_23 = __pyx_f_9pywrapfst_tostring(__pyx_v_float_format, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1495, __pyx_L1_error)
+ __pyx_t_23 = __pyx_f_9pywrapfst_tostring(__pyx_v_float_format, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1499, __pyx_L1_error)
- /* "pywrapfst.pyx":1488
+ /* "pywrapfst.pyx":1492
* if ssymbols is not None:
* ssymbols_ptr = ssymbols._table
* fst.DrawFst(deref(self._fst), # <<<<<<<<<<<<<<
*/
fst::script::DrawFst((*__pyx_v_self->_fst), __pyx_t_21, __pyx_t_22, __pyx_v_ssymbols_ptr, __pyx_v_acceptor, __pyx_t_17, __pyx_v_width, __pyx_v_height, __pyx_v_portrait, __pyx_v_vertical, __pyx_v_ranksep, __pyx_v_nodesep, __pyx_v_fontsize, __pyx_v_precision, __pyx_t_23, __pyx_v_show_weight_one, __pyx_v_ostrm.get(), __pyx_v_filename_string);
- /* "pywrapfst.pyx":1430
+ /* "pywrapfst.pyx":1434
* return _init_XFst(new fst.FstClass(deref(self._fst)))
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_isymbols,&__pyx_n_s_osymbols,&__pyx_n_s_ssymbols,&__pyx_n_s_acceptor,&__pyx_n_s_title,&__pyx_n_s_width,&__pyx_n_s_height,&__pyx_n_s_portrait,&__pyx_n_s_vertical,&__pyx_n_s_ranksep,&__pyx_n_s_nodesep,&__pyx_n_s_fontsize,&__pyx_n_s_precision,&__pyx_n_s_float_format,&__pyx_n_s_show_weight_one,0};
PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- /* "pywrapfst.pyx":1432
+ /* "pywrapfst.pyx":1436
* cpdef void draw(self,
* filename,
* _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
*/
values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":1433
+ /* "pywrapfst.pyx":1437
* filename,
* _SymbolTable isymbols=None,
* _SymbolTable osymbols=None, # <<<<<<<<<<<<<<
*/
values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":1434
+ /* "pywrapfst.pyx":1438
* _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, "draw") < 0)) __PYX_ERR(0, 1430, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 1434, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[2]);
__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)values[3]);
if (values[4]) {
- __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1435, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1439, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1435
+ /* "pywrapfst.pyx":1439
* _SymbolTable osymbols=None,
* SymbolTable ssymbols=None,
* bool acceptor=False, # <<<<<<<<<<<<<<
}
__pyx_v_title = values[5];
if (values[6]) {
- __pyx_v_width = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_width == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1437, __pyx_L3_error)
+ __pyx_v_width = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_width == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1441, __pyx_L3_error)
} else {
__pyx_v_width = ((double)8.5);
}
if (values[7]) {
- __pyx_v_height = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_height == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1438, __pyx_L3_error)
+ __pyx_v_height = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_height == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1442, __pyx_L3_error)
} else {
__pyx_v_height = ((double)11.0);
}
if (values[8]) {
- __pyx_v_portrait = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_portrait == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1439, __pyx_L3_error)
+ __pyx_v_portrait = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_portrait == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1443, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1439
+ /* "pywrapfst.pyx":1443
* double width=8.5,
* double height=11,
* bool portrait=False, # <<<<<<<<<<<<<<
__pyx_v_portrait = ((bool)0);
}
if (values[9]) {
- __pyx_v_vertical = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_vertical == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1440, __pyx_L3_error)
+ __pyx_v_vertical = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_vertical == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1440
+ /* "pywrapfst.pyx":1444
* double height=11,
* bool portrait=False,
* bool vertical=False, # <<<<<<<<<<<<<<
__pyx_v_vertical = ((bool)0);
}
if (values[10]) {
- __pyx_v_ranksep = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_ranksep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1441, __pyx_L3_error)
+ __pyx_v_ranksep = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_ranksep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1445, __pyx_L3_error)
} else {
__pyx_v_ranksep = ((double)0.4);
}
if (values[11]) {
- __pyx_v_nodesep = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_nodesep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1442, __pyx_L3_error)
+ __pyx_v_nodesep = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_nodesep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1446, __pyx_L3_error)
} else {
__pyx_v_nodesep = ((double)0.25);
}
if (values[12]) {
- __pyx_v_fontsize = __Pyx_PyInt_As_int32_t(values[12]); if (unlikely((__pyx_v_fontsize == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1443, __pyx_L3_error)
+ __pyx_v_fontsize = __Pyx_PyInt_As_int32_t(values[12]); if (unlikely((__pyx_v_fontsize == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1447, __pyx_L3_error)
} else {
__pyx_v_fontsize = ((__pyx_t_10basictypes_int32)14);
}
if (values[13]) {
- __pyx_v_precision = __Pyx_PyInt_As_int32_t(values[13]); if (unlikely((__pyx_v_precision == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L3_error)
+ __pyx_v_precision = __Pyx_PyInt_As_int32_t(values[13]); if (unlikely((__pyx_v_precision == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1448, __pyx_L3_error)
} else {
__pyx_v_precision = ((__pyx_t_10basictypes_int32)5);
}
__pyx_v_float_format = values[14];
if (values[15]) {
- __pyx_v_show_weight_one = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_show_weight_one == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1446, __pyx_L3_error)
+ __pyx_v_show_weight_one = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_show_weight_one == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1450, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1446
+ /* "pywrapfst.pyx":1450
* int32 precision=5,
* float_format=b"g",
* bool show_weight_one=False): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1430, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1434, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._Fst.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1432, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1433, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1434, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1436, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1437, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1438, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_4_Fst_14draw(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), __pyx_v_filename, __pyx_v_isymbols, __pyx_v_osymbols, __pyx_v_ssymbols, __pyx_v_acceptor, __pyx_v_title, __pyx_v_width, __pyx_v_height, __pyx_v_portrait, __pyx_v_vertical, __pyx_v_ranksep, __pyx_v_nodesep, __pyx_v_fontsize, __pyx_v_precision, __pyx_v_float_format, __pyx_v_show_weight_one);
- /* "pywrapfst.pyx":1430
+ /* "pywrapfst.pyx":1434
* return _init_XFst(new fst.FstClass(deref(self._fst)))
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
__pyx_t_1.float_format = __pyx_v_float_format;
__pyx_t_1.show_weight_one = __pyx_v_show_weight_one;
__pyx_vtabptr_9pywrapfst__Fst->draw(__pyx_v_self, __pyx_v_filename, 1, &__pyx_t_1);
- __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1498
+/* "pywrapfst.pyx":1502
* filename_string)
*
* cpdef Weight final(self, int64 state): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_final); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1498, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_final); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1502, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_17final)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1502, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1498, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1502, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
}
__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_Weight))))) __PYX_ERR(0, 1498, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 1502, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1513
+ /* "pywrapfst.pyx":1517
* FstIndexError: State index out of range.
* """
* cdef Weight weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
* return weight
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1513, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 1513, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 1517, __pyx_L1_error)
__pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1514
+ /* "pywrapfst.pyx":1518
* """
* cdef Weight weight = Weight.__new__(Weight)
* weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
- __PYX_ERR(0, 1514, __pyx_L1_error)
+ __PYX_ERR(0, 1518, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1514, __pyx_L1_error)
+ __PYX_ERR(0, 1518, __pyx_L1_error)
}
__pyx_v_weight->_weight.reset(new fst::script::WeightClass(__pyx_v_self->_fst.get()->Final(__pyx_v_state)));
- /* "pywrapfst.pyx":1515
+ /* "pywrapfst.pyx":1519
* cdef Weight weight = Weight.__new__(Weight)
* weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
* return weight # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":1498
+ /* "pywrapfst.pyx":1502
* filename_string)
*
* cpdef Weight final(self, int64 state): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("final (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, 1498, __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, 1502, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("final", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_final(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1498, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_final(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1502, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1517
+/* "pywrapfst.pyx":1521
* return weight
*
* cpdef string fst_type(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_19fst_type)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1517, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1517, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __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, 1517, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1521, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1518
+ /* "pywrapfst.pyx":1522
*
* cpdef string fst_type(self):
* return self._fst.get().FstType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1518, __pyx_L1_error)
+ __PYX_ERR(0, 1522, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->FstType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1517
+ /* "pywrapfst.pyx":1521
* return weight
*
* cpdef string fst_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("fst_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_fst_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_fst_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1520
+/* "pywrapfst.pyx":1524
* return self._fst.get().FstType()
*
* cpdef _FstSymbolTable input_symbols(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_21input_symbols)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1520, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1524, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1520, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1524, __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__FstSymbolTable))))) __PYX_ERR(0, 1520, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__FstSymbolTable))))) __PYX_ERR(0, 1524, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1521
+ /* "pywrapfst.pyx":1525
*
* cpdef _FstSymbolTable input_symbols(self):
* if self._fst.get().InputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1521, __pyx_L1_error)
+ __PYX_ERR(0, 1525, __pyx_L1_error)
}
__pyx_t_5 = ((__pyx_v_self->_fst.get()->InputSymbols() == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1522
+ /* "pywrapfst.pyx":1526
* cpdef _FstSymbolTable input_symbols(self):
* if self._fst.get().InputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1521
+ /* "pywrapfst.pyx":1525
*
* cpdef _FstSymbolTable input_symbols(self):
* if self._fst.get().InputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1523
+ /* "pywrapfst.pyx":1527
* if self._fst.get().InputSymbols() == NULL:
* return
* return _init_FstSymbolTable(const_cast[SymbolTable_ptr]( # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "pywrapfst.pyx":1524
+ /* "pywrapfst.pyx":1528
* return
* return _init_FstSymbolTable(const_cast[SymbolTable_ptr](
* self._fst.get().InputSymbols()), self._fst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1524, __pyx_L1_error)
+ __PYX_ERR(0, 1528, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1523
+ /* "pywrapfst.pyx":1527
* if self._fst.get().InputSymbols() == NULL:
* return
* return _init_FstSymbolTable(const_cast[SymbolTable_ptr]( # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1524, __pyx_L1_error)
+ __PYX_ERR(0, 1528, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1524
+ /* "pywrapfst.pyx":1528
* return
* return _init_FstSymbolTable(const_cast[SymbolTable_ptr](
* self._fst.get().InputSymbols()), self._fst) # <<<<<<<<<<<<<<
*
* cpdef size_t num_arcs(self, int64 state) except *:
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_fst.get()->InputSymbols()), __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1523, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_fst.get()->InputSymbols()), __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1520
+ /* "pywrapfst.pyx":1524
* return self._fst.get().FstType()
*
* cpdef _FstSymbolTable input_symbols(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("input_symbols", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1526
+/* "pywrapfst.pyx":1530
* self._fst.get().InputSymbols()), self._fst)
*
* cpdef size_t num_arcs(self, int64 state) except *: # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1526, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_23num_arcs)) {
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1526, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1530, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1530, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1530, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1526, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1526, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1530, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_7;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1543
+ /* "pywrapfst.pyx":1547
* See also: `num_states`.
* """
* cdef size_t result = self._fst.get().NumArcs(state) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1543, __pyx_L1_error)
+ __PYX_ERR(0, 1547, __pyx_L1_error)
}
__pyx_v_result = __pyx_v_self->_fst.get()->NumArcs(__pyx_v_state);
- /* "pywrapfst.pyx":1544
+ /* "pywrapfst.pyx":1548
* """
* cdef size_t result = self._fst.get().NumArcs(state)
* if result == SIZE_MAX: # <<<<<<<<<<<<<<
__pyx_t_8 = ((__pyx_v_result == SIZE_MAX) != 0);
if (__pyx_t_8) {
- /* "pywrapfst.pyx":1545
+ /* "pywrapfst.pyx":1549
* cdef size_t result = self._fst.get().NumArcs(state)
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1549, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1545, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1549, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 1545, __pyx_L1_error)
+ __PYX_ERR(0, 1549, __pyx_L1_error)
- /* "pywrapfst.pyx":1544
+ /* "pywrapfst.pyx":1548
* """
* cdef size_t result = self._fst.get().NumArcs(state)
* if result == SIZE_MAX: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1546
+ /* "pywrapfst.pyx":1550
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range")
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1526
+ /* "pywrapfst.pyx":1530
* self._fst.get().InputSymbols()), self._fst)
*
* cpdef size_t num_arcs(self, int64 state) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("num_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, 1526, __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, 1530, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("num_arcs", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_arcs(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1526, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_arcs(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1530, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1548
+/* "pywrapfst.pyx":1552
* return result
*
* cpdef size_t num_input_epsilons(self, int64 state) except *: # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_input_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1548, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_input_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_25num_input_epsilons)) {
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1552, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1552, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1552, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1548, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1552, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_7;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1565
+ /* "pywrapfst.pyx":1569
* See also: `num_output_epsilons`.
* """
* cdef size_t result = self._fst.get().NumInputEpsilons(state) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1565, __pyx_L1_error)
+ __PYX_ERR(0, 1569, __pyx_L1_error)
}
__pyx_v_result = __pyx_v_self->_fst.get()->NumInputEpsilons(__pyx_v_state);
- /* "pywrapfst.pyx":1566
+ /* "pywrapfst.pyx":1570
* """
* cdef size_t result = self._fst.get().NumInputEpsilons(state)
* if result == SIZE_MAX: # <<<<<<<<<<<<<<
__pyx_t_8 = ((__pyx_v_result == SIZE_MAX) != 0);
if (__pyx_t_8) {
- /* "pywrapfst.pyx":1567
+ /* "pywrapfst.pyx":1571
* cdef size_t result = self._fst.get().NumInputEpsilons(state)
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1567, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1571, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1567, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1571, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 1567, __pyx_L1_error)
+ __PYX_ERR(0, 1571, __pyx_L1_error)
- /* "pywrapfst.pyx":1566
+ /* "pywrapfst.pyx":1570
* """
* cdef size_t result = self._fst.get().NumInputEpsilons(state)
* if result == SIZE_MAX: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1568
+ /* "pywrapfst.pyx":1572
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range")
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1548
+ /* "pywrapfst.pyx":1552
* return result
*
* cpdef size_t num_input_epsilons(self, int64 state) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("num_input_epsilons (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, 1548, __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, 1552, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("num_input_epsilons", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1552, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1570
+/* "pywrapfst.pyx":1574
* return result
*
* cpdef size_t num_output_epsilons(self, int64 state) except *: # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_output_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1570, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_output_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_27num_output_epsilons)) {
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1570, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1574, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1574, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1574, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1570, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1570, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1574, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_7;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1587
+ /* "pywrapfst.pyx":1591
* See also: `num_input_epsilons`.
* """
* cdef size_t result = self._fst.get().NumOutputEpsilons(state) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1587, __pyx_L1_error)
+ __PYX_ERR(0, 1591, __pyx_L1_error)
}
__pyx_v_result = __pyx_v_self->_fst.get()->NumOutputEpsilons(__pyx_v_state);
- /* "pywrapfst.pyx":1588
+ /* "pywrapfst.pyx":1592
* """
* cdef size_t result = self._fst.get().NumOutputEpsilons(state)
* if result == SIZE_MAX: # <<<<<<<<<<<<<<
__pyx_t_8 = ((__pyx_v_result == SIZE_MAX) != 0);
if (__pyx_t_8) {
- /* "pywrapfst.pyx":1589
+ /* "pywrapfst.pyx":1593
* cdef size_t result = self._fst.get().NumOutputEpsilons(state)
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 1589, __pyx_L1_error)
+ __PYX_ERR(0, 1593, __pyx_L1_error)
- /* "pywrapfst.pyx":1588
+ /* "pywrapfst.pyx":1592
* """
* cdef size_t result = self._fst.get().NumOutputEpsilons(state)
* if result == SIZE_MAX: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1590
+ /* "pywrapfst.pyx":1594
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range")
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1570
+ /* "pywrapfst.pyx":1574
* return result
*
* cpdef size_t num_output_epsilons(self, int64 state) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("num_output_epsilons (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, 1570, __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, 1574, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("num_output_epsilons", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1570, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1574, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1592
+/* "pywrapfst.pyx":1596
* return result
*
* cpdef _FstSymbolTable output_symbols(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_29output_symbols)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1596, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1596, __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__FstSymbolTable))))) __PYX_ERR(0, 1592, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__FstSymbolTable))))) __PYX_ERR(0, 1596, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1593
+ /* "pywrapfst.pyx":1597
*
* cpdef _FstSymbolTable output_symbols(self):
* if self._fst.get().OutputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1593, __pyx_L1_error)
+ __PYX_ERR(0, 1597, __pyx_L1_error)
}
__pyx_t_5 = ((__pyx_v_self->_fst.get()->OutputSymbols() == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1594
+ /* "pywrapfst.pyx":1598
* cpdef _FstSymbolTable output_symbols(self):
* if self._fst.get().OutputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1593
+ /* "pywrapfst.pyx":1597
*
* cpdef _FstSymbolTable output_symbols(self):
* if self._fst.get().OutputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1595
+ /* "pywrapfst.pyx":1599
* if self._fst.get().OutputSymbols() == NULL:
* return
* return _init_FstSymbolTable(const_cast[SymbolTable_ptr]( # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "pywrapfst.pyx":1596
+ /* "pywrapfst.pyx":1600
* return
* return _init_FstSymbolTable(const_cast[SymbolTable_ptr](
* self._fst.get().OutputSymbols()), self._fst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1596, __pyx_L1_error)
+ __PYX_ERR(0, 1600, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1595
+ /* "pywrapfst.pyx":1599
* if self._fst.get().OutputSymbols() == NULL:
* return
* return _init_FstSymbolTable(const_cast[SymbolTable_ptr]( # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1596, __pyx_L1_error)
+ __PYX_ERR(0, 1600, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1596
+ /* "pywrapfst.pyx":1600
* return
* return _init_FstSymbolTable(const_cast[SymbolTable_ptr](
* self._fst.get().OutputSymbols()), self._fst) # <<<<<<<<<<<<<<
*
* cpdef uint64 properties(self, uint64 mask, bool test):
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_fst.get()->OutputSymbols()), __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_fst.get()->OutputSymbols()), __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1592
+ /* "pywrapfst.pyx":1596
* return result
*
* cpdef _FstSymbolTable output_symbols(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("output_symbols", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1598
+/* "pywrapfst.pyx":1602
* self._fst.get().OutputSymbols()), self._fst)
*
* cpdef uint64 properties(self, uint64 mask, bool test): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1598, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_31properties)) {
- __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_test); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1598, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_test); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1602, __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, 1598, __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, 1602, __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, 1598, __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, 1602, __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, 1598, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1602, __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, 1598, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_9 = __Pyx_PyInt_As_uint64_t(__pyx_t_2); if (unlikely((__pyx_t_9 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1598, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyInt_As_uint64_t(__pyx_t_2); if (unlikely((__pyx_t_9 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_9;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1616
+ /* "pywrapfst.pyx":1620
* A 64-bit bitmask representing the requested properties.
* """
* return self._fst.get().Properties(mask, test) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1616, __pyx_L1_error)
+ __PYX_ERR(0, 1620, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->Properties(__pyx_v_mask, __pyx_v_test);
goto __pyx_L0;
- /* "pywrapfst.pyx":1598
+ /* "pywrapfst.pyx":1602
* self._fst.get().OutputSymbols()), self._fst)
*
* cpdef uint64 properties(self, uint64 mask, bool test): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_test)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, 1); __PYX_ERR(0, 1598, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, 1); __PYX_ERR(0, 1602, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "properties") < 0)) __PYX_ERR(0, 1598, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "properties") < 0)) __PYX_ERR(0, 1602, __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_mask = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1598, __pyx_L3_error)
- __pyx_v_test = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_test == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1598, __pyx_L3_error)
+ __pyx_v_mask = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
+ __pyx_v_test = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_test == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1598, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1602, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._Fst.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("properties", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_f_9pywrapfst_4_Fst_properties(__pyx_v_self, __pyx_v_mask, __pyx_v_test, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1598, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_f_9pywrapfst_4_Fst_properties(__pyx_v_self, __pyx_v_mask, __pyx_v_test, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1618
+/* "pywrapfst.pyx":1622
* return self._fst.get().Properties(mask, test)
*
* cpdef int64 start(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_33start)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1618, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1622, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1618, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1622, __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, 1618, __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, 1622, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1619
+ /* "pywrapfst.pyx":1623
*
* cpdef int64 start(self):
* return self._fst.get().Start() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1619, __pyx_L1_error)
+ __PYX_ERR(0, 1623, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->Start();
goto __pyx_L0;
- /* "pywrapfst.pyx":1618
+ /* "pywrapfst.pyx":1622
* return self._fst.get().Properties(mask, test)
*
* cpdef int64 start(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("start", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_4_Fst_start(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_4_Fst_start(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1621
+/* "pywrapfst.pyx":1625
* return self._fst.get().Start()
*
* cpdef StateIterator states(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1621, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1625, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_35states)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1621, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1625, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1621, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1625, __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_StateIterator))))) __PYX_ERR(0, 1621, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_StateIterator))))) __PYX_ERR(0, 1625, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1632
+ /* "pywrapfst.pyx":1636
* See also: `arcs`, `mutable_arcs`.
* """
* return StateIterator(self) # <<<<<<<<<<<<<<
* cpdef string text(self, _SymbolTable isymbols=None,
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1632, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1636, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_StateIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1632, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_StateIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1636, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = ((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1621
+ /* "pywrapfst.pyx":1625
* return self._fst.get().Start()
*
* cpdef StateIterator states(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("states", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1621, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1625, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1634
+/* "pywrapfst.pyx":1638
* return StateIterator(self)
*
* cpdef string text(self, _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_4_Fst_text *__pyx_optional_args) {
struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":1635
+ /* "pywrapfst.pyx":1639
*
* cpdef string text(self, _SymbolTable isymbols=None,
* _SymbolTable osymbols=None, _SymbolTable ssymbols=None, # <<<<<<<<<<<<<<
struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":1636
+ /* "pywrapfst.pyx":1640
* cpdef string text(self, _SymbolTable isymbols=None,
* _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
* bool acceptor=False, bool show_weight_one=False, missing_sym=b""): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1634
+ /* "pywrapfst.pyx":1638
* return StateIterator(self)
*
* cpdef string text(self, _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1634, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1638, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_37text)) {
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1634, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1638, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1634, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1638, __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[7] = {__pyx_t_6, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_3, __pyx_t_4, __pyx_v_missing_sym};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 6+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1634, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 6+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1638, __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[7] = {__pyx_t_6, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_3, __pyx_t_4, __pyx_v_missing_sym};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 6+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1634, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 6+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1638, __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(6+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1634, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(6+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1638, __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, 5+__pyx_t_7, __pyx_v_missing_sym);
__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, 1634, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1638, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1634, __pyx_L1_error)
+ __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1638, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_9;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1659
+ /* "pywrapfst.pyx":1663
* """
* # Prints FST to stringstream, then returns resulting string.
* cdef fst.SymbolTable *ssymbols_ptr = NULL # <<<<<<<<<<<<<<
*/
__pyx_v_ssymbols_ptr = NULL;
- /* "pywrapfst.pyx":1660
+ /* "pywrapfst.pyx":1664
* # Prints FST to stringstream, then returns resulting string.
* cdef fst.SymbolTable *ssymbols_ptr = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_11 = (__pyx_t_10 != 0);
if (__pyx_t_11) {
- /* "pywrapfst.pyx":1661
+ /* "pywrapfst.pyx":1665
* cdef fst.SymbolTable *ssymbols_ptr = NULL
* if ssymbols is not None:
* ssymbols_ptr = ssymbols._table # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1661, __pyx_L1_error)
+ __PYX_ERR(0, 1665, __pyx_L1_error)
}
__pyx_t_12 = __pyx_v_ssymbols->_table;
__pyx_v_ssymbols_ptr = __pyx_t_12;
- /* "pywrapfst.pyx":1660
+ /* "pywrapfst.pyx":1664
* # Prints FST to stringstream, then returns resulting string.
* cdef fst.SymbolTable *ssymbols_ptr = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1663
+ /* "pywrapfst.pyx":1667
* ssymbols_ptr = ssymbols._table
* cdef stringstream sstrm
* fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>", # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1663, __pyx_L1_error)
+ __PYX_ERR(0, 1667, __pyx_L1_error)
}
- __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_pywrapfst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1663, __pyx_L1_error)
+ __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_pywrapfst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1667, __pyx_L1_error)
- /* "pywrapfst.pyx":1664
+ /* "pywrapfst.pyx":1668
* cdef stringstream sstrm
* fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>",
* self._fst.get().InputSymbols() if isymbols is None # <<<<<<<<<<<<<<
if ((__pyx_t_11 != 0)) {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1664, __pyx_L1_error)
+ __PYX_ERR(0, 1668, __pyx_L1_error)
}
__pyx_t_13 = __pyx_v_self->_fst.get()->InputSymbols();
} else {
- /* "pywrapfst.pyx":1665
+ /* "pywrapfst.pyx":1669
* fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>",
* self._fst.get().InputSymbols() if isymbols is None
* else isymbols._table, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1665, __pyx_L1_error)
+ __PYX_ERR(0, 1669, __pyx_L1_error)
}
__pyx_t_13 = __pyx_v_isymbols->_table;
}
- /* "pywrapfst.pyx":1666
+ /* "pywrapfst.pyx":1670
* self._fst.get().InputSymbols() if isymbols is None
* else isymbols._table,
* self._fst.get().OutputSymbols() if osymbols is None # <<<<<<<<<<<<<<
if ((__pyx_t_11 != 0)) {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1666, __pyx_L1_error)
+ __PYX_ERR(0, 1670, __pyx_L1_error)
}
__pyx_t_14 = __pyx_v_self->_fst.get()->OutputSymbols();
} else {
- /* "pywrapfst.pyx":1667
+ /* "pywrapfst.pyx":1671
* else isymbols._table,
* self._fst.get().OutputSymbols() if osymbols is None
* else osymbols._table, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1667, __pyx_L1_error)
+ __PYX_ERR(0, 1671, __pyx_L1_error)
}
__pyx_t_14 = __pyx_v_osymbols->_table;
}
- /* "pywrapfst.pyx":1668
+ /* "pywrapfst.pyx":1672
* self._fst.get().OutputSymbols() if osymbols is None
* else osymbols._table,
* ssymbols_ptr, acceptor, show_weight_one, tostring(missing_sym)) # <<<<<<<<<<<<<<
* return sstrm.str()
*
*/
- __pyx_t_15 = __pyx_f_9pywrapfst_tostring(__pyx_v_missing_sym, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1668, __pyx_L1_error)
+ __pyx_t_15 = __pyx_f_9pywrapfst_tostring(__pyx_v_missing_sym, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1672, __pyx_L1_error)
- /* "pywrapfst.pyx":1663
+ /* "pywrapfst.pyx":1667
* ssymbols_ptr = ssymbols._table
* cdef stringstream sstrm
* fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>", # <<<<<<<<<<<<<<
*/
fst::script::PrintFst((*__pyx_v_self->_fst), __pyx_v_sstrm, __pyx_t_9, __pyx_t_13, __pyx_t_14, __pyx_v_ssymbols_ptr, __pyx_v_acceptor, __pyx_v_show_weight_one, __pyx_t_15);
- /* "pywrapfst.pyx":1669
+ /* "pywrapfst.pyx":1673
* else osymbols._table,
* ssymbols_ptr, acceptor, show_weight_one, tostring(missing_sym))
* return sstrm.str() # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_sstrm.str();
goto __pyx_L0;
- /* "pywrapfst.pyx":1634
+ /* "pywrapfst.pyx":1638
* return StateIterator(self)
*
* cpdef string text(self, _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
PyObject* values[6] = {0,0,0,0,0,0};
values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":1635
+ /* "pywrapfst.pyx":1639
*
* cpdef string text(self, _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, "text") < 0)) __PYX_ERR(0, 1634, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text") < 0)) __PYX_ERR(0, 1638, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[1]);
__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[2]);
if (values[3]) {
- __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1640, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1636
+ /* "pywrapfst.pyx":1640
* cpdef string text(self, _SymbolTable isymbols=None,
* _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
* bool acceptor=False, bool show_weight_one=False, missing_sym=b""): # <<<<<<<<<<<<<<
__pyx_v_acceptor = ((bool)0);
}
if (values[4]) {
- __pyx_v_show_weight_one = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_show_weight_one == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L3_error)
+ __pyx_v_show_weight_one = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_show_weight_one == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1640, __pyx_L3_error)
} else {
__pyx_v_show_weight_one = ((bool)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("text", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1634, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("text", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1638, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._Fst.text", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1634, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1635, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1635, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1638, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1639, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1639, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_4_Fst_36text(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), __pyx_v_isymbols, __pyx_v_osymbols, __pyx_v_ssymbols, __pyx_v_acceptor, __pyx_v_show_weight_one, __pyx_v_missing_sym);
- /* "pywrapfst.pyx":1634
+ /* "pywrapfst.pyx":1638
* return StateIterator(self)
*
* cpdef string text(self, _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
__pyx_t_2.show_weight_one = __pyx_v_show_weight_one;
__pyx_t_2.missing_sym = __pyx_v_missing_sym;
__pyx_t_1 = __pyx_vtabptr_9pywrapfst__Fst->text(__pyx_v_self, 1, &__pyx_t_2);
- __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1634, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1638, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1671
+/* "pywrapfst.pyx":1675
* return sstrm.str()
*
* cpdef bool verify(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_verify); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1671, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_verify); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_39verify)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1671, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1675, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1671, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1675, __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, 1671, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1675, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1680
+ /* "pywrapfst.pyx":1684
* True if the contents are sane, False otherwise.
* """
* return fst.Verify(deref(self._fst)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1680, __pyx_L1_error)
+ __PYX_ERR(0, 1684, __pyx_L1_error)
}
__pyx_r = fst::script::Verify((*__pyx_v_self->_fst));
goto __pyx_L0;
- /* "pywrapfst.pyx":1671
+ /* "pywrapfst.pyx":1675
* return sstrm.str()
*
* cpdef bool verify(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("verify", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_4_Fst_verify(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1671, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_4_Fst_verify(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1682
+/* "pywrapfst.pyx":1686
* return fst.Verify(deref(self._fst))
*
* cpdef string weight_type(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1686, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_41weight_type)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1686, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1686, __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, 1682, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1686, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1691
+ /* "pywrapfst.pyx":1695
* A string representing the weight type.
* """
* return self._fst.get().WeightType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1691, __pyx_L1_error)
+ __PYX_ERR(0, 1695, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->WeightType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1682
+ /* "pywrapfst.pyx":1686
* return fst.Verify(deref(self._fst))
*
* cpdef string weight_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("weight_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1686, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1693
+/* "pywrapfst.pyx":1697
* return self._fst.get().WeightType()
*
* cpdef void write(self, filename) except *: # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1693, __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, 1697, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_43write)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1697, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1697, __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[2] = {__pyx_t_4, __pyx_v_filename};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1697, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1693, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1697, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(__pyx_v_filename);
__Pyx_GIVEREF(__pyx_v_filename);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_filename);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1697, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1707
+ /* "pywrapfst.pyx":1711
* FstIOError: Write failed.
* """
* if not self._fst.get().Write(tostring(filename)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1707, __pyx_L1_error)
+ __PYX_ERR(0, 1711, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1707, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1711, __pyx_L1_error)
__pyx_t_7 = ((!(__pyx_v_self->_fst.get()->Write(__pyx_t_6) != 0)) != 0);
if (__pyx_t_7) {
- /* "pywrapfst.pyx":1708
+ /* "pywrapfst.pyx":1712
* """
* if not self._fst.get().Write(tostring(filename)):
* raise FstIOError("Write failed: {!r}".format(filename)) # <<<<<<<<<<<<<<
*
* cpdef string WriteToString(self):
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1708, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1708, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
}
if (!__pyx_t_4) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1708, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1708, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1708, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1708, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(__pyx_v_filename);
__Pyx_GIVEREF(__pyx_v_filename);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1708, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_5) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1708, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1712, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1708, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1712, __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[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1708, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1712, __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_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1708, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1708, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 1708, __pyx_L1_error)
+ __PYX_ERR(0, 1712, __pyx_L1_error)
- /* "pywrapfst.pyx":1707
+ /* "pywrapfst.pyx":1711
* FstIOError: Write failed.
* """
* if not self._fst.get().Write(tostring(filename)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1693
+ /* "pywrapfst.pyx":1697
* return self._fst.get().WeightType()
*
* cpdef void write(self, filename) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("write", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_4_Fst_write(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1693, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1693, __pyx_L1_error)
+ __pyx_f_9pywrapfst_4_Fst_write(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1697, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1697, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1710
+/* "pywrapfst.pyx":1714
* raise FstIOError("Write failed: {!r}".format(filename))
*
* cpdef string WriteToString(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_WriteToString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_WriteToString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1714, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_45WriteToString)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1714, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1714, __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, 1710, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1714, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1711
+ /* "pywrapfst.pyx":1715
*
* cpdef string WriteToString(self):
* return self._fst.get().WriteToString() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1711, __pyx_L1_error)
+ __PYX_ERR(0, 1715, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->WriteToString();
goto __pyx_L0;
- /* "pywrapfst.pyx":1710
+ /* "pywrapfst.pyx":1714
* raise FstIOError("Write failed: {!r}".format(filename))
*
* cpdef string WriteToString(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("WriteToString", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_WriteToString(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_WriteToString(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1714, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1724
+/* "pywrapfst.pyx":1728
* """
*
* cdef void _check_mutating_imethod(self) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("_check_mutating_imethod", 0);
- /* "pywrapfst.pyx":1729
+ /* "pywrapfst.pyx":1733
* This function is not visible to Python users.
* """
* if self._fst.get().Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1729, __pyx_L1_error)
+ __PYX_ERR(0, 1733, __pyx_L1_error)
}
__pyx_t_1 = ((__pyx_v_self->__pyx_base._fst.get()->Properties(fst::kError, 1) == fst::kError) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":1730
+ /* "pywrapfst.pyx":1734
* """
* if self._fst.get().Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed") # <<<<<<<<<<<<<<
*
* cdef void _add_arc(self, int64 state, Arc arc) except *:
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1730, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1734, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1730, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1734, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 1730, __pyx_L1_error)
+ __PYX_ERR(0, 1734, __pyx_L1_error)
- /* "pywrapfst.pyx":1729
+ /* "pywrapfst.pyx":1733
* This function is not visible to Python users.
* """
* if self._fst.get().Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1724
+ /* "pywrapfst.pyx":1728
* """
*
* cdef void _check_mutating_imethod(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1732
+/* "pywrapfst.pyx":1736
* raise FstOpError("Operation failed")
*
* cdef void _add_arc(self, int64 state, Arc arc) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("_add_arc", 0);
- /* "pywrapfst.pyx":1733
+ /* "pywrapfst.pyx":1737
*
* cdef void _add_arc(self, int64 state, Arc arc) except *:
* if not self._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1733, __pyx_L1_error)
+ __PYX_ERR(0, 1737, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->__pyx_base._fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":1734
+ /* "pywrapfst.pyx":1738
* cdef void _add_arc(self, int64 state, Arc arc) except *:
* if not self._fst.get().ValidStateId(state):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* if not self._mfst.get().AddArc(state, deref(arc._arc)):
* raise FstOpError("Incompatible or invalid weight type")
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1734, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1738, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1734, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1738, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 1734, __pyx_L1_error)
+ __PYX_ERR(0, 1738, __pyx_L1_error)
- /* "pywrapfst.pyx":1733
+ /* "pywrapfst.pyx":1737
*
* cdef void _add_arc(self, int64 state, Arc arc) except *:
* if not self._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1735
+ /* "pywrapfst.pyx":1739
* if not self._fst.get().ValidStateId(state):
* raise FstIndexError("State index out of range")
* if not self._mfst.get().AddArc(state, deref(arc._arc)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 1735, __pyx_L1_error)
+ __PYX_ERR(0, 1739, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
- __PYX_ERR(0, 1735, __pyx_L1_error)
+ __PYX_ERR(0, 1739, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->AddArc(__pyx_v_state, (*__pyx_v_arc->_arc)) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":1736
+ /* "pywrapfst.pyx":1740
* raise FstIndexError("State index out of range")
* if not self._mfst.get().AddArc(state, deref(arc._arc)):
* raise FstOpError("Incompatible or invalid weight type") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1736, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1740, __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, 1736, __pyx_L1_error)
+ __PYX_ERR(0, 1740, __pyx_L1_error)
- /* "pywrapfst.pyx":1735
+ /* "pywrapfst.pyx":1739
* if not self._fst.get().ValidStateId(state):
* raise FstIndexError("State index out of range")
* if not self._mfst.get().AddArc(state, deref(arc._arc)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1737
+ /* "pywrapfst.pyx":1741
* if not self._mfst.get().AddArc(state, deref(arc._arc)):
* raise FstOpError("Incompatible or invalid weight type")
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1737, __pyx_L1_error)
+ __PYX_ERR(0, 1741, __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, 1737, __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, 1741, __pyx_L1_error)
- /* "pywrapfst.pyx":1732
+ /* "pywrapfst.pyx":1736
* raise FstOpError("Operation failed")
*
* cdef void _add_arc(self, int64 state, Arc arc) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1739
+/* "pywrapfst.pyx":1743
* self._check_mutating_imethod()
*
* def add_arc(self, int64 state, Arc arc): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arc)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, 1); __PYX_ERR(0, 1739, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, 1); __PYX_ERR(0, 1743, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_arc") < 0)) __PYX_ERR(0, 1739, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_arc") < 0)) __PYX_ERR(0, 1743, __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, 1739, __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, 1743, __pyx_L3_error)
__pyx_v_arc = ((struct __pyx_obj_9pywrapfst_Arc *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1739, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1743, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.add_arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1739, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1743, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_add_arc(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_arc);
/* function exit code */
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_arc", 0);
- /* "pywrapfst.pyx":1758
+ /* "pywrapfst.pyx":1762
* See also: `add_state`.
* """
* self._add_arc(state, arc) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_add_arc");
- __PYX_ERR(0, 1758, __pyx_L1_error)
+ __PYX_ERR(0, 1762, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_add_arc(__pyx_v_self, __pyx_v_state, __pyx_v_arc); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1758, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_add_arc(__pyx_v_self, __pyx_v_state, __pyx_v_arc); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1762, __pyx_L1_error)
- /* "pywrapfst.pyx":1759
+ /* "pywrapfst.pyx":1763
* """
* self._add_arc(state, arc)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1739
+ /* "pywrapfst.pyx":1743
* self._check_mutating_imethod()
*
* def add_arc(self, int64 state, Arc arc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1761
+/* "pywrapfst.pyx":1765
* return self
*
* cpdef int64 add_state(self) except *: # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1761, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1765, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_3add_state)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1765, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1765, __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, 1761, __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, 1765, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1772
+ /* "pywrapfst.pyx":1776
* See also: `add_arc`, `set_start`, `set_final`.
* """
* cdef int64 result = self._mfst.get().AddState() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 1772, __pyx_L1_error)
+ __PYX_ERR(0, 1776, __pyx_L1_error)
}
__pyx_v_result = __pyx_v_self->_mfst.get()->AddState();
- /* "pywrapfst.pyx":1773
+ /* "pywrapfst.pyx":1777
* """
* cdef int64 result = self._mfst.get().AddState()
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1773, __pyx_L1_error)
+ __PYX_ERR(0, 1777, __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, 1773, __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, 1777, __pyx_L1_error)
- /* "pywrapfst.pyx":1774
+ /* "pywrapfst.pyx":1778
* cdef int64 result = self._mfst.get().AddState()
* self._check_mutating_imethod()
* return result # <<<<<<<<<<<<<<
*
- * cdef void _arcsort(self, st=b"ilabel") except *:
+ * cdef void _arcsort(self, sort_type=b"ilabel") except *:
*/
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1761
+ /* "pywrapfst.pyx":1765
* return self
*
* cpdef int64 add_state(self) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("add_state", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_11_MutableFst_add_state(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1761, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_11_MutableFst_add_state(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1765, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1765, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1776
+/* "pywrapfst.pyx":1780
* return result
*
- * cdef void _arcsort(self, st=b"ilabel") except *: # <<<<<<<<<<<<<<
- * cdef fst.ArcSortType sort_type
- * if not fst.GetArcSortType(tostring(st), addr(sort_type)):
+ * 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)):
*/
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) {
- PyObject *__pyx_v_st = ((PyObject *)__pyx_n_b_ilabel);
- enum fst::script::ArcSortType __pyx_v_sort_type;
+ PyObject *__pyx_v_sort_type = ((PyObject *)__pyx_n_b_ilabel);
+ enum fst::script::ArcSortType __pyx_v_sort_type_enum;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
__Pyx_RefNannySetupContext("_arcsort", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
- __pyx_v_st = __pyx_optional_args->st;
+ __pyx_v_sort_type = __pyx_optional_args->sort_type;
}
}
- /* "pywrapfst.pyx":1778
- * cdef void _arcsort(self, st=b"ilabel") except *:
- * cdef fst.ArcSortType sort_type
- * if not fst.GetArcSortType(tostring(st), addr(sort_type)): # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1782
+ * 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)
+ * fst.ArcSort(self._mfst.get(), sort_type_enum)
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_st, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1778, __pyx_L1_error)
- __pyx_t_2 = ((!(fst::script::GetArcSortType(__pyx_t_1, (&__pyx_v_sort_type)) != 0)) != 0);
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_sort_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1782, __pyx_L1_error)
+ __pyx_t_2 = ((!(fst::script::GetArcSortType(__pyx_t_1, (&__pyx_v_sort_type_enum)) != 0)) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":1779
- * cdef fst.ArcSortType sort_type
- * if not fst.GetArcSortType(tostring(st), addr(sort_type)):
+ /* "pywrapfst.pyx":1783
+ * 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)
+ * fst.ArcSort(self._mfst.get(), sort_type_enum)
* self._check_mutating_imethod()
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1779, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_sort_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1779, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_sort_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyInt_From_enum__fst_3a__3a_script_3a__3a_ArcSortType(__pyx_v_sort_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1779, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = NULL;
+ __pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_8)) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- if (!__pyx_t_8) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1779, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (!__pyx_t_7) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_sort_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1779, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_sort_type};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1783, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1779, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_sort_type};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1783, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
{
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1779, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1779, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1783, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ __Pyx_INCREF(__pyx_v_sort_type);
+ __Pyx_GIVEREF(__pyx_v_sort_type);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_sort_type);
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
}
if (!__pyx_t_6) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1783, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1783, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1783, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1779, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1783, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__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, 1779, __pyx_L1_error)
+ __PYX_ERR(0, 1783, __pyx_L1_error)
- /* "pywrapfst.pyx":1778
- * cdef void _arcsort(self, st=b"ilabel") except *:
- * cdef fst.ArcSortType sort_type
- * if not fst.GetArcSortType(tostring(st), addr(sort_type)): # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1782
+ * 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)
+ * fst.ArcSort(self._mfst.get(), sort_type_enum)
*/
}
- /* "pywrapfst.pyx":1780
- * if not fst.GetArcSortType(tostring(st), addr(sort_type)):
+ /* "pywrapfst.pyx":1784
+ * 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) # <<<<<<<<<<<<<<
+ * 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 '%s'", "_mfst");
- __PYX_ERR(0, 1780, __pyx_L1_error)
+ __PYX_ERR(0, 1784, __pyx_L1_error)
}
- fst::script::ArcSort(__pyx_v_self->_mfst.get(), __pyx_v_sort_type);
+ fst::script::ArcSort(__pyx_v_self->_mfst.get(), __pyx_v_sort_type_enum);
- /* "pywrapfst.pyx":1781
+ /* "pywrapfst.pyx":1785
* raise FstArgError("Unknown sort type {!r}".format(sort_type))
- * fst.ArcSort(self._mfst.get(), sort_type)
+ * fst.ArcSort(self._mfst.get(), sort_type_enum)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*
- * def arcsort(self, st=b"ilabel"):
+ * def arcsort(self, sort_type=b"ilabel"):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1781, __pyx_L1_error)
+ __PYX_ERR(0, 1785, __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, 1781, __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, 1785, __pyx_L1_error)
- /* "pywrapfst.pyx":1776
+ /* "pywrapfst.pyx":1780
* return result
*
- * cdef void _arcsort(self, st=b"ilabel") except *: # <<<<<<<<<<<<<<
- * cdef fst.ArcSortType sort_type
- * if not fst.GetArcSortType(tostring(st), addr(sort_type)):
+ * 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)):
*/
/* function exit code */
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("pywrapfst._MutableFst._arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1783
+/* "pywrapfst.pyx":1787
* self._check_mutating_imethod()
*
- * def arcsort(self, st=b"ilabel"): # <<<<<<<<<<<<<<
+ * def arcsort(self, sort_type=b"ilabel"): # <<<<<<<<<<<<<<
* """
- * arcsort(self, st="ilabel")
+ * arcsort(self, sort_type="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, st=\"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 st: 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\n See also: `topsort`.\n ";
+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\n See also: `topsort`.\n ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_5arcsort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_st = 0;
+ PyObject *__pyx_v_sort_type = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("arcsort (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_st,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sort_type,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)__pyx_n_b_ilabel);
if (unlikely(__pyx_kwds)) {
switch (pos_args) {
case 0:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_st);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sort_type);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 1783, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 1787, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_st = values[0];
+ __pyx_v_sort_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("arcsort", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1783, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("arcsort", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1787, __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_st);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_4arcsort(((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_st) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_4arcsort(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":1804
+ /* "pywrapfst.pyx":1808
* See also: `topsort`.
* """
- * self._arcsort(st) # <<<<<<<<<<<<<<
+ * self._arcsort(sort_type) # <<<<<<<<<<<<<<
* return self
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arcsort");
- __PYX_ERR(0, 1804, __pyx_L1_error)
+ __PYX_ERR(0, 1808, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 1;
- __pyx_t_1.st = __pyx_v_st;
- ((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, 1804, __pyx_L1_error)
+ __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, 1808, __pyx_L1_error)
- /* "pywrapfst.pyx":1805
+ /* "pywrapfst.pyx":1809
* """
- * self._arcsort(st)
+ * self._arcsort(sort_type)
* return self # <<<<<<<<<<<<<<
*
* cdef void _closure(self, bool closure_plus=False) except *:
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1783
+ /* "pywrapfst.pyx":1787
* self._check_mutating_imethod()
*
- * def arcsort(self, st=b"ilabel"): # <<<<<<<<<<<<<<
+ * def arcsort(self, sort_type=b"ilabel"): # <<<<<<<<<<<<<<
* """
- * arcsort(self, st="ilabel")
+ * arcsort(self, sort_type="ilabel")
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":1807
+/* "pywrapfst.pyx":1811
* return self
*
* cdef void _closure(self, bool closure_plus=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1808
+ /* "pywrapfst.pyx":1812
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 1808, __pyx_L1_error)
+ __PYX_ERR(0, 1812, __pyx_L1_error)
}
fst::script::Closure(__pyx_v_self->_mfst.get(), fst::script::GetClosureType(__pyx_v_closure_plus));
- /* "pywrapfst.pyx":1809
+ /* "pywrapfst.pyx":1813
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1809, __pyx_L1_error)
+ __PYX_ERR(0, 1813, __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, 1809, __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, 1813, __pyx_L1_error)
- /* "pywrapfst.pyx":1807
+ /* "pywrapfst.pyx":1811
* return self
*
* cdef void _closure(self, bool closure_plus=False) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1811
+/* "pywrapfst.pyx":1815
* self._check_mutating_imethod()
*
* def closure(self, bool closure_plus=False): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "closure") < 0)) __PYX_ERR(0, 1811, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "closure") < 0)) __PYX_ERR(0, 1815, __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, 1811, __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, 1815, __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, 1811, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("closure", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1815, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.closure", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure __pyx_t_1;
__Pyx_RefNannySetupContext("closure", 0);
- /* "pywrapfst.pyx":1829
+ /* "pywrapfst.pyx":1833
* self.
* """
* self._closure(closure_plus) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_closure");
- __PYX_ERR(0, 1829, __pyx_L1_error)
+ __PYX_ERR(0, 1833, __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, 1829, __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, 1833, __pyx_L1_error)
- /* "pywrapfst.pyx":1830
+ /* "pywrapfst.pyx":1834
* """
* self._closure(closure_plus)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1811
+ /* "pywrapfst.pyx":1815
* self._check_mutating_imethod()
*
* def closure(self, bool closure_plus=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1832
+/* "pywrapfst.pyx":1836
* return self
*
* cdef void _concat(self, _Fst ifst) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_concat", 0);
- /* "pywrapfst.pyx":1833
+ /* "pywrapfst.pyx":1837
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 1833, __pyx_L1_error)
+ __PYX_ERR(0, 1837, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1833, __pyx_L1_error)
+ __PYX_ERR(0, 1837, __pyx_L1_error)
}
fst::script::Concat(__pyx_v_self->_mfst.get(), (*__pyx_v_ifst->_fst));
- /* "pywrapfst.pyx":1834
+ /* "pywrapfst.pyx":1838
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1834, __pyx_L1_error)
+ __PYX_ERR(0, 1838, __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, 1834, __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, 1838, __pyx_L1_error)
- /* "pywrapfst.pyx":1832
+ /* "pywrapfst.pyx":1836
* return self
*
* cdef void _concat(self, _Fst ifst) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1836
+/* "pywrapfst.pyx":1840
* self._check_mutating_imethod()
*
* def concat(self, _Fst 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, 1836, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 1840, __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));
/* function exit code */
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("concat", 0);
- /* "pywrapfst.pyx":1853
+ /* "pywrapfst.pyx":1857
* self.
* """
* self._concat(ifst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_concat");
- __PYX_ERR(0, 1853, __pyx_L1_error)
+ __PYX_ERR(0, 1857, __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, 1853, __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, 1857, __pyx_L1_error)
- /* "pywrapfst.pyx":1854
+ /* "pywrapfst.pyx":1858
* """
* self._concat(ifst)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1836
+ /* "pywrapfst.pyx":1840
* self._check_mutating_imethod()
*
* def concat(self, _Fst ifst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1856
+/* "pywrapfst.pyx":1860
* return self
*
* cdef void _connect(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_connect", 0);
- /* "pywrapfst.pyx":1857
+ /* "pywrapfst.pyx":1861
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 1857, __pyx_L1_error)
+ __PYX_ERR(0, 1861, __pyx_L1_error)
}
fst::script::Connect(__pyx_v_self->_mfst.get());
- /* "pywrapfst.pyx":1858
+ /* "pywrapfst.pyx":1862
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1858, __pyx_L1_error)
+ __PYX_ERR(0, 1862, __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, 1858, __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, 1862, __pyx_L1_error)
- /* "pywrapfst.pyx":1856
+ /* "pywrapfst.pyx":1860
* return self
*
* cdef void _connect(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1860
+/* "pywrapfst.pyx":1864
* self._check_mutating_imethod()
*
* def connect(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("connect", 0);
- /* "pywrapfst.pyx":1872
+ /* "pywrapfst.pyx":1876
* self.
* """
* self._connect() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_connect");
- __PYX_ERR(0, 1872, __pyx_L1_error)
+ __PYX_ERR(0, 1876, __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, 1872, __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, 1876, __pyx_L1_error)
- /* "pywrapfst.pyx":1873
+ /* "pywrapfst.pyx":1877
* """
* self._connect()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1860
+ /* "pywrapfst.pyx":1864
* self._check_mutating_imethod()
*
* def connect(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1875
+/* "pywrapfst.pyx":1879
* return self
*
* cdef void _decode(self, EncodeMapper encoder) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_decode", 0);
- /* "pywrapfst.pyx":1876
+ /* "pywrapfst.pyx":1880
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 1876, __pyx_L1_error)
+ __PYX_ERR(0, 1880, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_encoder) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1876, __pyx_L1_error)
+ __PYX_ERR(0, 1880, __pyx_L1_error)
}
fst::script::Decode(__pyx_v_self->_mfst.get(), (*__pyx_v_encoder->_encoder));
- /* "pywrapfst.pyx":1877
+ /* "pywrapfst.pyx":1881
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1877, __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, 1877, __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":1875
+ /* "pywrapfst.pyx":1879
* return self
*
* cdef void _decode(self, EncodeMapper encoder) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1879
+/* "pywrapfst.pyx":1883
* self._check_mutating_imethod()
*
* def decode(self, EncodeMapper 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, 1879, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 1883, __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));
/* function exit code */
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("decode", 0);
- /* "pywrapfst.pyx":1895
+ /* "pywrapfst.pyx":1899
* See also: `encode`.
* """
* self._decode(encoder) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_decode");
- __PYX_ERR(0, 1895, __pyx_L1_error)
+ __PYX_ERR(0, 1899, __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, 1895, __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, 1899, __pyx_L1_error)
- /* "pywrapfst.pyx":1896
+ /* "pywrapfst.pyx":1900
* """
* self._decode(encoder)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1879
+ /* "pywrapfst.pyx":1883
* self._check_mutating_imethod()
*
* def decode(self, EncodeMapper encoder): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1898
+/* "pywrapfst.pyx":1902
* return self
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1899
+ /* "pywrapfst.pyx":1903
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 1899, __pyx_L1_error)
+ __PYX_ERR(0, 1903, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state, __pyx_v_n);
} else {
- /* "pywrapfst.pyx":1900
+ /* "pywrapfst.pyx":1904
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 1900, __pyx_L1_error)
+ __PYX_ERR(0, 1904, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state);
}
- /* "pywrapfst.pyx":1899
+ /* "pywrapfst.pyx":1903
*
* 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 (__pyx_t_2) {
- /* "pywrapfst.pyx":1901
+ /* "pywrapfst.pyx":1905
* 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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1901, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1905, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1901, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1905, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 1901, __pyx_L1_error)
+ __PYX_ERR(0, 1905, __pyx_L1_error)
- /* "pywrapfst.pyx":1899
+ /* "pywrapfst.pyx":1903
*
* 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":1902
+ /* "pywrapfst.pyx":1906
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1902, __pyx_L1_error)
+ __PYX_ERR(0, 1906, __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, 1902, __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, 1906, __pyx_L1_error)
- /* "pywrapfst.pyx":1898
+ /* "pywrapfst.pyx":1902
* return self
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1904
+/* "pywrapfst.pyx":1908
* self._check_mutating_imethod()
*
* def delete_arcs(self, int64 state, size_t n=0): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_arcs") < 0)) __PYX_ERR(0, 1904, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_arcs") < 0)) __PYX_ERR(0, 1908, __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, 1904, __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, 1908, __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, 1904, __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, 1908, __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, 1904, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("delete_arcs", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1908, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.delete_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_arcs __pyx_t_1;
__Pyx_RefNannySetupContext("delete_arcs", 0);
- /* "pywrapfst.pyx":1924
+ /* "pywrapfst.pyx":1928
* 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 '%s'", "_delete_arcs");
- __PYX_ERR(0, 1924, __pyx_L1_error)
+ __PYX_ERR(0, 1928, __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, 1924, __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, 1928, __pyx_L1_error)
- /* "pywrapfst.pyx":1925
+ /* "pywrapfst.pyx":1929
* """
* self._delete_arcs(state, n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1904
+ /* "pywrapfst.pyx":1908
* self._check_mutating_imethod()
*
* def delete_arcs(self, int64 state, size_t n=0): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1927
+/* "pywrapfst.pyx":1931
* return self
*
* cdef void _delete_states(self, states=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1929
+ /* "pywrapfst.pyx":1933
* 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, 1929, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_states); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1933, __pyx_L1_error)
if (__pyx_t_1) {
- /* "pywrapfst.pyx":1930
+ /* "pywrapfst.pyx":1934
* # 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 '%s'", "_mfst");
- __PYX_ERR(0, 1930, __pyx_L1_error)
+ __PYX_ERR(0, 1934, __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, 1930, __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, 1934, __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 (__pyx_t_1) {
- /* "pywrapfst.pyx":1931
+ /* "pywrapfst.pyx":1935
* 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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1931, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1935, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1931, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1935, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 1931, __pyx_L1_error)
+ __PYX_ERR(0, 1935, __pyx_L1_error)
- /* "pywrapfst.pyx":1930
+ /* "pywrapfst.pyx":1934
* # Only the former signature has a possible indexing failure.
* if states:
* if not self._mfst.get().DeleteStates(<const vector[int64]> states): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1929
+ /* "pywrapfst.pyx":1933
* cdef void _delete_states(self, states=None) except *:
* # Only the former signature has a possible indexing failure.
* if states: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":1933
+ /* "pywrapfst.pyx":1937
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 1933, __pyx_L1_error)
+ __PYX_ERR(0, 1937, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->DeleteStates();
}
__pyx_L3:;
- /* "pywrapfst.pyx":1934
+ /* "pywrapfst.pyx":1938
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1934, __pyx_L1_error)
+ __PYX_ERR(0, 1938, __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, 1934, __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, 1938, __pyx_L1_error)
- /* "pywrapfst.pyx":1927
+ /* "pywrapfst.pyx":1931
* return self
*
* cdef void _delete_states(self, states=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1936
+/* "pywrapfst.pyx":1940
* self._check_mutating_imethod()
*
* def delete_states(self, states=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_states") < 0)) __PYX_ERR(0, 1936, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_states") < 0)) __PYX_ERR(0, 1940, __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, 1936, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("delete_states", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1940, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.delete_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_states __pyx_t_1;
__Pyx_RefNannySetupContext("delete_states", 0);
- /* "pywrapfst.pyx":1954
+ /* "pywrapfst.pyx":1958
* 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 '%s'", "_delete_states");
- __PYX_ERR(0, 1954, __pyx_L1_error)
+ __PYX_ERR(0, 1958, __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, 1954, __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, 1958, __pyx_L1_error)
- /* "pywrapfst.pyx":1955
+ /* "pywrapfst.pyx":1959
* """
* self._delete_states(states)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1936
+ /* "pywrapfst.pyx":1940
* self._check_mutating_imethod()
*
* def delete_states(self, states=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1957
+/* "pywrapfst.pyx":1961
* return self
*
* cdef void _encode(self, EncodeMapper encoder) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_encode", 0);
- /* "pywrapfst.pyx":1958
+ /* "pywrapfst.pyx":1962
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 1958, __pyx_L1_error)
+ __PYX_ERR(0, 1962, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_encoder) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1958, __pyx_L1_error)
+ __PYX_ERR(0, 1962, __pyx_L1_error)
}
fst::script::Encode(__pyx_v_self->_mfst.get(), __pyx_v_encoder->_encoder.get());
- /* "pywrapfst.pyx":1959
+ /* "pywrapfst.pyx":1963
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1959, __pyx_L1_error)
+ __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, 1959, __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)
- /* "pywrapfst.pyx":1957
+ /* "pywrapfst.pyx":1961
* return self
*
* cdef void _encode(self, EncodeMapper encoder) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1961
+/* "pywrapfst.pyx":1965
* self._check_mutating_imethod()
*
* def encode(self, EncodeMapper 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, 1961, __pyx_L1_error)
+ 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_18encode(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_encoder));
/* function exit code */
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("encode", 0);
- /* "pywrapfst.pyx":1982
+ /* "pywrapfst.pyx":1986
* See also: `decode`.
* """
* self._encode(encoder) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encode");
- __PYX_ERR(0, 1982, __pyx_L1_error)
+ __PYX_ERR(0, 1986, __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, 1982, __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, 1986, __pyx_L1_error)
- /* "pywrapfst.pyx":1983
+ /* "pywrapfst.pyx":1987
* """
* self._encode(encoder)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1961
+ /* "pywrapfst.pyx":1965
* self._check_mutating_imethod()
*
* def encode(self, EncodeMapper encoder): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1985
+/* "pywrapfst.pyx":1989
* return self
*
* cdef void _invert(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_invert", 0);
- /* "pywrapfst.pyx":1986
+ /* "pywrapfst.pyx":1990
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 1986, __pyx_L1_error)
+ __PYX_ERR(0, 1990, __pyx_L1_error)
}
fst::script::Invert(__pyx_v_self->_mfst.get());
- /* "pywrapfst.pyx":1987
+ /* "pywrapfst.pyx":1991
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1987, __pyx_L1_error)
+ __PYX_ERR(0, 1991, __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, 1987, __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, 1991, __pyx_L1_error)
- /* "pywrapfst.pyx":1985
+ /* "pywrapfst.pyx":1989
* return self
*
* cdef void _invert(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1989
+/* "pywrapfst.pyx":1993
* self._check_mutating_imethod()
*
* def invert(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("invert", 0);
- /* "pywrapfst.pyx":2001
+ /* "pywrapfst.pyx":2005
* self.
* """
* self._invert() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_invert");
- __PYX_ERR(0, 2001, __pyx_L1_error)
+ __PYX_ERR(0, 2005, __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, 2001, __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, 2005, __pyx_L1_error)
- /* "pywrapfst.pyx":2002
+ /* "pywrapfst.pyx":2006
* """
* self._invert()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1989
+ /* "pywrapfst.pyx":1993
* self._check_mutating_imethod()
*
* def invert(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2004
+/* "pywrapfst.pyx":2008
* return self
*
* cdef void _minimize(self, float delta=fst.kDelta, # <<<<<<<<<<<<<<
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":2005
+ /* "pywrapfst.pyx":2009
*
* cdef void _minimize(self, float delta=fst.kDelta,
* bool allow_nondet=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2007
+ /* "pywrapfst.pyx":2011
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2007, __pyx_L1_error)
+ __PYX_ERR(0, 2011, __pyx_L1_error)
}
fst::script::Minimize(__pyx_v_self->_mfst.get(), NULL, __pyx_v_delta, __pyx_v_allow_nondet);
- /* "pywrapfst.pyx":2008
+ /* "pywrapfst.pyx":2012
* # 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2008, __pyx_L1_error)
+ __PYX_ERR(0, 2012, __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, 2008, __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, 2012, __pyx_L1_error)
- /* "pywrapfst.pyx":2004
+ /* "pywrapfst.pyx":2008
* return self
*
* cdef void _minimize(self, float delta=fst.kDelta, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2010
+/* "pywrapfst.pyx":2014
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minimize") < 0)) __PYX_ERR(0, 2010, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minimize") < 0)) __PYX_ERR(0, 2014, __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, 2010, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2014, __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, 2010, __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, 2014, __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, 2010, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("minimize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2014, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.minimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
struct __pyx_opt_args_9pywrapfst_11_MutableFst__minimize __pyx_t_1;
__Pyx_RefNannySetupContext("minimize", 0);
- /* "pywrapfst.pyx":2036
+ /* "pywrapfst.pyx":2040
* self.
* """
* self._minimize(delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_minimize");
- __PYX_ERR(0, 2036, __pyx_L1_error)
+ __PYX_ERR(0, 2040, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 1;
__pyx_t_1.delta = __pyx_v_delta;
- ((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, 2036, __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, 2040, __pyx_L1_error)
- /* "pywrapfst.pyx":2037
+ /* "pywrapfst.pyx":2041
* """
* self._minimize(delta)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2010
+ /* "pywrapfst.pyx":2014
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2039
+/* "pywrapfst.pyx":2043
* return self
*
* cpdef MutableArcIterator mutable_arcs(self, int64 state): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mutable_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2039, __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, 2043, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_25mutable_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, 2039, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2043, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2043, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2043, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2043, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2039, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2043, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2043, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
}
__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, 2039, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_MutableArcIterator))))) __PYX_ERR(0, 2043, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":2054
+ /* "pywrapfst.pyx":2058
* 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, 2054, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2058, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2054, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2058, __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, 2054, __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, 2058, __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":2039
+ /* "pywrapfst.pyx":2043
* return self
*
* cpdef MutableArcIterator mutable_arcs(self, int64 state): # <<<<<<<<<<<<<<
__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, 2039, __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, 2043, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
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, 2039, __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, 2043, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2056
+/* "pywrapfst.pyx":2060
* return MutableArcIterator(self, state)
*
* def mutable_input_symbols(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("mutable_input_symbols", 0);
- /* "pywrapfst.pyx":2057
+ /* "pywrapfst.pyx":2061
*
* def mutable_input_symbols(self):
* cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 2057, __pyx_L1_error)
+ __PYX_ERR(0, 2061, __pyx_L1_error)
}
__pyx_v_tst = __pyx_v_self->_mfst.get()->MutableInputSymbols();
- /* "pywrapfst.pyx":2058
+ /* "pywrapfst.pyx":2062
* def mutable_input_symbols(self):
* cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols()
* if tst == NULL: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_tst == NULL) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2059
+ /* "pywrapfst.pyx":2063
* cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols()
* if tst == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":2058
+ /* "pywrapfst.pyx":2062
* def mutable_input_symbols(self):
* cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols()
* if tst == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2060
+ /* "pywrapfst.pyx":2064
* if tst == NULL:
* return
* return _init_MutableFstSymbolTable(tst, self._mfst) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 2060, __pyx_L1_error)
+ __PYX_ERR(0, 2064, __pyx_L1_error)
}
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_tst, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2060, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_tst, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2064, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2056
+ /* "pywrapfst.pyx":2060
* return MutableArcIterator(self, state)
*
* def mutable_input_symbols(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2062
+/* "pywrapfst.pyx":2066
* return _init_MutableFstSymbolTable(tst, self._mfst)
*
* def mutable_output_symbols(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("mutable_output_symbols", 0);
- /* "pywrapfst.pyx":2063
+ /* "pywrapfst.pyx":2067
*
* def mutable_output_symbols(self):
* cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 2063, __pyx_L1_error)
+ __PYX_ERR(0, 2067, __pyx_L1_error)
}
__pyx_v_tst = __pyx_v_self->_mfst.get()->MutableOutputSymbols();
- /* "pywrapfst.pyx":2064
+ /* "pywrapfst.pyx":2068
* def mutable_output_symbols(self):
* cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols()
* if tst == NULL: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_tst == NULL) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2065
+ /* "pywrapfst.pyx":2069
* cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols()
* if tst == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":2064
+ /* "pywrapfst.pyx":2068
* def mutable_output_symbols(self):
* cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols()
* if tst == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2066
+ /* "pywrapfst.pyx":2070
* if tst == NULL:
* return
* return _init_MutableFstSymbolTable(tst, self._mfst) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 2066, __pyx_L1_error)
+ __PYX_ERR(0, 2070, __pyx_L1_error)
}
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_tst, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2066, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_tst, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2070, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2062
+ /* "pywrapfst.pyx":2066
* return _init_MutableFstSymbolTable(tst, self._mfst)
*
* def mutable_output_symbols(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2068
+/* "pywrapfst.pyx":2072
* return _init_MutableFstSymbolTable(tst, self._mfst)
*
* cpdef int64 num_states(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2068, __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, 2072, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_31num_states)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2068, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2072, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2068, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2072, __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, 2068, __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, 2072, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":2069
+ /* "pywrapfst.pyx":2073
*
* cpdef int64 num_states(self):
* return self._mfst.get().NumStates() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 2069, __pyx_L1_error)
+ __PYX_ERR(0, 2073, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mfst.get()->NumStates();
goto __pyx_L0;
- /* "pywrapfst.pyx":2068
+ /* "pywrapfst.pyx":2072
* return _init_MutableFstSymbolTable(tst, self._mfst)
*
* cpdef int64 num_states(self): # <<<<<<<<<<<<<<
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, 2068, __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, 2072, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2071
+/* "pywrapfst.pyx":2075
* return self._mfst.get().NumStates()
*
* cdef void _project(self, bool project_output=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2072
+ /* "pywrapfst.pyx":2076
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2072, __pyx_L1_error)
+ __PYX_ERR(0, 2076, __pyx_L1_error)
}
fst::script::Project(__pyx_v_self->_mfst.get(), fst::script::GetProjectType(__pyx_v_project_output));
- /* "pywrapfst.pyx":2073
+ /* "pywrapfst.pyx":2077
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2073, __pyx_L1_error)
+ __PYX_ERR(0, 2077, __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, 2077, __pyx_L1_error)
- /* "pywrapfst.pyx":2071
+ /* "pywrapfst.pyx":2075
* return self._mfst.get().NumStates()
*
* cdef void _project(self, bool project_output=False) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2075
+/* "pywrapfst.pyx":2079
* self._check_mutating_imethod()
*
* def project(self, bool project_output=False): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "project") < 0)) __PYX_ERR(0, 2075, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "project") < 0)) __PYX_ERR(0, 2079, __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, 2075, __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, 2079, __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, 2075, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("project", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2079, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.project", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
struct __pyx_opt_args_9pywrapfst_11_MutableFst__project __pyx_t_1;
__Pyx_RefNannySetupContext("project", 0);
- /* "pywrapfst.pyx":2093
+ /* "pywrapfst.pyx":2097
* 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 '%s'", "_project");
- __PYX_ERR(0, 2093, __pyx_L1_error)
+ __PYX_ERR(0, 2097, __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, 2093, __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, 2097, __pyx_L1_error)
- /* "pywrapfst.pyx":2094
+ /* "pywrapfst.pyx":2098
* """
* self._project(project_output)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2075
+ /* "pywrapfst.pyx":2079
* self._check_mutating_imethod()
*
* def project(self, bool project_output=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2096
+/* "pywrapfst.pyx":2100
* 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":2097
+ /* "pywrapfst.pyx":2101
*
* cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId,
* weight=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2099
+ /* "pywrapfst.pyx":2103
* 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 '%s'", "weight_type");
- __PYX_ERR(0, 2099, __pyx_L1_error)
+ __PYX_ERR(0, 2103, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2100
+ /* "pywrapfst.pyx":2104
* # 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, 2099, __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, 2103, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":2101
+ /* "pywrapfst.pyx":2105
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2101, __pyx_L1_error)
+ __PYX_ERR(0, 2105, __pyx_L1_error)
}
fst::script::Prune(__pyx_v_self->_mfst.get(), __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":2102
+ /* "pywrapfst.pyx":2106
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2102, __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, 2102, __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":2096
+ /* "pywrapfst.pyx":2100
* return self
*
* cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2104
+/* "pywrapfst.pyx":2108
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
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":2107
+ /* "pywrapfst.pyx":2111
* 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, 2104, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 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, 2105, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2109, __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, 2106, __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, 2110, __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, 2104, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2108, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__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);
- /* "pywrapfst.pyx":2104
+ /* "pywrapfst.pyx":2108
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune __pyx_t_1;
__Pyx_RefNannySetupContext("prune", 0);
- /* "pywrapfst.pyx":2129
+ /* "pywrapfst.pyx":2133
* 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 '%s'", "_prune");
- __PYX_ERR(0, 2129, __pyx_L1_error)
+ __PYX_ERR(0, 2133, __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, 2129, __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, 2133, __pyx_L1_error)
- /* "pywrapfst.pyx":2130
+ /* "pywrapfst.pyx":2134
* """
* self._prune(delta, nstate, weight)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2104
+ /* "pywrapfst.pyx":2108
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2132
+/* "pywrapfst.pyx":2136
* 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":2134
+ /* "pywrapfst.pyx":2138
* cdef void _push(self,
* float delta=fst.kDelta,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_total_weight = ((bool)0);
- /* "pywrapfst.pyx":2135
+ /* "pywrapfst.pyx":2139
* float delta=fst.kDelta,
* bool remove_total_weight=False,
* bool to_final=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2136
+ /* "pywrapfst.pyx":2140
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2136, __pyx_L1_error)
+ __PYX_ERR(0, 2140, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2137
+ /* "pywrapfst.pyx":2141
* 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":2138
+ /* "pywrapfst.pyx":2142
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2138, __pyx_L1_error)
+ __PYX_ERR(0, 2142, __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, 2138, __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, 2142, __pyx_L1_error)
- /* "pywrapfst.pyx":2132
+ /* "pywrapfst.pyx":2136
* return self
*
* cdef void _push(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2140
+/* "pywrapfst.pyx":2144
* self._check_mutating_imethod()
*
* def push(self, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 2140, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 2144, __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, 2141, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2145, __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, 2142, __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, 2146, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2142
+ /* "pywrapfst.pyx":2146
* 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, 2143, __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, 2147, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2143
+ /* "pywrapfst.pyx":2147
* 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, 2140, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("push", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2144, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__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);
- /* "pywrapfst.pyx":2140
+ /* "pywrapfst.pyx":2144
* self._check_mutating_imethod()
*
* def push(self, # <<<<<<<<<<<<<<
struct __pyx_opt_args_9pywrapfst_11_MutableFst__push __pyx_t_1;
__Pyx_RefNannySetupContext("push", 0);
- /* "pywrapfst.pyx":2169
+ /* "pywrapfst.pyx":2173
* 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 '%s'", "_push");
- __PYX_ERR(0, 2169, __pyx_L1_error)
+ __PYX_ERR(0, 2173, __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, 2169, __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, 2173, __pyx_L1_error)
- /* "pywrapfst.pyx":2170
+ /* "pywrapfst.pyx":2174
* """
* self._push(delta, remove_total_weight, to_final)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2140
+ /* "pywrapfst.pyx":2144
* self._check_mutating_imethod()
*
* def push(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2172
+/* "pywrapfst.pyx":2176
* return self
*
* cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2174
+ /* "pywrapfst.pyx":2178
* 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, 2174, __pyx_L1_error)
+ __PYX_ERR(0, 2178, __pyx_L1_error)
}
__pyx_v__ipairs.reset(__pyx_t_1);
- /* "pywrapfst.pyx":2176
+ /* "pywrapfst.pyx":2180
* _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, 2176, __pyx_L1_error)
+ __PYX_ERR(0, 2180, __pyx_L1_error)
}
__pyx_v__opairs.reset(__pyx_t_1);
- /* "pywrapfst.pyx":2179
+ /* "pywrapfst.pyx":2183
* 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, 2179, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2183, __pyx_L1_error)
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2180
+ /* "pywrapfst.pyx":2184
* 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, 2180, __pyx_L1_error)
+ __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ipairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2184, __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, 2180, __pyx_L1_error)
+ __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2184, __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, 2180, __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, 2184, __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, 2180, __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, 2184, __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, 2180, __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, 2184, __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, 2180, __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, 2184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2180, __pyx_L1_error)
+ else __PYX_ERR(0, 2184, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 2180, __pyx_L1_error)
+ __PYX_ERR(0, 2184, __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, 2180, __pyx_L1_error)
+ __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2180, __pyx_L1_error)
+ __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2184, __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, 2180, __pyx_L1_error)
+ __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2184, __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, 2180, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2184, __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, 2180, __pyx_L1_error)
+ __PYX_ERR(0, 2184, __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, 2180, __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, 2184, __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, 2180, __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, 2184, __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":2181
+ /* "pywrapfst.pyx":2185
* 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, 2181, __pyx_L1_error)
+ __PYX_ERR(0, 2185, __pyx_L1_error)
}
try {
__pyx_v__ipairs.get()->push_back(__pyx_t_13);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2181, __pyx_L1_error)
+ __PYX_ERR(0, 2185, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2180
+ /* "pywrapfst.pyx":2184
* cdef int64 after
* if ipairs:
* for (before, after) in ipairs: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "pywrapfst.pyx":2179
+ /* "pywrapfst.pyx":2183
* cdef int64 before
* cdef int64 after
* if ipairs: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2182
+ /* "pywrapfst.pyx":2186
* 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, 2182, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2186, __pyx_L1_error)
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2183
+ /* "pywrapfst.pyx":2187
* _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, 2183, __pyx_L1_error)
+ __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_opairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2187, __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, 2183, __pyx_L1_error)
+ __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2187, __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, 2183, __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, 2187, __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, 2183, __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, 2187, __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, 2183, __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, 2187, __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, 2183, __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, 2187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2183, __pyx_L1_error)
+ else __PYX_ERR(0, 2187, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 2183, __pyx_L1_error)
+ __PYX_ERR(0, 2187, __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, 2183, __pyx_L1_error)
+ __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2183, __pyx_L1_error)
+ __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2187, __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, 2183, __pyx_L1_error)
+ __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2187, __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, 2183, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2187, __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, 2183, __pyx_L1_error)
+ __PYX_ERR(0, 2187, __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, 2183, __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, 2187, __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, 2183, __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, 2187, __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":2184
+ /* "pywrapfst.pyx":2188
* 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, 2184, __pyx_L1_error)
+ __PYX_ERR(0, 2188, __pyx_L1_error)
}
try {
__pyx_v__opairs.get()->push_back(__pyx_t_13);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2184, __pyx_L1_error)
+ __PYX_ERR(0, 2188, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2183
+ /* "pywrapfst.pyx":2187
* _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":2182
+ /* "pywrapfst.pyx":2186
* for (before, after) in ipairs:
* _ipairs.get().push_back(fst.LabelPair(before, after))
* if opairs: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2185
+ /* "pywrapfst.pyx":2189
* 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 (__pyx_t_2) {
- /* "pywrapfst.pyx":2186
+ /* "pywrapfst.pyx":2190
* _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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2186, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2186, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __PYX_ERR(0, 2186, __pyx_L1_error)
+ __PYX_ERR(0, 2190, __pyx_L1_error)
- /* "pywrapfst.pyx":2185
+ /* "pywrapfst.pyx":2189
* for (before, after) in opairs:
* _opairs.get().push_back(fst.LabelPair(before, after))
* if _ipairs.get().empty() and _opairs.get().empty(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2187
+ /* "pywrapfst.pyx":2191
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2187, __pyx_L1_error)
+ __PYX_ERR(0, 2191, __pyx_L1_error)
}
fst::script::Relabel(__pyx_v_self->_mfst.get(), (*__pyx_v__ipairs), (*__pyx_v__opairs));
- /* "pywrapfst.pyx":2188
+ /* "pywrapfst.pyx":2192
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2188, __pyx_L1_error)
+ __PYX_ERR(0, 2192, __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, 2188, __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, 2192, __pyx_L1_error)
- /* "pywrapfst.pyx":2172
+ /* "pywrapfst.pyx":2176
* return self
*
* cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2190
+/* "pywrapfst.pyx":2194
* self._check_mutating_imethod()
*
* def relabel_pairs(self, ipairs=None, opairs=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_pairs") < 0)) __PYX_ERR(0, 2190, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_pairs") < 0)) __PYX_ERR(0, 2194, __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, 2190, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("relabel_pairs", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2194, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_pairs __pyx_t_1;
__Pyx_RefNannySetupContext("relabel_pairs", 0);
- /* "pywrapfst.pyx":2212
+ /* "pywrapfst.pyx":2216
* 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 '%s'", "_relabel_pairs");
- __PYX_ERR(0, 2212, __pyx_L1_error)
+ __PYX_ERR(0, 2216, __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, 2212, __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, 2216, __pyx_L1_error)
- /* "pywrapfst.pyx":2213
+ /* "pywrapfst.pyx":2217
* """
* self._relabel_pairs(ipairs, opairs)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2190
+ /* "pywrapfst.pyx":2194
* self._check_mutating_imethod()
*
* def relabel_pairs(self, ipairs=None, opairs=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2215
+/* "pywrapfst.pyx":2219
* 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":2216
+ /* "pywrapfst.pyx":2220
*
* 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":2217
+ /* "pywrapfst.pyx":2221
* 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_);
- /* "pywrapfst.pyx":2219
+ /* "pywrapfst.pyx":2223
* _SymbolTable new_isymbols=None,
* unknown_isymbol=b"",
* bool attach_new_isymbols=True, # <<<<<<<<<<<<<<
*/
bool __pyx_v_attach_new_isymbols = ((bool)1);
- /* "pywrapfst.pyx":2220
+ /* "pywrapfst.pyx":2224
* 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":2221
+ /* "pywrapfst.pyx":2225
* 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_);
- /* "pywrapfst.pyx":2223
+ /* "pywrapfst.pyx":2227
* _SymbolTable new_osymbols=None,
* unknown_osymbol=b"",
* bool attach_new_osymbols=True) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2224
+ /* "pywrapfst.pyx":2228
* 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 (__pyx_t_1) {
- /* "pywrapfst.pyx":2225
+ /* "pywrapfst.pyx":2229
* 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_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2225, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2225, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __PYX_ERR(0, 2225, __pyx_L1_error)
+ __PYX_ERR(0, 2229, __pyx_L1_error)
- /* "pywrapfst.pyx":2224
+ /* "pywrapfst.pyx":2228
* unknown_osymbol=b"",
* bool attach_new_osymbols=True) except *:
* if new_isymbols is None and new_osymbols is None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2226
+ /* "pywrapfst.pyx":2230
* 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":2227
+ /* "pywrapfst.pyx":2231
* 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":2228
+ /* "pywrapfst.pyx":2232
* 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 '%s'", "_table");
- __PYX_ERR(0, 2228, __pyx_L1_error)
+ __PYX_ERR(0, 2232, __pyx_L1_error)
}
__pyx_t_6 = __pyx_v_new_isymbols->_table;
__pyx_v_new_isymbols_ptr = __pyx_t_6;
- /* "pywrapfst.pyx":2227
+ /* "pywrapfst.pyx":2231
* raise FstArgError("No new SymbolTables specified")
* cdef fst.SymbolTable *new_isymbols_ptr = NULL
* if new_isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2229
+ /* "pywrapfst.pyx":2233
* 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":2230
+ /* "pywrapfst.pyx":2234
* 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":2231
+ /* "pywrapfst.pyx":2235
* 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 '%s'", "_table");
- __PYX_ERR(0, 2231, __pyx_L1_error)
+ __PYX_ERR(0, 2235, __pyx_L1_error)
}
__pyx_t_6 = __pyx_v_new_osymbols->_table;
__pyx_v_new_osymbols_ptr = __pyx_t_6;
- /* "pywrapfst.pyx":2230
+ /* "pywrapfst.pyx":2234
* new_isymbols_ptr = new_isymbols._table
* cdef fst.SymbolTable *new_osymbols_ptr = NULL
* if new_osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2232
+ /* "pywrapfst.pyx":2236
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2232, __pyx_L1_error)
+ __PYX_ERR(0, 2236, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2233
+ /* "pywrapfst.pyx":2237
* 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 '%s'", "_fst");
- __PYX_ERR(0, 2233, __pyx_L1_error)
+ __PYX_ERR(0, 2237, __pyx_L1_error)
}
__pyx_t_7 = __pyx_v_self->__pyx_base._fst.get()->InputSymbols();
} else {
- /* "pywrapfst.pyx":2234
+ /* "pywrapfst.pyx":2238
* 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 '%s'", "_table");
- __PYX_ERR(0, 2234, __pyx_L1_error)
+ __PYX_ERR(0, 2238, __pyx_L1_error)
}
__pyx_t_7 = __pyx_v_old_isymbols->_table;
}
- __pyx_t_8 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_isymbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2234, __pyx_L1_error)
+ __pyx_t_8 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_isymbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2238, __pyx_L1_error)
- /* "pywrapfst.pyx":2236
+ /* "pywrapfst.pyx":2240
* 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 '%s'", "_fst");
- __PYX_ERR(0, 2236, __pyx_L1_error)
+ __PYX_ERR(0, 2240, __pyx_L1_error)
}
__pyx_t_9 = __pyx_v_self->__pyx_base._fst.get()->OutputSymbols();
} else {
- /* "pywrapfst.pyx":2237
+ /* "pywrapfst.pyx":2241
* 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 '%s'", "_table");
- __PYX_ERR(0, 2237, __pyx_L1_error)
+ __PYX_ERR(0, 2241, __pyx_L1_error)
}
__pyx_t_9 = __pyx_v_old_osymbols->_table;
}
- __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_osymbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2237, __pyx_L1_error)
+ __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_osymbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2241, __pyx_L1_error)
- /* "pywrapfst.pyx":2232
+ /* "pywrapfst.pyx":2236
* 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_7, __pyx_v_new_isymbols_ptr, __pyx_t_8, __pyx_v_attach_new_isymbols, __pyx_t_9, __pyx_v_new_osymbols_ptr, __pyx_t_10, __pyx_v_attach_new_osymbols);
- /* "pywrapfst.pyx":2239
+ /* "pywrapfst.pyx":2243
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2239, __pyx_L1_error)
+ __PYX_ERR(0, 2243, __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, 2239, __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, 2243, __pyx_L1_error)
- /* "pywrapfst.pyx":2215
+ /* "pywrapfst.pyx":2219
* return self
*
* cdef void _relabel_tables(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2241
+/* "pywrapfst.pyx":2245
* self._check_mutating_imethod()
*
* def relabel_tables(self, # <<<<<<<<<<<<<<
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":2242
+ /* "pywrapfst.pyx":2246
*
* def relabel_tables(self,
* _SymbolTable old_isymbols=None, # <<<<<<<<<<<<<<
*/
values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":2243
+ /* "pywrapfst.pyx":2247
* 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_);
- /* "pywrapfst.pyx":2246
+ /* "pywrapfst.pyx":2250
* unknown_isymbol=b"",
* bool attach_new_isymbols=True,
* _SymbolTable old_osymbols=None, # <<<<<<<<<<<<<<
*/
values[4] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":2247
+ /* "pywrapfst.pyx":2251
* 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, 2241, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_tables") < 0)) __PYX_ERR(0, 2245, __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, 2245, __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, 2249, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2245
+ /* "pywrapfst.pyx":2249
* _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, 2249, __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, 2253, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2249
+ /* "pywrapfst.pyx":2253
* _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, 2241, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("relabel_tables", 0, 0, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2245, __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, 2242, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_isymbols", 0))) __PYX_ERR(0, 2243, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_osymbols", 0))) __PYX_ERR(0, 2246, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_osymbols", 0))) __PYX_ERR(0, 2247, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_isymbols", 0))) __PYX_ERR(0, 2246, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_isymbols", 0))) __PYX_ERR(0, 2247, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_osymbols", 0))) __PYX_ERR(0, 2250, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_osymbols", 0))) __PYX_ERR(0, 2251, __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);
- /* "pywrapfst.pyx":2241
+ /* "pywrapfst.pyx":2245
* self._check_mutating_imethod()
*
* def relabel_tables(self, # <<<<<<<<<<<<<<
struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_tables __pyx_t_1;
__Pyx_RefNannySetupContext("relabel_tables", 0);
- /* "pywrapfst.pyx":2285
+ /* "pywrapfst.pyx":2289
* 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 '%s'", "_relabel_tables");
- __PYX_ERR(0, 2285, __pyx_L1_error)
+ __PYX_ERR(0, 2289, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2288
+ /* "pywrapfst.pyx":2292
* 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, 2285, __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, 2289, __pyx_L1_error)
- /* "pywrapfst.pyx":2289
+ /* "pywrapfst.pyx":2293
* old_osymbols, new_osymbols,
* unknown_osymbol, attach_new_osymbols)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2241
+ /* "pywrapfst.pyx":2245
* self._check_mutating_imethod()
*
* def relabel_tables(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2291
+/* "pywrapfst.pyx":2295
* return self
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("_reserve_arcs", 0);
- /* "pywrapfst.pyx":2292
+ /* "pywrapfst.pyx":2296
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2292, __pyx_L1_error)
+ __PYX_ERR(0, 2296, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ReserveArcs(__pyx_v_state, __pyx_v_n) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2293
+ /* "pywrapfst.pyx":2297
* 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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2293, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2293, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2293, __pyx_L1_error)
+ __PYX_ERR(0, 2297, __pyx_L1_error)
- /* "pywrapfst.pyx":2292
+ /* "pywrapfst.pyx":2296
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *:
* if not self._mfst.get().ReserveArcs(state, n): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2294
+ /* "pywrapfst.pyx":2298
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2294, __pyx_L1_error)
+ __PYX_ERR(0, 2298, __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, 2294, __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, 2298, __pyx_L1_error)
- /* "pywrapfst.pyx":2291
+ /* "pywrapfst.pyx":2295
* return self
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2296
+/* "pywrapfst.pyx":2300
* self._check_mutating_imethod()
*
* def reserve_arcs(self, int64 state, size_t n): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2296, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2300, __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, 2296, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reserve_arcs") < 0)) __PYX_ERR(0, 2300, __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, 2296, __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, 2296, __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, 2300, __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, 2300, __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, 2296, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2300, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.reserve_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reserve_arcs", 0);
- /* "pywrapfst.pyx":2314
+ /* "pywrapfst.pyx":2318
* 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 '%s'", "_reserve_arcs");
- __PYX_ERR(0, 2314, __pyx_L1_error)
+ __PYX_ERR(0, 2318, __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, 2314, __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, 2318, __pyx_L1_error)
- /* "pywrapfst.pyx":2315
+ /* "pywrapfst.pyx":2319
* """
* self._reserve_arcs(state, n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2296
+ /* "pywrapfst.pyx":2300
* self._check_mutating_imethod()
*
* def reserve_arcs(self, int64 state, size_t n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2317
+/* "pywrapfst.pyx":2321
* return self
*
* cdef void _reserve_states(self, int64 n) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_reserve_states", 0);
- /* "pywrapfst.pyx":2318
+ /* "pywrapfst.pyx":2322
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2318, __pyx_L1_error)
+ __PYX_ERR(0, 2322, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->ReserveStates(__pyx_v_n);
- /* "pywrapfst.pyx":2319
+ /* "pywrapfst.pyx":2323
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2319, __pyx_L1_error)
+ __PYX_ERR(0, 2323, __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, 2319, __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, 2323, __pyx_L1_error)
- /* "pywrapfst.pyx":2317
+ /* "pywrapfst.pyx":2321
* return self
*
* cdef void _reserve_states(self, int64 n) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2321
+/* "pywrapfst.pyx":2325
* self._check_mutating_imethod()
*
* def reserve_states(self, int64 n): # <<<<<<<<<<<<<<
__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, 2321, __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, 2325, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reserve_states", 0);
- /* "pywrapfst.pyx":2335
+ /* "pywrapfst.pyx":2339
* 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 '%s'", "_reserve_states");
- __PYX_ERR(0, 2335, __pyx_L1_error)
+ __PYX_ERR(0, 2339, __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, 2335, __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, 2339, __pyx_L1_error)
- /* "pywrapfst.pyx":2336
+ /* "pywrapfst.pyx":2340
* """
* self._reserve_states(n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2321
+ /* "pywrapfst.pyx":2325
* self._check_mutating_imethod()
*
* def reserve_states(self, int64 n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2338
+/* "pywrapfst.pyx":2342
* return self
*
* cdef void _reweight(self, potentials, bool to_final=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2340
+ /* "pywrapfst.pyx":2344
* 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, 2340, __pyx_L1_error)
+ __PYX_ERR(0, 2344, __pyx_L1_error)
}
__pyx_v__potentials.reset(__pyx_t_1);
- /* "pywrapfst.pyx":2341
+ /* "pywrapfst.pyx":2345
* 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 '%s'", "weight_type");
- __PYX_ERR(0, 2341, __pyx_L1_error)
+ __PYX_ERR(0, 2345, __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":2342
+ /* "pywrapfst.pyx":2346
* _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, 2342, __pyx_L1_error)
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_potentials); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2346, __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, 2342, __pyx_L1_error)
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2346, __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, 2342, __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, 2346, __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, 2342, __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, 2346, __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, 2342, __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, 2346, __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, 2342, __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, 2346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2342, __pyx_L1_error)
+ else __PYX_ERR(0, 2346, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_weight, __pyx_t_5);
__pyx_t_5 = 0;
- /* "pywrapfst.pyx":2343
+ /* "pywrapfst.pyx":2347
* 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 '%s'", "weight_type");
- __PYX_ERR(0, 2343, __pyx_L1_error)
+ __PYX_ERR(0, 2347, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2344
+ /* "pywrapfst.pyx":2348
* 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, 2343, __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, 2347, __pyx_L1_error)
- /* "pywrapfst.pyx":2343
+ /* "pywrapfst.pyx":2347
* 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, 2343, __pyx_L1_error)
+ __PYX_ERR(0, 2347, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2342
+ /* "pywrapfst.pyx":2346
* _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":2345
+ /* "pywrapfst.pyx":2349
* _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 '%s'", "_mfst");
- __PYX_ERR(0, 2345, __pyx_L1_error)
+ __PYX_ERR(0, 2349, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2346
+ /* "pywrapfst.pyx":2350
* 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":2347
+ /* "pywrapfst.pyx":2351
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2347, __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, 2347, __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":2338
+ /* "pywrapfst.pyx":2342
* return self
*
* cdef void _reweight(self, potentials, bool to_final=False) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2349
+/* "pywrapfst.pyx":2353
* self._check_mutating_imethod()
*
* def reweight(self, potentials, bool to_final=False): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reweight") < 0)) __PYX_ERR(0, 2349, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reweight") < 0)) __PYX_ERR(0, 2353, __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, 2349, __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, 2353, __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, 2349, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reweight", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2353, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.reweight", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
struct __pyx_opt_args_9pywrapfst_11_MutableFst__reweight __pyx_t_1;
__Pyx_RefNannySetupContext("reweight", 0);
- /* "pywrapfst.pyx":2371
+ /* "pywrapfst.pyx":2375
* self.
* """
* self._reweight(potentials, to_final) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reweight");
- __PYX_ERR(0, 2371, __pyx_L1_error)
+ __PYX_ERR(0, 2375, __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, 2371, __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, 2375, __pyx_L1_error)
- /* "pywrapfst.pyx":2372
+ /* "pywrapfst.pyx":2376
* """
* self._reweight(potentials, to_final)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2349
+ /* "pywrapfst.pyx":2353
* self._check_mutating_imethod()
*
* def reweight(self, potentials, bool to_final=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2374
+/* "pywrapfst.pyx":2378
* 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) {
- /* "pywrapfst.pyx":2375
+ /* "pywrapfst.pyx":2379
*
* cdef void _rmepsilon(self,
* bool connect=True, # <<<<<<<<<<<<<<
float __pyx_v_delta = __pyx_k__22;
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__23;
- /* "pywrapfst.pyx":2378
+ /* "pywrapfst.pyx":2382
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2380
+ /* "pywrapfst.pyx":2384
* weight=None) except *:
* # Threshold is set to semiring Zero (no pruning) if weight unspecified.
* 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 '%s'", "weight_type");
- __PYX_ERR(0, 2380, __pyx_L1_error)
+ __PYX_ERR(0, 2384, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2381
+ /* "pywrapfst.pyx":2385
* # Threshold is set to semiring Zero (no pruning) if weight unspecified.
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
* weight) # <<<<<<<<<<<<<<
* fst.RmEpsilon(self._mfst.get(), connect, 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, 2380, __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, 2384, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":2382
+ /* "pywrapfst.pyx":2386
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
* weight)
* fst.RmEpsilon(self._mfst.get(), connect, wc, nstate, delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 2382, __pyx_L1_error)
+ __PYX_ERR(0, 2386, __pyx_L1_error)
}
fst::script::RmEpsilon(__pyx_v_self->_mfst.get(), __pyx_v_connect, __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":2383
+ /* "pywrapfst.pyx":2387
* weight)
* fst.RmEpsilon(self._mfst.get(), connect, wc, nstate, delta)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2383, __pyx_L1_error)
+ __PYX_ERR(0, 2387, __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, 2383, __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, 2387, __pyx_L1_error)
- /* "pywrapfst.pyx":2374
+ /* "pywrapfst.pyx":2378
* return self
*
* cdef void _rmepsilon(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2385
+/* "pywrapfst.pyx":2389
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_connect,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_weight,0};
PyObject* values[4] = {0,0,0,0};
- /* "pywrapfst.pyx":2389
+ /* "pywrapfst.pyx":2393
* 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, "rmepsilon") < 0)) __PYX_ERR(0, 2385, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 2389, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
}
if (values[0]) {
- __pyx_v_connect = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2386, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2390, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2386
+ /* "pywrapfst.pyx":2390
*
* def rmepsilon(self,
* bool connect=True, # <<<<<<<<<<<<<<
__pyx_v_connect = ((bool)1);
}
if (values[1]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2387, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2391, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__24;
}
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, 2388, __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, 2392, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__25;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2385, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2389, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_connect, __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);
- /* "pywrapfst.pyx":2385
+ /* "pywrapfst.pyx":2389
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon __pyx_t_1;
__Pyx_RefNannySetupContext("rmepsilon", 0);
- /* "pywrapfst.pyx":2411
+ /* "pywrapfst.pyx":2415
* reverse (and which may be more efficient).
* """
* self._rmepsilon(connect, delta, nstate, weight) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_rmepsilon");
- __PYX_ERR(0, 2411, __pyx_L1_error)
+ __PYX_ERR(0, 2415, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 4;
__pyx_t_1.connect = __pyx_v_connect;
__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)->_rmepsilon(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2411, __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, 2415, __pyx_L1_error)
- /* "pywrapfst.pyx":2412
+ /* "pywrapfst.pyx":2416
* """
* self._rmepsilon(connect, delta, nstate, weight)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2385
+ /* "pywrapfst.pyx":2389
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2414
+/* "pywrapfst.pyx":2418
* return self
*
* cdef void _set_final(self, int64 state, weight=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2415
+ /* "pywrapfst.pyx":2419
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2415, __pyx_L1_error)
+ __PYX_ERR(0, 2419, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2416
+ /* "pywrapfst.pyx":2420
* 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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2416, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2420, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2416, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2420, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2416, __pyx_L1_error)
+ __PYX_ERR(0, 2420, __pyx_L1_error)
- /* "pywrapfst.pyx":2415
+ /* "pywrapfst.pyx":2419
*
* cdef void _set_final(self, int64 state, weight=None) except *:
* if not self._mfst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2417
+ /* "pywrapfst.pyx":2421
* 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 '%s'", "weight_type");
- __PYX_ERR(0, 2417, __pyx_L1_error)
+ __PYX_ERR(0, 2421, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2418
+ /* "pywrapfst.pyx":2422
* 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_4 = __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, 2417, __pyx_L1_error)
+ __pyx_t_4 = __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, 2421, __pyx_L1_error)
__pyx_v_wc = __pyx_t_4;
- /* "pywrapfst.pyx":2419
+ /* "pywrapfst.pyx":2423
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2419, __pyx_L1_error)
+ __PYX_ERR(0, 2423, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetFinal(__pyx_v_state, __pyx_v_wc) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2420
+ /* "pywrapfst.pyx":2424
* weight)
* if not self._mfst.get().SetFinal(state, wc):
* raise FstOpError("Incompatible or invalid weight") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2420, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2424, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2420, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2424, __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, 2420, __pyx_L1_error)
+ __PYX_ERR(0, 2424, __pyx_L1_error)
- /* "pywrapfst.pyx":2419
+ /* "pywrapfst.pyx":2423
* cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
* weight)
* if not self._mfst.get().SetFinal(state, wc): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2421
+ /* "pywrapfst.pyx":2425
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2421, __pyx_L1_error)
+ __PYX_ERR(0, 2425, __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, 2421, __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, 2425, __pyx_L1_error)
- /* "pywrapfst.pyx":2414
+ /* "pywrapfst.pyx":2418
* return self
*
* cdef void _set_final(self, int64 state, weight=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2423
+/* "pywrapfst.pyx":2427
* self._check_mutating_imethod()
*
* def set_final(self, int64 state, weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2423, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2427, __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, 2423, __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, 2427, __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, 2423, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_final", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2427, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.set_final", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
struct __pyx_opt_args_9pywrapfst_11_MutableFst__set_final __pyx_t_1;
__Pyx_RefNannySetupContext("set_final", 0);
- /* "pywrapfst.pyx":2440
+ /* "pywrapfst.pyx":2444
* 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 '%s'", "_set_final");
- __PYX_ERR(0, 2440, __pyx_L1_error)
+ __PYX_ERR(0, 2444, __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, 2440, __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, 2444, __pyx_L1_error)
- /* "pywrapfst.pyx":2441
+ /* "pywrapfst.pyx":2445
* """
* self._set_final(state, weight)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2423
+ /* "pywrapfst.pyx":2427
* self._check_mutating_imethod()
*
* def set_final(self, int64 state, weight=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2443
+/* "pywrapfst.pyx":2447
* return self
*
* cdef void _set_properties(self, uint64 props, uint64 mask) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_set_properties", 0);
- /* "pywrapfst.pyx":2444
+ /* "pywrapfst.pyx":2448
*
* cdef void _set_properties(self, uint64 props, uint64 mask) except *:
* self._mfst.get().SetProperties(props, mask) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 2444, __pyx_L1_error)
+ __PYX_ERR(0, 2448, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetProperties(__pyx_v_props, __pyx_v_mask);
- /* "pywrapfst.pyx":2443
+ /* "pywrapfst.pyx":2447
* return self
*
* cdef void _set_properties(self, uint64 props, uint64 mask) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2446
+/* "pywrapfst.pyx":2450
* self._mfst.get().SetProperties(props, mask)
*
* def set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, 1); __PYX_ERR(0, 2446, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, 1); __PYX_ERR(0, 2450, __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, 2446, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_properties") < 0)) __PYX_ERR(0, 2450, __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, 2446, __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, 2446, __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, 2450, __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, 2450, __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, 2446, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2450, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.set_properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_properties", 0);
- /* "pywrapfst.pyx":2460
+ /* "pywrapfst.pyx":2464
* self.
* """
* self._set_properties(props, mask) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_set_properties");
- __PYX_ERR(0, 2460, __pyx_L1_error)
+ __PYX_ERR(0, 2464, __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); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2460, __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); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2464, __pyx_L1_error)
- /* "pywrapfst.pyx":2461
+ /* "pywrapfst.pyx":2465
* """
* self._set_properties(props, mask)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2446
+ /* "pywrapfst.pyx":2450
* self._mfst.get().SetProperties(props, mask)
*
* def set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2463
+/* "pywrapfst.pyx":2467
* return self
*
* cdef void _set_start(self, int64 state) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("_set_start", 0);
- /* "pywrapfst.pyx":2464
+ /* "pywrapfst.pyx":2468
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2464, __pyx_L1_error)
+ __PYX_ERR(0, 2468, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetStart(__pyx_v_state) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2465
+ /* "pywrapfst.pyx":2469
* 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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2465, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2465, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2465, __pyx_L1_error)
+ __PYX_ERR(0, 2469, __pyx_L1_error)
- /* "pywrapfst.pyx":2464
+ /* "pywrapfst.pyx":2468
*
* cdef void _set_start(self, int64 state) except *:
* if not self._mfst.get().SetStart(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2466
+ /* "pywrapfst.pyx":2470
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2466, __pyx_L1_error)
+ __PYX_ERR(0, 2470, __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, 2466, __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, 2470, __pyx_L1_error)
- /* "pywrapfst.pyx":2463
+ /* "pywrapfst.pyx":2467
* return self
*
* cdef void _set_start(self, int64 state) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2468
+/* "pywrapfst.pyx":2472
* self._check_mutating_imethod()
*
* def set_start(self, int64 state): # <<<<<<<<<<<<<<
__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, 2468, __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, 2472, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_start", 0);
- /* "pywrapfst.pyx":2485
+ /* "pywrapfst.pyx":2489
* 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 '%s'", "_set_start");
- __PYX_ERR(0, 2485, __pyx_L1_error)
+ __PYX_ERR(0, 2489, __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, 2485, __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, 2489, __pyx_L1_error)
- /* "pywrapfst.pyx":2486
+ /* "pywrapfst.pyx":2490
* """
* self._set_start(state)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2468
+ /* "pywrapfst.pyx":2472
* self._check_mutating_imethod()
*
* def set_start(self, int64 state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2488
+/* "pywrapfst.pyx":2492
* return self
*
* cdef void _set_input_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
int __pyx_t_2;
__Pyx_RefNannySetupContext("_set_input_symbols", 0);
- /* "pywrapfst.pyx":2489
+ /* "pywrapfst.pyx":2493
*
* 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":2490
+ /* "pywrapfst.pyx":2494
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2490, __pyx_L1_error)
+ __PYX_ERR(0, 2494, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetInputSymbols(NULL);
- /* "pywrapfst.pyx":2491
+ /* "pywrapfst.pyx":2495
* if syms is None:
* self._mfst.get().SetInputSymbols(NULL)
* return # <<<<<<<<<<<<<<
*/
goto __pyx_L0;
- /* "pywrapfst.pyx":2489
+ /* "pywrapfst.pyx":2493
*
* cdef void _set_input_symbols(self, _SymbolTable syms) except *:
* if syms is None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2492
+ /* "pywrapfst.pyx":2496
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2492, __pyx_L1_error)
+ __PYX_ERR(0, 2496, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 2492, __pyx_L1_error)
+ __PYX_ERR(0, 2496, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetInputSymbols(__pyx_v_syms->_table);
- /* "pywrapfst.pyx":2493
+ /* "pywrapfst.pyx":2497
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2493, __pyx_L1_error)
+ __PYX_ERR(0, 2497, __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, 2493, __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, 2497, __pyx_L1_error)
- /* "pywrapfst.pyx":2488
+ /* "pywrapfst.pyx":2492
* return self
*
* cdef void _set_input_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2495
+/* "pywrapfst.pyx":2499
* self._check_mutating_imethod()
*
* def set_input_symbols(self, _SymbolTable 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, 2495, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 2499, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_56set_input_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
/* function exit code */
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_input_symbols", 0);
- /* "pywrapfst.pyx":2511
+ /* "pywrapfst.pyx":2515
* 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 '%s'", "_set_input_symbols");
- __PYX_ERR(0, 2511, __pyx_L1_error)
+ __PYX_ERR(0, 2515, __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, 2511, __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, 2515, __pyx_L1_error)
- /* "pywrapfst.pyx":2512
+ /* "pywrapfst.pyx":2516
* """
* self._set_input_symbols(syms)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2495
+ /* "pywrapfst.pyx":2499
* self._check_mutating_imethod()
*
* def set_input_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2514
+/* "pywrapfst.pyx":2518
* return self
*
* cdef void _set_output_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
int __pyx_t_2;
__Pyx_RefNannySetupContext("_set_output_symbols", 0);
- /* "pywrapfst.pyx":2515
+ /* "pywrapfst.pyx":2519
*
* 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":2516
+ /* "pywrapfst.pyx":2520
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2516, __pyx_L1_error)
+ __PYX_ERR(0, 2520, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetOutputSymbols(NULL);
- /* "pywrapfst.pyx":2517
+ /* "pywrapfst.pyx":2521
* if syms is None:
* self._mfst.get().SetOutputSymbols(NULL)
* return # <<<<<<<<<<<<<<
*/
goto __pyx_L0;
- /* "pywrapfst.pyx":2515
+ /* "pywrapfst.pyx":2519
*
* cdef void _set_output_symbols(self, _SymbolTable syms) except *:
* if syms is None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2518
+ /* "pywrapfst.pyx":2522
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2518, __pyx_L1_error)
+ __PYX_ERR(0, 2522, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 2518, __pyx_L1_error)
+ __PYX_ERR(0, 2522, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetOutputSymbols(__pyx_v_syms->_table);
- /* "pywrapfst.pyx":2519
+ /* "pywrapfst.pyx":2523
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2519, __pyx_L1_error)
+ __PYX_ERR(0, 2523, __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, 2519, __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, 2523, __pyx_L1_error)
- /* "pywrapfst.pyx":2514
+ /* "pywrapfst.pyx":2518
* return self
*
* cdef void _set_output_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2521
+/* "pywrapfst.pyx":2525
* self._check_mutating_imethod()
*
* def set_output_symbols(self, _SymbolTable 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, 2521, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 2525, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_58set_output_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
/* function exit code */
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_output_symbols", 0);
- /* "pywrapfst.pyx":2537
+ /* "pywrapfst.pyx":2541
* 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 '%s'", "_set_output_symbols");
- __PYX_ERR(0, 2537, __pyx_L1_error)
+ __PYX_ERR(0, 2541, __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, 2537, __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, 2541, __pyx_L1_error)
- /* "pywrapfst.pyx":2538
+ /* "pywrapfst.pyx":2542
* """
* self._set_output_symbols(syms)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2521
+ /* "pywrapfst.pyx":2525
* self._check_mutating_imethod()
*
* def set_output_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2540
+/* "pywrapfst.pyx":2544
* return self
*
* cdef void _topsort(self) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("_topsort", 0);
- /* "pywrapfst.pyx":2542
+ /* "pywrapfst.pyx":2546
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2542, __pyx_L1_error)
+ __PYX_ERR(0, 2546, __pyx_L1_error)
}
__pyx_t_1 = ((!(fst::script::TopSort(__pyx_v_self->_mfst.get()) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2543
+ /* "pywrapfst.pyx":2547
* # 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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2543, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2543, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2547, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2543, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __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;
- /* "pywrapfst.pyx":2542
+ /* "pywrapfst.pyx":2546
* 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":2544
+ /* "pywrapfst.pyx":2548
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2544, __pyx_L1_error)
+ __PYX_ERR(0, 2548, __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, 2544, __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, 2548, __pyx_L1_error)
- /* "pywrapfst.pyx":2540
+ /* "pywrapfst.pyx":2544
* return self
*
* cdef void _topsort(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2546
+/* "pywrapfst.pyx":2550
* self._check_mutating_imethod()
*
* def topsort(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("topsort", 0);
- /* "pywrapfst.pyx":2561
+ /* "pywrapfst.pyx":2565
* See also: `arcsort`.
* """
* self._topsort() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_topsort");
- __PYX_ERR(0, 2561, __pyx_L1_error)
+ __PYX_ERR(0, 2565, __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, 2561, __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, 2565, __pyx_L1_error)
- /* "pywrapfst.pyx":2562
+ /* "pywrapfst.pyx":2566
* """
* self._topsort()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2546
+ /* "pywrapfst.pyx":2550
* self._check_mutating_imethod()
*
* def topsort(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2564
+/* "pywrapfst.pyx":2568
* return self
*
* cdef void _union(self, _Fst ifst) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_union", 0);
- /* "pywrapfst.pyx":2565
+ /* "pywrapfst.pyx":2569
*
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 2565, __pyx_L1_error)
+ __PYX_ERR(0, 2569, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 2565, __pyx_L1_error)
+ __PYX_ERR(0, 2569, __pyx_L1_error)
}
fst::script::Union(__pyx_v_self->_mfst.get(), (*__pyx_v_ifst->_fst));
- /* "pywrapfst.pyx":2566
+ /* "pywrapfst.pyx":2570
* 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 '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2566, __pyx_L1_error)
+ __PYX_ERR(0, 2570, __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, 2566, __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, 2570, __pyx_L1_error)
- /* "pywrapfst.pyx":2564
+ /* "pywrapfst.pyx":2568
* return self
*
* cdef void _union(self, _Fst ifst) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2568
+/* "pywrapfst.pyx":2572
* self._check_mutating_imethod()
*
* def union(self, _Fst 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, 2568, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 2572, __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));
/* function exit code */
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("union", 0);
- /* "pywrapfst.pyx":2584
+ /* "pywrapfst.pyx":2588
* self.
* """
* self._union(ifst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_union");
- __PYX_ERR(0, 2584, __pyx_L1_error)
+ __PYX_ERR(0, 2588, __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, 2584, __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, 2588, __pyx_L1_error)
- /* "pywrapfst.pyx":2585
+ /* "pywrapfst.pyx":2589
* """
* self._union(ifst)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2568
+ /* "pywrapfst.pyx":2572
* self._check_mutating_imethod()
*
* def union(self, _Fst ifst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2610
+/* "pywrapfst.pyx":2614
*
*
* cdef _Fst _init_Fst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("_init_Fst", 0);
- /* "pywrapfst.pyx":2611
+ /* "pywrapfst.pyx":2615
*
* cdef _Fst _init_Fst(FstClass_ptr tfst):
* if tfst.Properties(fst.kError, True): # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_v_tfst->Properties(fst::kError, 1) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2612
+ /* "pywrapfst.pyx":2616
* cdef _Fst _init_Fst(FstClass_ptr tfst):
* if tfst.Properties(fst.kError, True):
* raise FstOpError("Operation failed") # <<<<<<<<<<<<<<
* cdef _Fst ofst = _Fst.__new__(_Fst)
* ofst._fst.reset(<FstClass_ptr> tfst)
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2612, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2612, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2612, __pyx_L1_error)
+ __PYX_ERR(0, 2616, __pyx_L1_error)
- /* "pywrapfst.pyx":2611
+ /* "pywrapfst.pyx":2615
*
* cdef _Fst _init_Fst(FstClass_ptr tfst):
* if tfst.Properties(fst.kError, True): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2613
+ /* "pywrapfst.pyx":2617
* if tfst.Properties(fst.kError, True):
* raise FstOpError("Operation failed")
* cdef _Fst ofst = _Fst.__new__(_Fst) # <<<<<<<<<<<<<<
* ofst._fst.reset(<FstClass_ptr> tfst)
* return ofst
*/
- __pyx_t_3 = __pyx_tp_new_9pywrapfst__Fst(((PyTypeObject *)__pyx_ptype_9pywrapfst__Fst), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2613, __pyx_L1_error)
+ __pyx_t_3 = __pyx_tp_new_9pywrapfst__Fst(((PyTypeObject *)__pyx_ptype_9pywrapfst__Fst), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__Fst)))) __PYX_ERR(0, 2613, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__Fst)))) __PYX_ERR(0, 2617, __pyx_L1_error)
__pyx_v_ofst = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "pywrapfst.pyx":2614
+ /* "pywrapfst.pyx":2618
* raise FstOpError("Operation failed")
* cdef _Fst ofst = _Fst.__new__(_Fst)
* ofst._fst.reset(<FstClass_ptr> tfst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 2614, __pyx_L1_error)
+ __PYX_ERR(0, 2618, __pyx_L1_error)
}
__pyx_v_ofst->_fst.reset(((__pyx_t_9pywrapfst_FstClass_ptr)__pyx_v_tfst));
- /* "pywrapfst.pyx":2615
+ /* "pywrapfst.pyx":2619
* cdef _Fst ofst = _Fst.__new__(_Fst)
* ofst._fst.reset(<FstClass_ptr> tfst)
* return ofst # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_ofst;
goto __pyx_L0;
- /* "pywrapfst.pyx":2610
+ /* "pywrapfst.pyx":2614
*
*
* cdef _Fst _init_Fst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2618
+/* "pywrapfst.pyx":2622
*
*
* cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("_init_MutableFst", 0);
- /* "pywrapfst.pyx":2619
+ /* "pywrapfst.pyx":2623
*
* cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
* if tfst.Properties(fst.kError, True): # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_v_tfst->Properties(fst::kError, 1) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2620
+ /* "pywrapfst.pyx":2624
* cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
* if tfst.Properties(fst.kError, True):
* raise FstOpError("Operation failed") # <<<<<<<<<<<<<<
* cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
* ofst._fst.reset(<MutableFstClass_ptr> tfst)
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2620, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2624, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2620, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2624, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2620, __pyx_L1_error)
+ __PYX_ERR(0, 2624, __pyx_L1_error)
- /* "pywrapfst.pyx":2619
+ /* "pywrapfst.pyx":2623
*
* cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
* if tfst.Properties(fst.kError, True): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2621
+ /* "pywrapfst.pyx":2625
* if tfst.Properties(fst.kError, True):
* raise FstOpError("Operation failed")
* cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst) # <<<<<<<<<<<<<<
* ofst._fst.reset(<MutableFstClass_ptr> tfst)
* # Makes a copy of it as the derived type! Cool.
*/
- __pyx_t_3 = __pyx_tp_new_9pywrapfst__MutableFst(((PyTypeObject *)__pyx_ptype_9pywrapfst__MutableFst), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2621, __pyx_L1_error)
+ __pyx_t_3 = __pyx_tp_new_9pywrapfst__MutableFst(((PyTypeObject *)__pyx_ptype_9pywrapfst__MutableFst), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2625, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__MutableFst)))) __PYX_ERR(0, 2621, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__MutableFst)))) __PYX_ERR(0, 2625, __pyx_L1_error)
__pyx_v_ofst = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "pywrapfst.pyx":2622
+ /* "pywrapfst.pyx":2626
* raise FstOpError("Operation failed")
* cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
* ofst._fst.reset(<MutableFstClass_ptr> tfst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 2622, __pyx_L1_error)
+ __PYX_ERR(0, 2626, __pyx_L1_error)
}
__pyx_v_ofst->__pyx_base._fst.reset(((__pyx_t_9pywrapfst_MutableFstClass_ptr)__pyx_v_tfst));
- /* "pywrapfst.pyx":2624
+ /* "pywrapfst.pyx":2628
* ofst._fst.reset(<MutableFstClass_ptr> 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 '%s'", "_fst");
- __PYX_ERR(0, 2624, __pyx_L1_error)
+ __PYX_ERR(0, 2628, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 2624, __pyx_L1_error)
+ __PYX_ERR(0, 2628, __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":2625
+ /* "pywrapfst.pyx":2629
* # 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":2618
+ /* "pywrapfst.pyx":2622
*
*
* cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2628
+/* "pywrapfst.pyx":2632
*
*
* cdef _Fst _init_XFst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("_init_XFst", 0);
- /* "pywrapfst.pyx":2629
+ /* "pywrapfst.pyx":2633
*
* cdef _Fst _init_XFst(FstClass_ptr tfst):
* if tfst.Properties(fst.kMutable, True): # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_v_tfst->Properties(fst::kMutable, 1) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2630
+ /* "pywrapfst.pyx":2634
* cdef _Fst _init_XFst(FstClass_ptr tfst):
* if tfst.Properties(fst.kMutable, True):
* 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, 2630, __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, 2634, __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":2629
+ /* "pywrapfst.pyx":2633
*
* cdef _Fst _init_XFst(FstClass_ptr tfst):
* if tfst.Properties(fst.kMutable, True): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2632
+ /* "pywrapfst.pyx":2636
* 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, 2632, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_Fst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2636, __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":2628
+ /* "pywrapfst.pyx":2632
*
*
* cdef _Fst _init_XFst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2635
+/* "pywrapfst.pyx":2639
*
*
* cdef _MutableFst _create_Fst(arc_type=b"standard"): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2637
+ /* "pywrapfst.pyx":2641
* cdef _MutableFst _create_Fst(arc_type=b"standard"):
* cdef fst.VectorFstClass *tfst = new fst.VectorFstClass(
* <string> tostring(arc_type)) # <<<<<<<<<<<<<<
* if tfst == NULL:
* raise FstOpError("Unknown arc type: {!r}".format(arc_type))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2637, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2641, __pyx_L1_error)
- /* "pywrapfst.pyx":2636
+ /* "pywrapfst.pyx":2640
*
* cdef _MutableFst _create_Fst(arc_type=b"standard"):
* cdef fst.VectorFstClass *tfst = new fst.VectorFstClass( # <<<<<<<<<<<<<<
*/
__pyx_v_tfst = new fst::script::VectorFstClass(((std::string)__pyx_t_1));
- /* "pywrapfst.pyx":2638
+ /* "pywrapfst.pyx":2642
* cdef fst.VectorFstClass *tfst = new fst.VectorFstClass(
* <string> tostring(arc_type))
* if tfst == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_tfst == NULL) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2639
+ /* "pywrapfst.pyx":2643
* <string> tostring(arc_type))
* if tfst == NULL:
* raise FstOpError("Unknown arc type: {!r}".format(arc_type)) # <<<<<<<<<<<<<<
* return _init_MutableFst(tfst)
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2639, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_arc_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2639, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_arc_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_arc_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2639, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_arc_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_arc_type};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2639, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2643, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_arc_type};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2639, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2643, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2639, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(__pyx_v_arc_type);
__Pyx_GIVEREF(__pyx_v_arc_type);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_arc_type);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2639, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_6) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2639, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2643, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2639, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2643, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2639, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2643, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2639, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2639, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 2639, __pyx_L1_error)
+ __PYX_ERR(0, 2643, __pyx_L1_error)
- /* "pywrapfst.pyx":2638
+ /* "pywrapfst.pyx":2642
* cdef fst.VectorFstClass *tfst = new fst.VectorFstClass(
* <string> tostring(arc_type))
* if tfst == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2640
+ /* "pywrapfst.pyx":2644
* if tfst == NULL:
* raise FstOpError("Unknown arc type: {!r}".format(arc_type))
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2640, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2644, __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":2635
+ /* "pywrapfst.pyx":2639
*
*
* cdef _MutableFst _create_Fst(arc_type=b"standard"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2643
+/* "pywrapfst.pyx":2647
*
*
* cdef _Fst _read_Fst(filename, fst_type=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2644
+ /* "pywrapfst.pyx":2648
*
* cdef _Fst _read_Fst(filename, fst_type=None):
* cdef fst.FstClass *tfst = fst.FstClass.Read(tostring(filename)) # <<<<<<<<<<<<<<
* if tfst == NULL:
* raise FstIOError("Read failed: {!r}".format(filename))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2644, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2648, __pyx_L1_error)
__pyx_v_tfst = fst::script::FstClass::Read(__pyx_t_1);
- /* "pywrapfst.pyx":2645
+ /* "pywrapfst.pyx":2649
* cdef _Fst _read_Fst(filename, fst_type=None):
* cdef fst.FstClass *tfst = fst.FstClass.Read(tostring(filename))
* if tfst == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_tfst == NULL) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2646
+ /* "pywrapfst.pyx":2650
* cdef fst.FstClass *tfst = fst.FstClass.Read(tostring(filename))
* if tfst == NULL:
* raise FstIOError("Read failed: {!r}".format(filename)) # <<<<<<<<<<<<<<
* # Converts if requested.
* cdef string fst_type_string
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2646, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2646, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2646, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2646, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2650, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2646, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2650, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2646, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(__pyx_v_filename);
__Pyx_GIVEREF(__pyx_v_filename);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2646, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_6) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2646, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2650, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2646, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2650, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2646, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2650, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2646, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2646, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 2646, __pyx_L1_error)
+ __PYX_ERR(0, 2650, __pyx_L1_error)
- /* "pywrapfst.pyx":2645
+ /* "pywrapfst.pyx":2649
* cdef _Fst _read_Fst(filename, fst_type=None):
* cdef fst.FstClass *tfst = fst.FstClass.Read(tostring(filename))
* if tfst == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2649
+ /* "pywrapfst.pyx":2653
* # Converts if requested.
* cdef string fst_type_string
* if fst_type: # <<<<<<<<<<<<<<
* fst_type_string = tostring(fst_type)
* if fst_type_string != tfst.FstType():
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fst_type); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2649, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fst_type); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2653, __pyx_L1_error)
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2650
+ /* "pywrapfst.pyx":2654
* cdef string fst_type_string
* if fst_type:
* fst_type_string = tostring(fst_type) # <<<<<<<<<<<<<<
* if fst_type_string != tfst.FstType():
* tfst = fst.Convert(deref(tfst), fst_type_string)
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2650, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2654, __pyx_L1_error)
__pyx_v_fst_type_string = __pyx_t_1;
- /* "pywrapfst.pyx":2651
+ /* "pywrapfst.pyx":2655
* if fst_type:
* fst_type_string = tostring(fst_type)
* if fst_type_string != tfst.FstType(): # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_fst_type_string != __pyx_v_tfst->FstType()) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2652
+ /* "pywrapfst.pyx":2656
* fst_type_string = tostring(fst_type)
* if fst_type_string != tfst.FstType():
* tfst = fst.Convert(deref(tfst), fst_type_string) # <<<<<<<<<<<<<<
*/
__pyx_v_tfst = fst::script::Convert((*__pyx_v_tfst), __pyx_v_fst_type_string);
- /* "pywrapfst.pyx":2653
+ /* "pywrapfst.pyx":2657
* if fst_type_string != tfst.FstType():
* tfst = fst.Convert(deref(tfst), fst_type_string)
* if tfst == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_tfst == NULL) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2654
+ /* "pywrapfst.pyx":2658
* tfst = fst.Convert(deref(tfst), fst_type_string)
* if tfst == NULL:
* raise FstOpError("Conversion to {!r} failed.".format(fst_type)) # <<<<<<<<<<<<<<
* return _init_XFst(tfst)
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2654, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2654, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
}
if (!__pyx_t_6) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_fst_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2654, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_fst_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_fst_type};
- __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2654, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2658, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_fst_type};
- __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2654, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2658, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else
#endif
{
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2654, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_INCREF(__pyx_v_fst_type);
__Pyx_GIVEREF(__pyx_v_fst_type);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_fst_type);
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2654, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
}
}
if (!__pyx_t_5) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2658, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_8};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2658, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_8};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2658, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
{
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2654, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__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, 2654, __pyx_L1_error)
+ __PYX_ERR(0, 2658, __pyx_L1_error)
- /* "pywrapfst.pyx":2653
+ /* "pywrapfst.pyx":2657
* if fst_type_string != tfst.FstType():
* tfst = fst.Convert(deref(tfst), fst_type_string)
* if tfst == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2651
+ /* "pywrapfst.pyx":2655
* if fst_type:
* fst_type_string = tostring(fst_type)
* if fst_type_string != tfst.FstType(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2649
+ /* "pywrapfst.pyx":2653
* # Converts if requested.
* cdef string fst_type_string
* if fst_type: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2655
+ /* "pywrapfst.pyx":2659
* if tfst == NULL:
* raise FstOpError("Conversion to {!r} failed.".format(fst_type))
* return _init_XFst(tfst) # <<<<<<<<<<<<<<
* cdef _Fst _deserialize_Fst(fst_string, fst_type=None):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2655, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2659, __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":2643
+ /* "pywrapfst.pyx":2647
*
*
* cdef _Fst _read_Fst(filename, fst_type=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2657
+/* "pywrapfst.pyx":2661
* return _init_XFst(tfst)
*
* cdef _Fst _deserialize_Fst(fst_string, fst_type=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2658
+ /* "pywrapfst.pyx":2662
*
* cdef _Fst _deserialize_Fst(fst_string, fst_type=None):
* ofst = fst.FstClass.ReadFromString(fst_string) # <<<<<<<<<<<<<<
* if fst_type is not None:
* fst_type_string = tostring(fst_type)
*/
- __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_fst_string); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2658, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_fst_string); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2662, __pyx_L1_error)
__pyx_v_ofst = fst::script::FstClass::ReadFromString(__pyx_t_1);
- /* "pywrapfst.pyx":2659
+ /* "pywrapfst.pyx":2663
* cdef _Fst _deserialize_Fst(fst_string, fst_type=None):
* ofst = fst.FstClass.ReadFromString(fst_string)
* if fst_type is not None: # <<<<<<<<<<<<<<
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":2660
+ /* "pywrapfst.pyx":2664
* ofst = fst.FstClass.ReadFromString(fst_string)
* if fst_type is not None:
* fst_type_string = tostring(fst_type) # <<<<<<<<<<<<<<
* if fst_type_string != ofst.FstType():
* ofst = fst.Convert(deref(ofst), fst_type_string)
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2660, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2664, __pyx_L1_error)
__pyx_v_fst_type_string = __pyx_t_1;
- /* "pywrapfst.pyx":2661
+ /* "pywrapfst.pyx":2665
* if fst_type is not None:
* fst_type_string = tostring(fst_type)
* if fst_type_string != ofst.FstType(): # <<<<<<<<<<<<<<
__pyx_t_3 = ((__pyx_v_fst_type_string != __pyx_v_ofst->FstType()) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":2662
+ /* "pywrapfst.pyx":2666
* fst_type_string = tostring(fst_type)
* if fst_type_string != ofst.FstType():
* ofst = fst.Convert(deref(ofst), fst_type_string) # <<<<<<<<<<<<<<
*/
__pyx_v_ofst = fst::script::Convert((*__pyx_v_ofst), __pyx_v_fst_type_string);
- /* "pywrapfst.pyx":2663
+ /* "pywrapfst.pyx":2667
* if fst_type_string != ofst.FstType():
* ofst = fst.Convert(deref(ofst), fst_type_string)
* if ofst == NULL: # <<<<<<<<<<<<<<
__pyx_t_3 = ((__pyx_v_ofst == NULL) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":2664
+ /* "pywrapfst.pyx":2668
* ofst = fst.Convert(deref(ofst), fst_type_string)
* if ofst == NULL:
* raise FstOpError("Conversion to {!r} failed.".format(fst_type)) # <<<<<<<<<<<<<<
* return _init_XFst(ofst)
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2664, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2664, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
}
}
if (!__pyx_t_8) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_fst_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2664, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_fst_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_fst_type};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2664, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2668, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_fst_type};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2664, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2668, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
{
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2664, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
__Pyx_INCREF(__pyx_v_fst_type);
__Pyx_GIVEREF(__pyx_v_fst_type);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_fst_type);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2664, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
}
}
if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2664, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2668, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2664, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2668, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2664, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2668, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2664, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2664, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
__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, 2664, __pyx_L1_error)
+ __PYX_ERR(0, 2668, __pyx_L1_error)
- /* "pywrapfst.pyx":2663
+ /* "pywrapfst.pyx":2667
* if fst_type_string != ofst.FstType():
* ofst = fst.Convert(deref(ofst), fst_type_string)
* if ofst == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2661
+ /* "pywrapfst.pyx":2665
* if fst_type is not None:
* fst_type_string = tostring(fst_type)
* if fst_type_string != ofst.FstType(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2659
+ /* "pywrapfst.pyx":2663
* cdef _Fst _deserialize_Fst(fst_string, fst_type=None):
* ofst = fst.FstClass.ReadFromString(fst_string)
* if fst_type is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2665
+ /* "pywrapfst.pyx":2669
* if ofst == NULL:
* raise FstOpError("Conversion to {!r} failed.".format(fst_type))
* return _init_XFst(ofst) # <<<<<<<<<<<<<<
* class Fst(object):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_ofst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2665, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_ofst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2669, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2657
+ /* "pywrapfst.pyx":2661
* return _init_XFst(tfst)
*
* cdef _Fst _deserialize_Fst(fst_string, fst_type=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2684
+/* "pywrapfst.pyx":2688
* """
*
* 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, 2684, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 2688, __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, 2684, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2688, __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":2685
+ /* "pywrapfst.pyx":2689
*
* 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, 2685, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__create_Fst(&__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2689, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2684
+ /* "pywrapfst.pyx":2688
* """
*
* def __new__(cls, arc_type=b"standard"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2688
+/* "pywrapfst.pyx":2692
*
* @staticmethod
* def read(filename, fst_type=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(0, 2688, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(0, 2692, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("read", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2688, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2692, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Fst.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
struct __pyx_opt_args_9pywrapfst__read_Fst __pyx_t_2;
__Pyx_RefNannySetupContext("read", 0);
- /* "pywrapfst.pyx":2706
+ /* "pywrapfst.pyx":2710
* FstOpError: Read-time conversion failed.
* """
* return _read_Fst(filename, fst_type) # <<<<<<<<<<<<<<
__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__read_Fst(__pyx_v_filename, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2706, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst(__pyx_v_filename, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2710, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2688
+ /* "pywrapfst.pyx":2692
*
* @staticmethod
* def read(filename, fst_type=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2709
+/* "pywrapfst.pyx":2713
*
* @staticmethod
* def read_from_string(fst_string, fst_type=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_from_string") < 0)) __PYX_ERR(0, 2709, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_from_string") < 0)) __PYX_ERR(0, 2713, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("read_from_string", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2709, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_from_string", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2713, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Fst.read_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
struct __pyx_opt_args_9pywrapfst__deserialize_Fst __pyx_t_2;
__Pyx_RefNannySetupContext("read_from_string", 0);
- /* "pywrapfst.pyx":2727
+ /* "pywrapfst.pyx":2731
* FstOpError: Read-time conversion failed.
* """
* return _deserialize_Fst(fst_string, fst_type) # <<<<<<<<<<<<<<
__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__deserialize_Fst(__pyx_v_fst_string, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2727, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__deserialize_Fst(__pyx_v_fst_string, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2731, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2709
+ /* "pywrapfst.pyx":2713
*
* @staticmethod
* def read_from_string(fst_string, fst_type=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2811
+/* "pywrapfst.pyx":2815
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":2812
+ /* "pywrapfst.pyx":2816
*
* 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_s_Arc_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2812, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Arc_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2816, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2812, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2816, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2812, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2816, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
}
}
if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2812, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2812, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2812, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2812, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2816, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2812, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2811
+ /* "pywrapfst.pyx":2815
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2814
+/* "pywrapfst.pyx":2818
* return "<Arc at 0x{:x}>".format(id(self))
*
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_olabel)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 2814, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 2818, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 2814, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 2818, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nextstate)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 2814, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 2818, __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, 2814, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2818, __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, 2814, __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, 2814, __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, 2818, __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, 2818, __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, 2814, __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, 2818, __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, 2814, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2818, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Arc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
fst::script::WeightClass __pyx_t_2;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":2815
+ /* "pywrapfst.pyx":2819
*
* 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_convert_string_from_py_std__in_string(__pyx_n_b_tropical); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2815, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2815, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_tropical); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2819, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2819, __pyx_L1_error)
__pyx_v_wc = __pyx_t_2;
- /* "pywrapfst.pyx":2816
+ /* "pywrapfst.pyx":2820
* 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 '%s'", "_arc");
- __PYX_ERR(0, 2816, __pyx_L1_error)
+ __PYX_ERR(0, 2820, __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":2814
+ /* "pywrapfst.pyx":2818
* return "<Arc at 0x{:x}>".format(id(self))
*
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2818
+/* "pywrapfst.pyx":2822
* self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
*
* cpdef Arc copy(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2818, __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, 2822, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_3Arc_5copy)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2818, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2822, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2818, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2822, __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, 2818, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Arc))))) __PYX_ERR(0, 2822, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":2819
+ /* "pywrapfst.pyx":2823
*
* 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, 2819, __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, 2823, __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, 2819, __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, 2823, __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, 2819, __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, 2823, __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, 2819, __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, 2823, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2819, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2823, __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, 2819, __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, 2823, __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":2818
+ /* "pywrapfst.pyx":2822
* 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, 2818, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Arc_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2822, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2823
+/* "pywrapfst.pyx":2827
* property ilabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":2824
+ /* "pywrapfst.pyx":2828
*
* 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 '%s'", "_arc");
- __PYX_ERR(0, 2824, __pyx_L1_error)
+ __PYX_ERR(0, 2828, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2828, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2823
+ /* "pywrapfst.pyx":2827
* property ilabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2826
+/* "pywrapfst.pyx":2830
* 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, 2826, __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, 2830, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":2827
+ /* "pywrapfst.pyx":2831
*
* 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 '%s'", "_arc");
- __PYX_ERR(0, 2827, __pyx_L1_error)
+ __PYX_ERR(0, 2831, __pyx_L1_error)
}
(*__pyx_v_self->_arc).ilabel = __pyx_v_value;
- /* "pywrapfst.pyx":2826
+ /* "pywrapfst.pyx":2830
* return deref(self._arc).ilabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2831
+/* "pywrapfst.pyx":2835
* property olabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":2832
+ /* "pywrapfst.pyx":2836
*
* 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 '%s'", "_arc");
- __PYX_ERR(0, 2832, __pyx_L1_error)
+ __PYX_ERR(0, 2836, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2832, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2836, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2831
+ /* "pywrapfst.pyx":2835
* property olabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2834
+/* "pywrapfst.pyx":2838
* 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, 2834, __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, 2838, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":2835
+ /* "pywrapfst.pyx":2839
*
* 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 '%s'", "_arc");
- __PYX_ERR(0, 2835, __pyx_L1_error)
+ __PYX_ERR(0, 2839, __pyx_L1_error)
}
(*__pyx_v_self->_arc).olabel = __pyx_v_value;
- /* "pywrapfst.pyx":2834
+ /* "pywrapfst.pyx":2838
* return deref(self._arc).olabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2839
+/* "pywrapfst.pyx":2843
* property weight:
*
* def __get__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":2840
+ /* "pywrapfst.pyx":2844
*
* def __get__(self):
* cdef Weight weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
* return weight
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2840, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2840, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2844, __pyx_L1_error)
__pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":2841
+ /* "pywrapfst.pyx":2845
* 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 '%s'", "_weight");
- __PYX_ERR(0, 2841, __pyx_L1_error)
+ __PYX_ERR(0, 2845, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
- __PYX_ERR(0, 2841, __pyx_L1_error)
+ __PYX_ERR(0, 2845, __pyx_L1_error)
}
__pyx_v_weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_arc).weight));
- /* "pywrapfst.pyx":2842
+ /* "pywrapfst.pyx":2846
* 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":2839
+ /* "pywrapfst.pyx":2843
* property weight:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2844
+/* "pywrapfst.pyx":2848
* return weight
*
* def __set__(self, weight): # <<<<<<<<<<<<<<
fst::script::WeightClass __pyx_t_2;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":2845
+ /* "pywrapfst.pyx":2849
*
* def __set__(self, weight):
* deref(self._arc).weight = _get_WeightClass_or_One(b"tropical", weight) # <<<<<<<<<<<<<<
*
* property nextstate:
*/
- __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_tropical); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2845, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2845, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_tropical); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2849, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2849, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
- __PYX_ERR(0, 2845, __pyx_L1_error)
+ __PYX_ERR(0, 2849, __pyx_L1_error)
}
(*__pyx_v_self->_arc).weight = __pyx_t_2;
- /* "pywrapfst.pyx":2844
+ /* "pywrapfst.pyx":2848
* return weight
*
* def __set__(self, weight): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2849
+/* "pywrapfst.pyx":2853
* property nextstate:
*
* def __get__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":2850
+ /* "pywrapfst.pyx":2854
*
* 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 '%s'", "_arc");
- __PYX_ERR(0, 2850, __pyx_L1_error)
+ __PYX_ERR(0, 2854, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2850, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2854, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2849
+ /* "pywrapfst.pyx":2853
* property nextstate:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2852
+/* "pywrapfst.pyx":2856
* 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, 2852, __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, 2856, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":2853
+ /* "pywrapfst.pyx":2857
*
* 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 '%s'", "_arc");
- __PYX_ERR(0, 2853, __pyx_L1_error)
+ __PYX_ERR(0, 2857, __pyx_L1_error)
}
(*__pyx_v_self->_arc).nextstate = __pyx_v_value;
- /* "pywrapfst.pyx":2852
+ /* "pywrapfst.pyx":2856
* return deref(self._arc).nextstate
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2856
+/* "pywrapfst.pyx":2860
*
*
* cdef Arc _init_Arc(const fst.ArcClass &arc): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("_init_Arc", 0);
- /* "pywrapfst.pyx":2857
+ /* "pywrapfst.pyx":2861
*
* cdef Arc _init_Arc(const fst.ArcClass &arc):
* cdef Weight weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* weight._weight.reset(new fst.WeightClass(arc.weight))
* return Arc(<int64> arc.ilabel, <int64> arc.olabel, weight,
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2857, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2861, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2857, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2861, __pyx_L1_error)
__pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":2858
+ /* "pywrapfst.pyx":2862
* 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 '%s'", "_weight");
- __PYX_ERR(0, 2858, __pyx_L1_error)
+ __PYX_ERR(0, 2862, __pyx_L1_error)
}
__pyx_v_weight->_weight.reset(new fst::script::WeightClass(__pyx_v_arc.weight));
- /* "pywrapfst.pyx":2859
+ /* "pywrapfst.pyx":2863
* cdef Weight weight = Weight.__new__(Weight)
* weight._weight.reset(new fst.WeightClass(arc.weight))
* return Arc(<int64> arc.ilabel, <int64> arc.olabel, weight, # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(((__pyx_t_10basictypes_int64)__pyx_v_arc.ilabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2859, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(((__pyx_t_10basictypes_int64)__pyx_v_arc.ilabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2863, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(((__pyx_t_10basictypes_int64)__pyx_v_arc.olabel)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2859, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(((__pyx_t_10basictypes_int64)__pyx_v_arc.olabel)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2863, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":2860
+ /* "pywrapfst.pyx":2864
* weight._weight.reset(new fst.WeightClass(arc.weight))
* return Arc(<int64> arc.ilabel, <int64> arc.olabel, weight,
* <int64> arc.nextstate) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(((__pyx_t_10basictypes_int64)__pyx_v_arc.nextstate)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2860, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(((__pyx_t_10basictypes_int64)__pyx_v_arc.nextstate)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2864, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":2859
+ /* "pywrapfst.pyx":2863
* cdef Weight weight = Weight.__new__(Weight)
* weight._weight.reset(new fst.WeightClass(arc.weight))
* return Arc(<int64> arc.ilabel, <int64> arc.olabel, weight, # <<<<<<<<<<<<<<
* <int64> arc.nextstate)
*
*/
- __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2859, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2863, __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, 2859, __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, 2863, __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":2856
+ /* "pywrapfst.pyx":2860
*
*
* cdef Arc _init_Arc(const fst.ArcClass &arc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2873
+/* "pywrapfst.pyx":2877
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":2874
+ /* "pywrapfst.pyx":2878
*
* 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_s_ArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2874, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_ArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2878, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2874, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2878, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2874, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2878, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
}
}
if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2878, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2878, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2878, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2874, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2878, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2878, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2873
+ /* "pywrapfst.pyx":2877
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2876
+/* "pywrapfst.pyx":2880
* return "<ArcIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _Fst ifst, int64 state): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2876, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2880, __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, 2876, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2880, __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, 2876, __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, 2880, __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, 2876, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2880, __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, 2876, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 2880, __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_4;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":2877
+ /* "pywrapfst.pyx":2881
*
* 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 '%s'", "_fst");
- __PYX_ERR(0, 2877, __pyx_L1_error)
+ __PYX_ERR(0, 2881, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_ifst->_fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2878
+ /* "pywrapfst.pyx":2882
* 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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2878, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2882, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2878, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2882, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2878, __pyx_L1_error)
+ __PYX_ERR(0, 2882, __pyx_L1_error)
- /* "pywrapfst.pyx":2877
+ /* "pywrapfst.pyx":2881
*
* def __init__(self, _Fst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2880
+ /* "pywrapfst.pyx":2884
* 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 '%s'", "_fst");
- __PYX_ERR(0, 2880, __pyx_L1_error)
+ __PYX_ERR(0, 2884, __pyx_L1_error)
}
__pyx_t_4 = __pyx_v_ifst->_fst;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 2880, __pyx_L1_error)
+ __PYX_ERR(0, 2884, __pyx_L1_error)
}
__pyx_v_self->_fst = __pyx_t_4;
- /* "pywrapfst.pyx":2881
+ /* "pywrapfst.pyx":2885
* # 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 '%s'", "_aiter");
- __PYX_ERR(0, 2881, __pyx_L1_error)
+ __PYX_ERR(0, 2885, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 2881, __pyx_L1_error)
+ __PYX_ERR(0, 2885, __pyx_L1_error)
}
__pyx_v_self->_aiter.reset(new fst::script::ArcIteratorClass((*__pyx_v_self->_fst), __pyx_v_state));
- /* "pywrapfst.pyx":2876
+ /* "pywrapfst.pyx":2880
* return "<ArcIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _Fst ifst, int64 state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2884
+/* "pywrapfst.pyx":2888
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":2885
+ /* "pywrapfst.pyx":2889
* # 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":2884
+ /* "pywrapfst.pyx":2888
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2888
+/* "pywrapfst.pyx":2892
*
* # 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":2889
+ /* "pywrapfst.pyx":2893
* # 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 '%s'", "done");
- __PYX_ERR(0, 2889, __pyx_L1_error)
+ __PYX_ERR(0, 2893, __pyx_L1_error)
}
__pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2890
+ /* "pywrapfst.pyx":2894
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* self.next()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 2890, __pyx_L1_error)
+ __PYX_ERR(0, 2894, __pyx_L1_error)
- /* "pywrapfst.pyx":2889
+ /* "pywrapfst.pyx":2893
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2891
+ /* "pywrapfst.pyx":2895
* 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 '%s'", "value");
- __PYX_ERR(0, 2891, __pyx_L1_error)
+ __PYX_ERR(0, 2895, __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, 2891, __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, 2895, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":2892
+ /* "pywrapfst.pyx":2896
* raise StopIteration
* result = self.value()
* self.next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "next");
- __PYX_ERR(0, 2892, __pyx_L1_error)
+ __PYX_ERR(0, 2896, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":2893
+ /* "pywrapfst.pyx":2897
* result = self.value()
* self.next()
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":2888
+ /* "pywrapfst.pyx":2892
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2895
+/* "pywrapfst.pyx":2899
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2895, __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, 2899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_9done)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2895, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2899, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2895, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2899, __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, 2895, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2899, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":2907
+ /* "pywrapfst.pyx":2911
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 2907, __pyx_L1_error)
+ __PYX_ERR(0, 2911, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":2895
+ /* "pywrapfst.pyx":2899
* 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, 2895, __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, 2899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2909
+/* "pywrapfst.pyx":2913
* return self._aiter.get().Done()
*
* cpdef uint32 flags(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2909, __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, 2913, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_11flags)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2909, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2913, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2909, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2913, __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, 2909, __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, 2913, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":2921
+ /* "pywrapfst.pyx":2925
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 2921, __pyx_L1_error)
+ __PYX_ERR(0, 2925, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":2909
+ /* "pywrapfst.pyx":2913
* 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, 2909, __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, 2913, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2923
+/* "pywrapfst.pyx":2927
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2923, __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, 2927, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_13next)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2923, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2927, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2923, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2927, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":2932
+ /* "pywrapfst.pyx":2936
* should use the Pythonic API.
* """
* self._aiter.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
- __PYX_ERR(0, 2932, __pyx_L1_error)
+ __PYX_ERR(0, 2936, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Next();
- /* "pywrapfst.pyx":2923
+ /* "pywrapfst.pyx":2927
* 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, 2923, __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, 2927, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2934
+/* "pywrapfst.pyx":2938
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2934, __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, 2938, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_15position)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2934, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2938, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2934, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2938, __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, 2934, __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, 2938, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":2946
+ /* "pywrapfst.pyx":2950
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 2946, __pyx_L1_error)
+ __PYX_ERR(0, 2950, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Position();
goto __pyx_L0;
- /* "pywrapfst.pyx":2934
+ /* "pywrapfst.pyx":2938
* 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, 2934, __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, 2938, __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":2952
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2948, __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, 2952, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_17reset)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2948, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2952, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2948, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2952, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":2957
+ /* "pywrapfst.pyx":2961
* should use the Pythonic API.
* """
* self._aiter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
- __PYX_ERR(0, 2957, __pyx_L1_error)
+ __PYX_ERR(0, 2961, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Reset();
- /* "pywrapfst.pyx":2948
+ /* "pywrapfst.pyx":2952
* 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, 2948, __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, 2952, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2959
+/* "pywrapfst.pyx":2963
* self._aiter.get().Reset()
*
* cpdef void seek(self, size_t a): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2959, __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, 2963, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_19seek)) {
- __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2959, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2963, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2959, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2963, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2959, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2963, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2959, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2963, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2959, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2963, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2959, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2963, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":2971
+ /* "pywrapfst.pyx":2975
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 2971, __pyx_L1_error)
+ __PYX_ERR(0, 2975, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Seek(__pyx_v_a);
- /* "pywrapfst.pyx":2959
+ /* "pywrapfst.pyx":2963
* 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, 2959, __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, 2963, __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, 2959, __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, 2963, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2973
+/* "pywrapfst.pyx":2977
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint32 flags, uint32 mask): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2973, __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, 2977, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__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, 2973, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2977, __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, 2973, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2977, __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, 2973, __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, 2977, __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, 2973, __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, 2977, __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, 2973, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2977, __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, 2973, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2977, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":2986
+ /* "pywrapfst.pyx":2990
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 2986, __pyx_L1_error)
+ __PYX_ERR(0, 2990, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);
- /* "pywrapfst.pyx":2973
+ /* "pywrapfst.pyx":2977
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint32 flags, uint32 mask): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 2973, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 2977, __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, 2973, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 2977, __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, 2973, __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, 2973, __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, 2977, __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, 2977, __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, 2973, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2977, __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, 2973, __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, 2977, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2988
+/* "pywrapfst.pyx":2992
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef object value(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2988, __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, 2992, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_23value)) {
__Pyx_XDECREF(__pyx_r);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2988, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2992, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2988, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2992, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":2997
+ /* "pywrapfst.pyx":3001
* should use the Pythonic API.
* """
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 2997, __pyx_L1_error)
+ __PYX_ERR(0, 3001, __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, 2997, __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, 3001, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2988
+ /* "pywrapfst.pyx":2992
* 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, 2988, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_11ArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2992, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3011
+/* "pywrapfst.pyx":3015
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3012
+ /* "pywrapfst.pyx":3016
*
* 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_s_MutableArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3012, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_MutableArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3016, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3012, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3016, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3012, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3016, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
}
}
if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3012, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3016, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3012, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3016, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3012, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3016, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3012, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3016, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3012, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3016, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3011
+ /* "pywrapfst.pyx":3015
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3014
+/* "pywrapfst.pyx":3018
* return "<MutableArcIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _MutableFst ifst, int64 state): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3014, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3018, __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, 3014, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3018, __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, 3014, __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, 3018, __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, 3014, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3018, __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, 3014, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__MutableFst, 1, "ifst", 0))) __PYX_ERR(0, 3018, __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_4;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":3015
+ /* "pywrapfst.pyx":3019
*
* 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 '%s'", "_fst");
- __PYX_ERR(0, 3015, __pyx_L1_error)
+ __PYX_ERR(0, 3019, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_ifst->__pyx_base._fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":3016
+ /* "pywrapfst.pyx":3020
* 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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3016, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3020, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3016, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3020, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 3016, __pyx_L1_error)
+ __PYX_ERR(0, 3020, __pyx_L1_error)
- /* "pywrapfst.pyx":3015
+ /* "pywrapfst.pyx":3019
*
* def __init__(self, _MutableFst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3018
+ /* "pywrapfst.pyx":3022
* 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 '%s'", "_mfst");
- __PYX_ERR(0, 3018, __pyx_L1_error)
+ __PYX_ERR(0, 3022, __pyx_L1_error)
}
__pyx_t_4 = __pyx_v_ifst->_mfst;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 3018, __pyx_L1_error)
+ __PYX_ERR(0, 3022, __pyx_L1_error)
}
__pyx_v_self->_mfst = __pyx_t_4;
- /* "pywrapfst.pyx":3019
+ /* "pywrapfst.pyx":3023
* # 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 '%s'", "_aiter");
- __PYX_ERR(0, 3019, __pyx_L1_error)
+ __PYX_ERR(0, 3023, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 3019, __pyx_L1_error)
+ __PYX_ERR(0, 3023, __pyx_L1_error)
}
__pyx_v_self->_aiter.reset(new fst::script::MutableArcIteratorClass(__pyx_v_ifst->_mfst.get(), __pyx_v_state));
- /* "pywrapfst.pyx":3014
+ /* "pywrapfst.pyx":3018
* return "<MutableArcIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _MutableFst ifst, int64 state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3022
+/* "pywrapfst.pyx":3026
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":3023
+ /* "pywrapfst.pyx":3027
* # 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":3022
+ /* "pywrapfst.pyx":3026
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3026
+/* "pywrapfst.pyx":3030
*
* # 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":3027
+ /* "pywrapfst.pyx":3031
* # 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 '%s'", "done");
- __PYX_ERR(0, 3027, __pyx_L1_error)
+ __PYX_ERR(0, 3031, __pyx_L1_error)
}
__pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":3028
+ /* "pywrapfst.pyx":3032
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* self.next()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 3028, __pyx_L1_error)
+ __PYX_ERR(0, 3032, __pyx_L1_error)
- /* "pywrapfst.pyx":3027
+ /* "pywrapfst.pyx":3031
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3029
+ /* "pywrapfst.pyx":3033
* 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 '%s'", "value");
- __PYX_ERR(0, 3029, __pyx_L1_error)
+ __PYX_ERR(0, 3033, __pyx_L1_error)
}
- __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3029, __pyx_L1_error)
+ __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3033, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":3030
+ /* "pywrapfst.pyx":3034
* raise StopIteration
* result = self.value()
* self.next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "next");
- __PYX_ERR(0, 3030, __pyx_L1_error)
+ __PYX_ERR(0, 3034, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3031
+ /* "pywrapfst.pyx":3035
* result = self.value()
* self.next()
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":3026
+ /* "pywrapfst.pyx":3030
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3033
+/* "pywrapfst.pyx":3037
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3033, __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, 3037, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_9done)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3033, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3037, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3033, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3037, __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, 3033, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3037, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3045
+ /* "pywrapfst.pyx":3049
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 3045, __pyx_L1_error)
+ __PYX_ERR(0, 3049, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3033
+ /* "pywrapfst.pyx":3037
* 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_18MutableArcIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3033, __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, 3037, __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":3051
* return self._aiter.get().Done()
*
* cpdef uint32 flags(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); 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_flags); 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)__pyx_pw_9pywrapfst_18MutableArcIterator_11flags)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3047, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3051, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3047, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); 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_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3047, __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, 3051, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3059
+ /* "pywrapfst.pyx":3063
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 3059, __pyx_L1_error)
+ __PYX_ERR(0, 3063, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":3047
+ /* "pywrapfst.pyx":3051
* 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, 3047, __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, 3051, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3061
+/* "pywrapfst.pyx":3065
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3061, __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, 3065, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_13next)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3061, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3065, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3061, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3065, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3070
+ /* "pywrapfst.pyx":3074
* should use the Pythonic API.
* """
* self._aiter.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
- __PYX_ERR(0, 3070, __pyx_L1_error)
+ __PYX_ERR(0, 3074, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Next();
- /* "pywrapfst.pyx":3061
+ /* "pywrapfst.pyx":3065
* 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, 3061, __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, 3065, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3072
+/* "pywrapfst.pyx":3076
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3072, __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, 3076, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_15position)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3072, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3076, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3072, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3076, __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, 3072, __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, 3076, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3084
+ /* "pywrapfst.pyx":3088
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 3084, __pyx_L1_error)
+ __PYX_ERR(0, 3088, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Position();
goto __pyx_L0;
- /* "pywrapfst.pyx":3072
+ /* "pywrapfst.pyx":3076
* 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, 3072, __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, 3076, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3086
+/* "pywrapfst.pyx":3090
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3086, __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, 3090, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_17reset)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3086, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3090, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3086, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3090, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3095
+ /* "pywrapfst.pyx":3099
* should use the Pythonic API.
* """
* self._aiter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
- __PYX_ERR(0, 3095, __pyx_L1_error)
+ __PYX_ERR(0, 3099, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Reset();
- /* "pywrapfst.pyx":3086
+ /* "pywrapfst.pyx":3090
* 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, 3086, __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, 3090, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3097
+/* "pywrapfst.pyx":3101
* self._aiter.get().Reset()
*
* cpdef void seek(self, size_t a): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3097, __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, 3101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_19seek)) {
- __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3097, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3097, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3101, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3097, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3101, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3097, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3101, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3097, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3097, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3109
+ /* "pywrapfst.pyx":3113
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 3109, __pyx_L1_error)
+ __PYX_ERR(0, 3113, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Seek(__pyx_v_a);
- /* "pywrapfst.pyx":3097
+ /* "pywrapfst.pyx":3101
* 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, 3097, __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, 3101, __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, 3097, __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, 3101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3111
+/* "pywrapfst.pyx":3115
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint32 flags, uint32 mask): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3111, __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, 3115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_21set_flags)) {
- __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3111, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3115, __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, 3111, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3115, __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, 3111, __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, 3115, __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, 3111, __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, 3115, __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, 3111, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3115, __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, 3111, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3124
+ /* "pywrapfst.pyx":3128
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 3124, __pyx_L1_error)
+ __PYX_ERR(0, 3128, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);
- /* "pywrapfst.pyx":3111
+ /* "pywrapfst.pyx":3115
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint32 flags, uint32 mask): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3111, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3115, __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, 3111, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3115, __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, 3111, __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, 3111, __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, 3115, __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, 3115, __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, 3111, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3115, __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, 3111, __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, 3115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3126
+/* "pywrapfst.pyx":3130
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef void set_value(self, Arc arc): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3126, __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, 3130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_23set_value)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_arc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3126, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_arc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_arc)};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3126, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3130, __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[2] = {__pyx_t_4, ((PyObject *)__pyx_v_arc)};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3126, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3130, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3126, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(((PyObject *)__pyx_v_arc));
__Pyx_GIVEREF(((PyObject *)__pyx_v_arc));
PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_arc));
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3126, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3135
+ /* "pywrapfst.pyx":3139
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 3135, __pyx_L1_error)
+ __PYX_ERR(0, 3139, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
- __PYX_ERR(0, 3135, __pyx_L1_error)
+ __PYX_ERR(0, 3139, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetValue((*__pyx_v_arc->_arc));
- /* "pywrapfst.pyx":3126
+ /* "pywrapfst.pyx":3130
* 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, 3126, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 3130, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_22set_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, 3126, __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, 3130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3137
+/* "pywrapfst.pyx":3141
* self._aiter.get().SetValue(deref(arc._arc))
*
* cpdef object value(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3137, __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, 3141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_25value)) {
__Pyx_XDECREF(__pyx_r);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3137, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3141, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3137, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3141, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3146
+ /* "pywrapfst.pyx":3150
* should use the Pythonic API.
* """
* 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 '%s'", "_aiter");
- __PYX_ERR(0, 3146, __pyx_L1_error)
+ __PYX_ERR(0, 3150, __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, 3146, __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, 3150, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3137
+ /* "pywrapfst.pyx":3141
* 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, 3137, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_18MutableArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3162
+/* "pywrapfst.pyx":3166
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3163
+ /* "pywrapfst.pyx":3167
*
* 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_s_StateIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3163, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_StateIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3163, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3163, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
}
}
if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3163, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3167, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3163, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3167, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3163, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3167, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3163, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3163, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3162
+ /* "pywrapfst.pyx":3166
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3165
+/* "pywrapfst.pyx":3169
* 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, 3165, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3169, __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, 3165, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3169, __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, 3165, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3169, __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":3167
+ /* "pywrapfst.pyx":3171
* 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 '%s'", "_fst");
- __PYX_ERR(0, 3167, __pyx_L1_error)
+ __PYX_ERR(0, 3171, __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 '%s'", "_fst");
- __PYX_ERR(0, 3167, __pyx_L1_error)
+ __PYX_ERR(0, 3171, __pyx_L1_error)
}
__pyx_v_self->_fst = __pyx_t_1;
- /* "pywrapfst.pyx":3168
+ /* "pywrapfst.pyx":3172
* # 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 '%s'", "_siter");
- __PYX_ERR(0, 3168, __pyx_L1_error)
+ __PYX_ERR(0, 3172, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3168, __pyx_L1_error)
+ __PYX_ERR(0, 3172, __pyx_L1_error)
}
__pyx_v_self->_siter.reset(new fst::script::StateIteratorClass((*__pyx_v_self->_fst)));
- /* "pywrapfst.pyx":3165
+ /* "pywrapfst.pyx":3169
* return "<StateIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _Fst ifst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3171
+/* "pywrapfst.pyx":3175
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":3172
+ /* "pywrapfst.pyx":3176
* # 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":3171
+ /* "pywrapfst.pyx":3175
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3175
+/* "pywrapfst.pyx":3179
*
* # 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":3176
+ /* "pywrapfst.pyx":3180
* # 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 '%s'", "done");
- __PYX_ERR(0, 3176, __pyx_L1_error)
+ __PYX_ERR(0, 3180, __pyx_L1_error)
}
__pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":3177
+ /* "pywrapfst.pyx":3181
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* self.next()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 3177, __pyx_L1_error)
+ __PYX_ERR(0, 3181, __pyx_L1_error)
- /* "pywrapfst.pyx":3176
+ /* "pywrapfst.pyx":3180
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3178
+ /* "pywrapfst.pyx":3182
* 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 '%s'", "value");
- __PYX_ERR(0, 3178, __pyx_L1_error)
+ __PYX_ERR(0, 3182, __pyx_L1_error)
}
__pyx_v_result = ((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3179
+ /* "pywrapfst.pyx":3183
* 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 '%s'", "next");
- __PYX_ERR(0, 3179, __pyx_L1_error)
+ __PYX_ERR(0, 3183, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3180
+ /* "pywrapfst.pyx":3184
* 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, 3180, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3175
+ /* "pywrapfst.pyx":3179
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3182
+/* "pywrapfst.pyx":3186
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3182, __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, 3186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_9done)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3182, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3186, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3182, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3186, __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, 3182, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3186, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3194
+ /* "pywrapfst.pyx":3198
* 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 '%s'", "_siter");
- __PYX_ERR(0, 3194, __pyx_L1_error)
+ __PYX_ERR(0, 3198, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3182
+ /* "pywrapfst.pyx":3186
* 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, 3182, __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, 3186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3196
+/* "pywrapfst.pyx":3200
* return self._siter.get().Done()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3196, __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, 3200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_11next)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3196, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3200, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3196, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3200, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3205
+ /* "pywrapfst.pyx":3209
* should use the Pythonic API.
* """
* self._siter.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
- __PYX_ERR(0, 3205, __pyx_L1_error)
+ __PYX_ERR(0, 3209, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Next();
- /* "pywrapfst.pyx":3196
+ /* "pywrapfst.pyx":3200
* 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, 3196, __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, 3200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3207
+/* "pywrapfst.pyx":3211
* self._siter.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3207, __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, 3211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_13reset)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3207, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3211, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3207, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3211, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3216
+ /* "pywrapfst.pyx":3220
* should use the Pythonic API.
* """
* self._siter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
- __PYX_ERR(0, 3216, __pyx_L1_error)
+ __PYX_ERR(0, 3220, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Reset();
- /* "pywrapfst.pyx":3207
+ /* "pywrapfst.pyx":3211
* 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, 3207, __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, 3211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3218
+/* "pywrapfst.pyx":3222
* self._siter.get().Reset()
*
* cpdef int64 value(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3222, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_15value)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3218, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3222, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3218, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3222, __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, 3218, __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, 3222, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3227
+ /* "pywrapfst.pyx":3231
* should use the Pythonic API.
* """
* return self._siter.get().Value() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
- __PYX_ERR(0, 3227, __pyx_L1_error)
+ __PYX_ERR(0, 3231, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Value();
goto __pyx_L0;
- /* "pywrapfst.pyx":3218
+ /* "pywrapfst.pyx":3222
* 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, 3218, __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, 3222, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3233
+/* "pywrapfst.pyx":3237
*
*
* cdef _Fst _map(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * mt=b"identity",
+ * map_type=b"identity",
*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, struct __pyx_opt_args_9pywrapfst__map *__pyx_optional_args) {
float __pyx_v_delta = __pyx_k__34;
- PyObject *__pyx_v_mt = ((PyObject *)__pyx_n_b_identity);
+ PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_b_identity);
- /* "pywrapfst.pyx":3236
+ /* "pywrapfst.pyx":3240
* float delta=fst.kDelta,
- * mt=b"identity",
+ * map_type=b"identity",
* weight=None): # <<<<<<<<<<<<<<
- * cdef fst.MapType map_type
- * if not fst.GetMapType(tostring(mt), addr(map_type)):
+ * cdef fst.MapType map_type_enum
+ * if not fst.GetMapType(tostring(map_type), addr(map_type_enum)):
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- enum fst::script::MapType __pyx_v_map_type;
+ enum fst::script::MapType __pyx_v_map_type_enum;
fst::script::WeightClass __pyx_v_wc;
struct __pyx_obj_9pywrapfst__Fst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_delta = __pyx_optional_args->delta;
if (__pyx_optional_args->__pyx_n > 1) {
- __pyx_v_mt = __pyx_optional_args->mt;
+ __pyx_v_map_type = __pyx_optional_args->map_type;
if (__pyx_optional_args->__pyx_n > 2) {
__pyx_v_weight = __pyx_optional_args->weight;
}
}
}
- /* "pywrapfst.pyx":3238
+ /* "pywrapfst.pyx":3242
* weight=None):
- * cdef fst.MapType map_type
- * if not fst.GetMapType(tostring(mt), addr(map_type)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown map type: {!r}".format(mt))
+ * 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_mt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3238, __pyx_L1_error)
- __pyx_t_2 = ((!(fst::script::GetMapType(__pyx_t_1, (&__pyx_v_map_type)) != 0)) != 0);
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_map_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3242, __pyx_L1_error)
+ __pyx_t_2 = ((!(fst::script::GetMapType(__pyx_t_1, (&__pyx_v_map_type_enum)) != 0)) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":3239
- * cdef fst.MapType map_type
- * if not fst.GetMapType(tostring(mt), addr(map_type)):
- * raise FstArgError("Unknown map type: {!r}".format(mt)) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3243
+ * 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 mt == fst.TIMES_MAPPER else
+ * weight) if map_type_enum == fst.TIMES_MAPPER else
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3239, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_map_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3239, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_map_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_mt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3239, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_map_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_mt};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3239, __pyx_L1_error)
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_map_type};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3243, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_mt};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3239, __pyx_L1_error)
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_map_type};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3243, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3239, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
- __Pyx_INCREF(__pyx_v_mt);
- __Pyx_GIVEREF(__pyx_v_mt);
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_mt);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3239, __pyx_L1_error)
+ __Pyx_INCREF(__pyx_v_map_type);
+ __Pyx_GIVEREF(__pyx_v_map_type);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_map_type);
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_6) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3239, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3243, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3239, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3243, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3239, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3243, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3239, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3239, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 3239, __pyx_L1_error)
+ __PYX_ERR(0, 3243, __pyx_L1_error)
- /* "pywrapfst.pyx":3238
+ /* "pywrapfst.pyx":3242
* weight=None):
- * cdef fst.MapType map_type
- * if not fst.GetMapType(tostring(mt), addr(map_type)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown map type: {!r}".format(mt))
+ * 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(),
*/
}
- /* "pywrapfst.pyx":3241
- * raise FstArgError("Unknown map type: {!r}".format(mt))
+ /* "pywrapfst.pyx":3245
+ * raise FstArgError("Unknown map type: {!r}".format(map_type))
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
- * weight) if mt == fst.TIMES_MAPPER else # <<<<<<<<<<<<<<
+ * 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, delta, wc))
+ * return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, wc))
*/
- __pyx_t_3 = __Pyx_PyInt_From_enum__fst_3a__3a_script_3a__3a_MapType(fst::script::TIMES_MAPPER); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3241, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_mt, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3241, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3241, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
+ if (((__pyx_v_map_type_enum == fst::script::TIMES_MAPPER) != 0)) {
- /* "pywrapfst.pyx":3240
- * if not fst.GetMapType(tostring(mt), addr(map_type)):
- * raise FstArgError("Unknown map type: {!r}".format(mt))
+ /* "pywrapfst.pyx":3244
+ * 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 mt == fst.TIMES_MAPPER else
+ * 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 '%s'", "weight_type");
- __PYX_ERR(0, 3240, __pyx_L1_error)
+ __PYX_ERR(0, 3244, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3241
- * raise FstArgError("Unknown map type: {!r}".format(mt))
+ /* "pywrapfst.pyx":3245
+ * raise FstArgError("Unknown map type: {!r}".format(map_type))
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
- * weight) if mt == fst.TIMES_MAPPER else # <<<<<<<<<<<<<<
+ * 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, delta, wc))
+ * return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, wc))
*/
- __pyx_t_10 = __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, 3240, __pyx_L1_error)
+ __pyx_t_10 = __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, 3244, __pyx_L1_error)
__pyx_t_9 = __pyx_t_10;
} else {
- /* "pywrapfst.pyx":3242
+ /* "pywrapfst.pyx":3246
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
- * weight) if mt == fst.TIMES_MAPPER else
+ * 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, delta, wc))
+ * return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, wc))
*
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 3242, __pyx_L1_error)
+ __PYX_ERR(0, 3246, __pyx_L1_error)
}
- __pyx_t_10 = __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, 3242, __pyx_L1_error)
+ __pyx_t_10 = __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, 3246, __pyx_L1_error)
__pyx_t_9 = __pyx_t_10;
}
__pyx_v_wc = __pyx_t_9;
- /* "pywrapfst.pyx":3243
- * weight) if mt == fst.TIMES_MAPPER else
+ /* "pywrapfst.pyx":3247
+ * 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, delta, wc)) # <<<<<<<<<<<<<<
+ * return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, wc)) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3243, __pyx_L1_error)
+ __PYX_ERR(0, 3247, __pyx_L1_error)
}
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(fst::script::Map((*__pyx_v_ifst->_fst), __pyx_v_map_type, __pyx_v_delta, __pyx_v_wc))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3243, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_4);
- __pyx_t_4 = 0;
+ __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_wc))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3247, __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":3233
+ /* "pywrapfst.pyx":3237
*
*
* cdef _Fst _map(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * mt=b"identity",
+ * map_type=b"identity",
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":3246
+/* "pywrapfst.pyx":3250
*
*
* cpdef _Fst arcmap(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * mt=b"identity",
+ * map_type=b"identity",
*/
static PyObject *__pyx_pw_9pywrapfst_13arcmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_arcmap(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_arcmap *__pyx_optional_args) {
float __pyx_v_delta = __pyx_k__35;
- PyObject *__pyx_v_mt = ((PyObject *)__pyx_n_b_identity);
+ PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_b_identity);
- /* "pywrapfst.pyx":3249
+ /* "pywrapfst.pyx":3253
* float delta=fst.kDelta,
- * mt=b"identity",
+ * map_type=b"identity",
* weight=None): # <<<<<<<<<<<<<<
* """
- * arcmap(ifst, delta=0.0009765625, mt="identity", weight=None)
+ * arcmap(ifst, delta=0.0009765625, map_type="identity", weight=None)
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
struct __pyx_obj_9pywrapfst__Fst *__pyx_r = NULL;
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_delta = __pyx_optional_args->delta;
if (__pyx_optional_args->__pyx_n > 1) {
- __pyx_v_mt = __pyx_optional_args->mt;
+ __pyx_v_map_type = __pyx_optional_args->map_type;
if (__pyx_optional_args->__pyx_n > 2) {
__pyx_v_weight = __pyx_optional_args->weight;
}
}
}
- /* "pywrapfst.pyx":3287
+ /* "pywrapfst.pyx":3292
* See also: `statemap`.
* """
- * return _map(ifst, delta, mt, weight) # <<<<<<<<<<<<<<
+ * return _map(ifst, delta, map_type, weight) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_2.__pyx_n = 3;
__pyx_t_2.delta = __pyx_v_delta;
- __pyx_t_2.mt = __pyx_v_mt;
+ __pyx_t_2.map_type = __pyx_v_map_type;
__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, 3287, __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, 3292, __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":3246
+ /* "pywrapfst.pyx":3250
*
*
* cpdef _Fst arcmap(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * mt=b"identity",
+ * map_type=b"identity",
*/
/* function exit code */
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_13arcmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_12arcmap[] = "\n arcmap(ifst, delta=0.0009765625, mt=\"identity\", weight=None)\n\n Constructively applies a transform to all arcs and final states.\n\n This operation transforms each arc and final state in the input FST using\n one of the following:\n\n * identity: maps to self.\n * input_epsilon: replaces all input labels with epsilon.\n * invert: reciprocates all non-Zero weights.\n * output_epsilon: replaces all output labels with epsilon.\n * plus: adds a constant to all weights.\n * quantize: quantizes weights.\n * rmweight: replaces all non-Zero weights with 1.\n * superfinal: redirects final states to a new superfinal state.\n * times: right-multiplies a constant to all weights.\n * to_log: converts weights to the log semiring.\n * to_log64: converts weights to the log64 semiring.\n * to_standard: converts weights to the tropical (\"standard\") semiring.\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta (ignored unless `mt` is `quantize`).\n map_type: A string matching a known mapping operation (see above).\n weight: A Weight or weight string passed to the arc-mapper; this is ignored\n unless `mt` is `plus` (in which case it defaults to semiring Zero) or\n `times` (in which case it defaults to semiring One).\n\n Returns:\n An FST with arcs and final states remapped.\n\n Raises:\n FstArgError: Unknown map type.\n\n See also: `statemap`.\n ";
+static char __pyx_doc_9pywrapfst_12arcmap[] = "\n arcmap(ifst, delta=0.0009765625, map_type=\"identity\", weight=None)\n\n Constructively applies a transform to all arcs and final states.\n\n This operation transforms each arc and final state in the input FST using\n one of the following:\n\n * identity: maps to self.\n * input_epsilon: replaces all input labels with epsilon.\n * invert: reciprocates all non-Zero weights.\n * output_epsilon: replaces all output labels with epsilon.\n * plus: adds a constant to all weights.\n * quantize: quantizes weights.\n * rmweight: replaces all non-Zero weights with 1.\n * superfinal: redirects final states to a new superfinal state.\n * times: right-multiplies a constant to all weights.\n * to_log: converts weights to the log semiring.\n * to_log64: converts weights to the log64 semiring.\n * to_standard: converts weights to the tropical (\"standard\") semiring.\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta (ignored unless `map_type` is\n `quantize`).\n map_type: A string matching a known mapping operation (see above).\n weight: A Weight or weight string passed to the arc-mapper; this is ignored\n unless `map_type` is `plus` (in which case it defaults to semiring Zero)\n or `times` (in which case it defaults to semiring One).\n\n Returns:\n An FST with arcs and final states remapped.\n\n Raises:\n FstArgError: Unknown map type.\n\n See also: `statemap`.\n ";
static PyObject *__pyx_pw_9pywrapfst_13arcmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
float __pyx_v_delta;
- PyObject *__pyx_v_mt = 0;
+ PyObject *__pyx_v_map_type = 0;
PyObject *__pyx_v_weight = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("arcmap (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_mt,&__pyx_n_s_weight,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_map_type,&__pyx_n_s_weight,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)__pyx_n_b_identity);
- /* "pywrapfst.pyx":3249
+ /* "pywrapfst.pyx":3253
* float delta=fst.kDelta,
- * mt=b"identity",
+ * map_type=b"identity",
* weight=None): # <<<<<<<<<<<<<<
* """
- * arcmap(ifst, delta=0.0009765625, mt="identity", weight=None)
+ * arcmap(ifst, delta=0.0009765625, map_type="identity", weight=None)
*/
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
}
case 2:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mt);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_map_type);
if (value) { values[2] = value; kw_args--; }
}
case 3:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcmap") < 0)) __PYX_ERR(0, 3246, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcmap") < 0)) __PYX_ERR(0, 3250, __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, 3247, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3251, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__35;
}
- __pyx_v_mt = values[2];
+ __pyx_v_map_type = values[2];
__pyx_v_weight = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3246, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3250, __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, 3246, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_12arcmap(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_mt, __pyx_v_weight);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3250, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_12arcmap(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_map_type, __pyx_v_weight);
- /* "pywrapfst.pyx":3246
+ /* "pywrapfst.pyx":3250
*
*
* cpdef _Fst arcmap(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * mt=b"identity",
+ * map_type=b"identity",
*/
/* function exit code */
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12arcmap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_mt, PyObject *__pyx_v_weight) {
+static PyObject *__pyx_pf_9pywrapfst_12arcmap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_map_type, PyObject *__pyx_v_weight) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 3;
__pyx_t_2.delta = __pyx_v_delta;
- __pyx_t_2.mt = __pyx_v_mt;
+ __pyx_t_2.map_type = __pyx_v_map_type;
__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, 3246, __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, 3250, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3290
+/* "pywrapfst.pyx":3295
*
*
* cpdef _MutableFst compose(_Fst ifst1, # <<<<<<<<<<<<<<
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
*/
static PyObject *__pyx_pw_9pywrapfst_15compose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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_cf = ((PyObject *)__pyx_n_b_auto);
+ PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3293
+ /* "pywrapfst.pyx":3298
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
* """
- * compose(ifst1, ifst2, cf="auto", connect=True)
+ * compose(ifst1, ifst2, compose_filter="auto", connect=True)
*/
bool __pyx_v_connect = ((bool)1);
__pyx_t_9pywrapfst_VectorFstClass_ptr __pyx_v_tfst;
__Pyx_RefNannySetupContext("compose", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
- __pyx_v_cf = __pyx_optional_args->cf;
+ __pyx_v_compose_filter = __pyx_optional_args->compose_filter;
if (__pyx_optional_args->__pyx_n > 1) {
__pyx_v_connect = __pyx_optional_args->connect;
}
}
}
- /* "pywrapfst.pyx":3317
+ /* "pywrapfst.pyx":3322
* See also: `arcsort`.
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type()) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
+ * opts.reset(new fst.ComposeOptions(connect,
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3317, __pyx_L1_error)
+ __PYX_ERR(0, 3322, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0));
- /* "pywrapfst.pyx":3319
- * cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type())
+ /* "pywrapfst.pyx":3325
* cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf)))) # <<<<<<<<<<<<<<
+ * opts.reset(new fst.ComposeOptions(connect,
+ * _get_compose_filter(tostring(compose_filter)))) # <<<<<<<<<<<<<<
* fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
* return _init_MutableFst(tfst)
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_cf, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3319, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3319, __pyx_L1_error)
- __pyx_v_opts.reset(new fst::script::ComposeOptions(__pyx_v_connect, __pyx_t_2));
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3325, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3325, __pyx_L1_error)
- /* "pywrapfst.pyx":3320
+ /* "pywrapfst.pyx":3324
+ * cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type())
* cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
+ * opts.reset(new fst.ComposeOptions(connect, # <<<<<<<<<<<<<<
+ * _get_compose_filter(tostring(compose_filter))))
+ * fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
+ */
+ __pyx_v_opts.reset(new fst::script::ComposeOptions(__pyx_v_connect, __pyx_t_2));
+
+ /* "pywrapfst.pyx":3326
+ * opts.reset(new fst.ComposeOptions(connect,
+ * _get_compose_filter(tostring(compose_filter))))
* fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts)) # <<<<<<<<<<<<<<
* return _init_MutableFst(tfst)
*
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3320, __pyx_L1_error)
+ __PYX_ERR(0, 3326, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3320, __pyx_L1_error)
+ __PYX_ERR(0, 3326, __pyx_L1_error)
}
fst::script::Compose((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst, (*__pyx_v_opts));
- /* "pywrapfst.pyx":3321
- * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
+ /* "pywrapfst.pyx":3327
+ * _get_compose_filter(tostring(compose_filter))))
* fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3321, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3327, __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":3290
+ /* "pywrapfst.pyx":3295
*
*
* cpdef _MutableFst compose(_Fst ifst1, # <<<<<<<<<<<<<<
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
*/
/* function exit code */
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15compose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_14compose[] = "\n compose(ifst1, ifst2, cf=\"auto\", connect=True)\n\n Constructively composes two FSTs.\n\n This operation computes the composition of two FSTs. If A transduces string\n x to y with weight a and B transduces y to z with weight b, then their\n composition transduces string x to z with weight a \\otimes b. The output\n labels of the first transducer or the input labels of the second transducer\n must be sorted (or otherwise support appropriate matchers).\n\n Args:\n ifst1: The first input FST.\n ifst2: The second input FST.\n cf: A string matching a known composition filter; one of: \"alt_sequence\",\n \"auto\", \"match\", \"null\", \"sequence\", \"trivial\".\n connect: Should output be trimmed?\n\n Returns:\n A composed FST.\n\n See also: `arcsort`.\n ";
+static char __pyx_doc_9pywrapfst_14compose[] = "\n compose(ifst1, ifst2, compose_filter=\"auto\", connect=True)\n\n Constructively composes two FSTs.\n\n This operation computes the composition of two FSTs. If A transduces string\n x to y with weight a and B transduces y to z with weight b, then their\n composition transduces string x to z with weight a \\otimes b. The output\n labels of the first transducer or the input labels of the second transducer\n must be sorted (or otherwise support appropriate matchers).\n\n Args:\n ifst1: The first input FST.\n ifst2: The second input FST.\n compose_filter: A string matching a known composition filter; one of:\n \"alt_sequence\", \"auto\", \"match\", \"null\", \"sequence\", \"trivial\".\n connect: Should output be trimmed?\n\n Returns:\n A composed FST.\n\n See also: `arcsort`.\n ";
static PyObject *__pyx_pw_9pywrapfst_15compose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1 = 0;
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2 = 0;
- PyObject *__pyx_v_cf = 0;
+ PyObject *__pyx_v_compose_filter = 0;
bool __pyx_v_connect;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("compose (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_cf,&__pyx_n_s_connect,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_compose_filter,&__pyx_n_s_connect,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)__pyx_n_b_auto);
if (unlikely(__pyx_kwds)) {
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, 1); __PYX_ERR(0, 3290, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, 1); __PYX_ERR(0, 3295, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cf);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compose_filter);
if (value) { values[2] = value; kw_args--; }
}
case 3:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(0, 3290, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(0, 3295, __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]);
- __pyx_v_cf = values[2];
+ __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, 3293, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3298, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3293
+ /* "pywrapfst.pyx":3298
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
* """
- * compose(ifst1, ifst2, cf="auto", connect=True)
+ * compose(ifst1, ifst2, compose_filter="auto", connect=True)
*/
__pyx_v_connect = ((bool)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3290, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3295, __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, 3290, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3291, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_14compose(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_cf, __pyx_v_connect);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3295, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3296, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_14compose(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);
- /* "pywrapfst.pyx":3290
+ /* "pywrapfst.pyx":3295
*
*
* cpdef _MutableFst compose(_Fst ifst1, # <<<<<<<<<<<<<<
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
*/
/* function exit code */
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_14compose(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_cf, bool __pyx_v_connect) {
+static PyObject *__pyx_pf_9pywrapfst_14compose(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("compose", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 2;
- __pyx_t_2.cf = __pyx_v_cf;
+ __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, 3290, __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, 3295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3324
+/* "pywrapfst.pyx":3330
*
*
* cpdef _Fst convert(_Fst ifst, fst_type=b""): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3341
+ /* "pywrapfst.pyx":3347
* FstOpError: Conversion failed.
* """
* cdef FstClass_ptr tfst = new fst.FstClass(deref(ifst._fst)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3341, __pyx_L1_error)
+ __PYX_ERR(0, 3347, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::FstClass((*__pyx_v_ifst->_fst));
- /* "pywrapfst.pyx":3342
+ /* "pywrapfst.pyx":3348
* """
* cdef FstClass_ptr tfst = new fst.FstClass(deref(ifst._fst))
* tfst = fst.Convert(deref(ifst._fst), tostring(fst_type)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3342, __pyx_L1_error)
+ __PYX_ERR(0, 3348, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3342, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3348, __pyx_L1_error)
__pyx_v_tfst = fst::script::Convert((*__pyx_v_ifst->_fst), __pyx_t_1);
- /* "pywrapfst.pyx":3344
+ /* "pywrapfst.pyx":3350
* tfst = fst.Convert(deref(ifst._fst), tostring(fst_type))
* # Script-land Convert returns the null pointer to signal failure.
* if tfst == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_tfst == NULL) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":3345
+ /* "pywrapfst.pyx":3351
* # Script-land Convert returns the null pointer to signal failure.
* if tfst == NULL:
* raise FstOpError("Conversion to {!r} failed".format(fst_type)) # <<<<<<<<<<<<<<
* return _init_XFst(tfst)
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3345, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed_2, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3345, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed_2, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
}
if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_fst_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3345, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_fst_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_fst_type};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3345, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3351, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_fst_type};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3345, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3351, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3345, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(__pyx_v_fst_type);
__Pyx_GIVEREF(__pyx_v_fst_type);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_fst_type);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3345, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
}
if (!__pyx_t_6) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3345, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3351, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3345, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3351, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3345, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3351, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3345, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3345, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__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, 3345, __pyx_L1_error)
+ __PYX_ERR(0, 3351, __pyx_L1_error)
- /* "pywrapfst.pyx":3344
+ /* "pywrapfst.pyx":3350
* tfst = fst.Convert(deref(ifst._fst), tostring(fst_type))
* # Script-land Convert returns the null pointer to signal failure.
* if tfst == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3346
+ /* "pywrapfst.pyx":3352
* if tfst == NULL:
* raise FstOpError("Conversion to {!r} failed".format(fst_type))
* return _init_XFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3346, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3352, __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":3324
+ /* "pywrapfst.pyx":3330
*
*
* 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, 3324, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 3330, __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, 3324, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("convert", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3330, __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, 3324, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3330, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_16convert(__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, 3324, __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, 3330, __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":3355
*
*
* cpdef _MutableFst determinize(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * dt=b"functional",
+ * det_type=b"functional",
*/
static PyObject *__pyx_pw_9pywrapfst_19determinize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_determinize *__pyx_optional_args) {
float __pyx_v_delta = __pyx_k__36;
- PyObject *__pyx_v_dt = ((PyObject *)__pyx_n_b_functional);
+ PyObject *__pyx_v_det_type = ((PyObject *)__pyx_n_b_functional);
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__37;
__pyx_t_10basictypes_int64 __pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);
- /* "pywrapfst.pyx":3354
+ /* "pywrapfst.pyx":3360
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None, # <<<<<<<<<<<<<<
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- /* "pywrapfst.pyx":3355
+ /* "pywrapfst.pyx":3361
* int64 subsequential_label=0,
* weight=None,
* bool increment_subsequential_label=False): # <<<<<<<<<<<<<<
* """
- * determinize(ifst, delta=0.0009765625, dt="functional", nstate=-1,
+ * determinize(ifst, delta=0.0009765625, det_type="functional", nstate=-1,
*/
bool __pyx_v_increment_subsequential_label = ((bool)0);
__pyx_t_9pywrapfst_VectorFstClass_ptr __pyx_v_tfst;
fst::script::WeightClass __pyx_v_wc;
- enum fst::DeterminizeType __pyx_v_determinize_type;
+ enum fst::DeterminizeType __pyx_v_determinize_type_enum;
std::unique_ptr<fst::script::DeterminizeOptions> __pyx_v_opts;
struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_delta = __pyx_optional_args->delta;
if (__pyx_optional_args->__pyx_n > 1) {
- __pyx_v_dt = __pyx_optional_args->dt;
+ __pyx_v_det_type = __pyx_optional_args->det_type;
if (__pyx_optional_args->__pyx_n > 2) {
__pyx_v_nstate = __pyx_optional_args->nstate;
if (__pyx_optional_args->__pyx_n > 3) {
}
}
- /* "pywrapfst.pyx":3390
+ /* "pywrapfst.pyx":3396
* See also: `disambiguate`, `rmepsilon`.
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3390, __pyx_L1_error)
+ __PYX_ERR(0, 3396, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
- /* "pywrapfst.pyx":3392
+ /* "pywrapfst.pyx":3398
* cdef VectorFstClass_ptr tfst = 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(), # <<<<<<<<<<<<<<
* weight)
- * cdef fst.DeterminizeType determinize_type
+ * cdef fst.DeterminizeType determinize_type_enum
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 3392, __pyx_L1_error)
+ __PYX_ERR(0, 3398, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3393
+ /* "pywrapfst.pyx":3399
* # 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
- * if not fst.GetDeterminizeType(tostring(dt), addr(determinize_type)):
+ * 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, 3392, __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, 3398, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":3395
+ /* "pywrapfst.pyx":3401
* weight)
- * cdef fst.DeterminizeType determinize_type
- * if not fst.GetDeterminizeType(tostring(dt), addr(determinize_type)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown determinization type: {!r}".format(dt))
+ * 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, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3401, __pyx_L1_error)
+
+ /* "pywrapfst.pyx":3402
+ * 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))
* cdef unique_ptr[fst.DeterminizeOptions] opts
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_dt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3395, __pyx_L1_error)
- __pyx_t_3 = ((!(fst::script::GetDeterminizeType(__pyx_t_2, (&__pyx_v_determinize_type)) != 0)) != 0);
+ __pyx_t_3 = ((!(fst::script::GetDeterminizeType(__pyx_t_2, (&__pyx_v_determinize_type_enum)) != 0)) != 0);
+
+ /* "pywrapfst.pyx":3401
+ * 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))
+ */
if (__pyx_t_3) {
- /* "pywrapfst.pyx":3396
- * cdef fst.DeterminizeType determinize_type
- * if not fst.GetDeterminizeType(tostring(dt), addr(determinize_type)):
- * raise FstArgError("Unknown determinization type: {!r}".format(dt)) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3403
+ * 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_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3396, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_determinization_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3396, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_determinization_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
}
}
if (!__pyx_t_8) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_dt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3396, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_det_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_dt};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3396, __pyx_L1_error)
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_det_type};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3403, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_dt};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3396, __pyx_L1_error)
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_det_type};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3403, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
{
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3396, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_INCREF(__pyx_v_dt);
- __Pyx_GIVEREF(__pyx_v_dt);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_dt);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3396, __pyx_L1_error)
+ __Pyx_INCREF(__pyx_v_det_type);
+ __Pyx_GIVEREF(__pyx_v_det_type);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_det_type);
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
}
}
if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3396, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3403, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3396, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3403, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3396, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3403, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3396, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3396, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
__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, 3396, __pyx_L1_error)
+ __PYX_ERR(0, 3403, __pyx_L1_error)
- /* "pywrapfst.pyx":3395
+ /* "pywrapfst.pyx":3401
* weight)
- * cdef fst.DeterminizeType determinize_type
- * if not fst.GetDeterminizeType(tostring(dt), addr(determinize_type)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown determinization type: {!r}".format(dt))
- * cdef unique_ptr[fst.DeterminizeOptions] opts
+ * 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))
*/
}
- /* "pywrapfst.pyx":3398
- * raise FstArgError("Unknown determinization type: {!r}".format(dt))
+ /* "pywrapfst.pyx":3405
+ * 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, # <<<<<<<<<<<<<<
- * determinize_type,
+ * determinize_type_enum,
* increment_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, __pyx_v_increment_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":3401
- * determinize_type,
+ /* "pywrapfst.pyx":3408
+ * determinize_type_enum,
* increment_subsequential_label))
* fst.Determinize(deref(ifst._fst), tfst, deref(opts)) # <<<<<<<<<<<<<<
* return _init_MutableFst(tfst)
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3401, __pyx_L1_error)
+ __PYX_ERR(0, 3408, __pyx_L1_error)
}
fst::script::Determinize((*__pyx_v_ifst->_fst), __pyx_v_tfst, (*__pyx_v_opts));
- /* "pywrapfst.pyx":3402
+ /* "pywrapfst.pyx":3409
* increment_subsequential_label))
* fst.Determinize(deref(ifst._fst), tfst, deref(opts))
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3402, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3409, __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":3349
+ /* "pywrapfst.pyx":3355
*
*
* cpdef _MutableFst determinize(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * dt=b"functional",
+ * det_type=b"functional",
*/
/* function exit code */
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19determinize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_18determinize[] = "\n determinize(ifst, delta=0.0009765625, dt=\"functional\", nstate=-1,\n subsequential_label=0, weight=None,\n incremental_subsequential_label=False)\n\n Constructively determinizes a weighted FST.\n\n This operations creates an equivalent FST that has the property that no\n state has two transitions with the same input label. For this algorithm,\n epsilon transitions are treated as regular symbols (cf. `rmepsilon`).\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta.\n dt: Type of determinization; one of: \"functional\" (input transducer is\n functional), \"nonfunctional\" (input transducer is not functional) and\n disambiguate\" (input transducer is not functional but only keep the min\n of ambiguous outputs).\n nstate: State number threshold.\n subsequential_label: Input label of arc corresponding to residual final\n output when producing a subsequential transducer.\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 increment_subsequential_label: Increment subsequential when creating\n several arcs for the residual final output at a given state.\n\n Returns:\n An equivalent deterministic FST.\n\n Raises:\n FstArgError: Unknown determinization type.\n\n See also: `disambiguate`, `rmepsilon`.\n ";
+static char __pyx_doc_9pywrapfst_18determinize[] = "\n determinize(ifst, delta=0.0009765625, det_type=\"functional\", nstate=-1,\n subsequential_label=0, weight=None,\n incremental_subsequential_label=False)\n\n Constructively determinizes a weighted FST.\n\n This operations creates an equivalent FST that has the property that no\n state has two transitions with the same input label. For this algorithm,\n epsilon transitions are treated as regular symbols (cf. `rmepsilon`).\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta.\n det_type: Type of determinization; one of: \"functional\" (input transducer is\n functional), \"nonfunctional\" (input transducer is not functional) and\n disambiguate\" (input transducer is not functional but only keep the min\n of ambiguous outputs).\n nstate: State number threshold.\n subsequential_label: Input label of arc corresponding to residual final\n output when producing a subsequential transducer.\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 increment_subsequential_label: Increment subsequential when creating\n several arcs for the residual final output at a given state.\n\n Returns:\n An equivalent deterministic FST.\n\n Raises:\n FstArgError: Unknown determinization type.\n\n See also: `disambiguate`, `rmepsilon`.\n ";
static PyObject *__pyx_pw_9pywrapfst_19determinize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
float __pyx_v_delta;
- PyObject *__pyx_v_dt = 0;
+ PyObject *__pyx_v_det_type = 0;
__pyx_t_10basictypes_int64 __pyx_v_nstate;
__pyx_t_10basictypes_int64 __pyx_v_subsequential_label;
PyObject *__pyx_v_weight = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("determinize (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_dt,&__pyx_n_s_nstate,&__pyx_n_s_subsequential_label,&__pyx_n_s_weight,&__pyx_n_s_increment_subsequential_label,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_det_type,&__pyx_n_s_nstate,&__pyx_n_s_subsequential_label,&__pyx_n_s_weight,&__pyx_n_s_increment_subsequential_label,0};
PyObject* values[7] = {0,0,0,0,0,0,0};
values[2] = ((PyObject *)__pyx_n_b_functional);
- /* "pywrapfst.pyx":3354
+ /* "pywrapfst.pyx":3360
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None, # <<<<<<<<<<<<<<
}
case 2:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_det_type);
if (value) { values[2] = value; kw_args--; }
}
case 3:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "determinize") < 0)) __PYX_ERR(0, 3349, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "determinize") < 0)) __PYX_ERR(0, 3355, __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, 3350, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3356, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__36;
}
- __pyx_v_dt = values[2];
+ __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, 3352, __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, 3358, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__37;
}
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, 3353, __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, 3359, __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, 3355, __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, 3361, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3355
+ /* "pywrapfst.pyx":3361
* int64 subsequential_label=0,
* weight=None,
* bool increment_subsequential_label=False): # <<<<<<<<<<<<<<
* """
- * determinize(ifst, delta=0.0009765625, dt="functional", nstate=-1,
+ * determinize(ifst, delta=0.0009765625, det_type="functional", nstate=-1,
*/
__pyx_v_increment_subsequential_label = ((bool)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3349, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3355, __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, 3349, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_18determinize(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_dt, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_weight, __pyx_v_increment_subsequential_label);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3355, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_18determinize(__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":3349
+ /* "pywrapfst.pyx":3355
*
*
* cpdef _MutableFst determinize(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * dt=b"functional",
+ * det_type=b"functional",
*/
/* function exit code */
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_18determinize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_dt, __pyx_t_10basictypes_int64 __pyx_v_nstate, __pyx_t_10basictypes_int64 __pyx_v_subsequential_label, PyObject *__pyx_v_weight, bool __pyx_v_increment_subsequential_label) {
+static PyObject *__pyx_pf_9pywrapfst_18determinize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_det_type, __pyx_t_10basictypes_int64 __pyx_v_nstate, __pyx_t_10basictypes_int64 __pyx_v_subsequential_label, PyObject *__pyx_v_weight, bool __pyx_v_increment_subsequential_label) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 6;
__pyx_t_2.delta = __pyx_v_delta;
- __pyx_t_2.dt = __pyx_v_dt;
+ __pyx_t_2.det_type = __pyx_v_det_type;
__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_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, 3349, __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, 3355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3405
+/* "pywrapfst.pyx":3412
*
*
* cpdef _MutableFst difference(_Fst ifst1, # <<<<<<<<<<<<<<
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
*/
static PyObject *__pyx_pw_9pywrapfst_21difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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_cf = ((PyObject *)__pyx_n_b_auto);
+ PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3408
+ /* "pywrapfst.pyx":3415
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
* """
- * difference(ifst1, ifst2, cf="auto", connect=True)
+ * difference(ifst1, ifst2, compose_filter="auto", connect=True)
*/
bool __pyx_v_connect = ((bool)1);
__pyx_t_9pywrapfst_VectorFstClass_ptr __pyx_v_tfst;
__Pyx_RefNannySetupContext("difference", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
- __pyx_v_cf = __pyx_optional_args->cf;
+ __pyx_v_compose_filter = __pyx_optional_args->compose_filter;
if (__pyx_optional_args->__pyx_n > 1) {
__pyx_v_connect = __pyx_optional_args->connect;
}
}
}
- /* "pywrapfst.pyx":3431
+ /* "pywrapfst.pyx":3438
* An FST representing the difference of the two input FSTs.
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type()) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
+ * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3431, __pyx_L1_error)
+ __PYX_ERR(0, 3438, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0));
- /* "pywrapfst.pyx":3433
- * cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type())
+ /* "pywrapfst.pyx":3441
* cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf)))) # <<<<<<<<<<<<<<
+ * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(
+ * tostring(compose_filter)))) # <<<<<<<<<<<<<<
* fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
* return _init_MutableFst(tfst)
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_cf, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3433, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3433, __pyx_L1_error)
- __pyx_v_opts.reset(new fst::script::ComposeOptions(__pyx_v_connect, __pyx_t_2));
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3441, __pyx_L1_error)
- /* "pywrapfst.pyx":3434
+ /* "pywrapfst.pyx":3440
+ * cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type())
* cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
+ * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter( # <<<<<<<<<<<<<<
+ * tostring(compose_filter))))
+ * fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
+ */
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3440, __pyx_L1_error)
+ __pyx_v_opts.reset(new fst::script::ComposeOptions(__pyx_v_connect, __pyx_t_2));
+
+ /* "pywrapfst.pyx":3442
+ * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(
+ * tostring(compose_filter))))
* fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts)) # <<<<<<<<<<<<<<
* return _init_MutableFst(tfst)
*
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3434, __pyx_L1_error)
+ __PYX_ERR(0, 3442, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3434, __pyx_L1_error)
+ __PYX_ERR(0, 3442, __pyx_L1_error)
}
fst::script::Difference((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst, (*__pyx_v_opts));
- /* "pywrapfst.pyx":3435
- * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
+ /* "pywrapfst.pyx":3443
+ * tostring(compose_filter))))
* fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3435, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3443, __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":3405
+ /* "pywrapfst.pyx":3412
*
*
* cpdef _MutableFst difference(_Fst ifst1, # <<<<<<<<<<<<<<
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
*/
/* function exit code */
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_21difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_20difference[] = "\n difference(ifst1, ifst2, cf=\"auto\", connect=True)\n\n Constructively computes the difference of two FSTs.\n\n This operation computes the difference between two FSAs. Only strings that are\n in the first automaton but not in second are retained in the result. The first\n argument must be an acceptor; the second argument must be an unweighted,\n epsilon-free, deterministic acceptor. The output labels of the first\n transducer or the input labels of the second transducer must be sorted (or\n otherwise support appropriate matchers).\n\n Args:\n ifst1: The first input FST.\n ifst2: The second input FST.\n cf: A string matching a known composition filter; one of: \"alt_sequence\",\n \"auto\", \"match\", \"null\", \"sequence\", \"trivial\".\n connect: Should the output FST be trimmed?\n\n Returns:\n An FST representing the difference of the two input FSTs.\n ";
+static char __pyx_doc_9pywrapfst_20difference[] = "\n difference(ifst1, ifst2, compose_filter=\"auto\", connect=True)\n\n Constructively computes the difference of two FSTs.\n\n This operation computes the difference between two FSAs. Only strings that are\n in the first automaton but not in second are retained in the result. The first\n argument must be an acceptor; the second argument must be an unweighted,\n epsilon-free, deterministic acceptor. The output labels of the first\n transducer or the input labels of the second transducer must be sorted (or\n otherwise support appropriate matchers).\n\n Args:\n ifst1: The first input FST.\n ifst2: The second input FST.\n compose_filter: A string matching a known composition filter; one of:\n \"alt_sequence\", \"auto\", \"match\", \"null\", \"sequence\", \"trivial\".\n connect: Should the output FST be trimmed?\n\n Returns:\n An FST representing the difference of the two input FSTs.\n ";
static PyObject *__pyx_pw_9pywrapfst_21difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1 = 0;
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2 = 0;
- PyObject *__pyx_v_cf = 0;
+ PyObject *__pyx_v_compose_filter = 0;
bool __pyx_v_connect;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("difference (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_cf,&__pyx_n_s_connect,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_compose_filter,&__pyx_n_s_connect,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)__pyx_n_b_auto);
if (unlikely(__pyx_kwds)) {
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, 1); __PYX_ERR(0, 3405, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, 1); __PYX_ERR(0, 3412, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cf);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compose_filter);
if (value) { values[2] = value; kw_args--; }
}
case 3:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(0, 3405, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(0, 3412, __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]);
- __pyx_v_cf = values[2];
+ __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, 3408, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3415, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3408
+ /* "pywrapfst.pyx":3415
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
* """
- * difference(ifst1, ifst2, cf="auto", connect=True)
+ * difference(ifst1, ifst2, compose_filter="auto", connect=True)
*/
__pyx_v_connect = ((bool)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3405, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3412, __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, 3405, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3406, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_20difference(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_cf, __pyx_v_connect);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3412, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3413, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_20difference(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);
- /* "pywrapfst.pyx":3405
+ /* "pywrapfst.pyx":3412
*
*
* cpdef _MutableFst difference(_Fst ifst1, # <<<<<<<<<<<<<<
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
*/
/* function exit code */
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_20difference(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_cf, bool __pyx_v_connect) {
+static PyObject *__pyx_pf_9pywrapfst_20difference(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("difference", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 2;
- __pyx_t_2.cf = __pyx_v_cf;
+ __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, 3405, __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, 3412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3438
+/* "pywrapfst.pyx":3446
*
*
* cpdef _MutableFst disambiguate(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__39;
__pyx_t_10basictypes_int64 __pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);
- /* "pywrapfst.pyx":3442
+ /* "pywrapfst.pyx":3450
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3468
+ /* "pywrapfst.pyx":3476
* See also: `determinize`, `rmepsilon`.
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3468, __pyx_L1_error)
+ __PYX_ERR(0, 3476, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
- /* "pywrapfst.pyx":3470
+ /* "pywrapfst.pyx":3478
* cdef VectorFstClass_ptr tfst = 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 '%s'", "weight_type");
- __PYX_ERR(0, 3470, __pyx_L1_error)
+ __PYX_ERR(0, 3478, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3471
+ /* "pywrapfst.pyx":3479
* # 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, 3470, __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, 3478, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":3473
+ /* "pywrapfst.pyx":3481
* 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":3475
+ /* "pywrapfst.pyx":3483
* opts.reset(new fst.DisambiguateOptions(delta, wc, nstate,
* subsequential_label))
* fst.Disambiguate(deref(ifst._fst), tfst, deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3475, __pyx_L1_error)
+ __PYX_ERR(0, 3483, __pyx_L1_error)
}
fst::script::Disambiguate((*__pyx_v_ifst->_fst), __pyx_v_tfst, (*__pyx_v_opts));
- /* "pywrapfst.pyx":3476
+ /* "pywrapfst.pyx":3484
* subsequential_label))
* fst.Disambiguate(deref(ifst._fst), tfst, deref(opts))
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3476, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3484, __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":3438
+ /* "pywrapfst.pyx":3446
*
*
* 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":3442
+ /* "pywrapfst.pyx":3450
* 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, 3438, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "disambiguate") < 0)) __PYX_ERR(0, 3446, __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, 3439, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3447, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__38;
}
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, 3440, __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, 3448, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__39;
}
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, 3441, __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, 3449, __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, 3438, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("disambiguate", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3446, __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, 3438, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3446, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_22disambiguate(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_weight);
- /* "pywrapfst.pyx":3438
+ /* "pywrapfst.pyx":3446
*
*
* 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, 3438, __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, 3446, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3479
+/* "pywrapfst.pyx":3487
*
*
* cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3501
+ /* "pywrapfst.pyx":3509
* See also: `rmepsilon`.
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3501, __pyx_L1_error)
+ __PYX_ERR(0, 3509, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
- /* "pywrapfst.pyx":3502
+ /* "pywrapfst.pyx":3510
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* fst.EpsNormalize(deref(ifst._fst), tfst, fst.EPS_NORM_OUTPUT if # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3502, __pyx_L1_error)
+ __PYX_ERR(0, 3510, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3503
+ /* "pywrapfst.pyx":3511
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* fst.EpsNormalize(deref(ifst._fst), tfst, fst.EPS_NORM_OUTPUT if
* eps_norm_output else # <<<<<<<<<<<<<<
*/
if ((__pyx_v_eps_norm_output != 0)) {
- /* "pywrapfst.pyx":3502
+ /* "pywrapfst.pyx":3510
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* fst.EpsNormalize(deref(ifst._fst), tfst, fst.EPS_NORM_OUTPUT if # <<<<<<<<<<<<<<
__pyx_t_1 = fst::EPS_NORM_OUTPUT;
} else {
- /* "pywrapfst.pyx":3504
+ /* "pywrapfst.pyx":3512
* fst.EpsNormalize(deref(ifst._fst), tfst, fst.EPS_NORM_OUTPUT if
* eps_norm_output else
* fst.EPS_NORM_INPUT) # <<<<<<<<<<<<<<
__pyx_t_1 = fst::EPS_NORM_INPUT;
}
- /* "pywrapfst.pyx":3502
+ /* "pywrapfst.pyx":3510
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* fst.EpsNormalize(deref(ifst._fst), tfst, fst.EPS_NORM_OUTPUT if # <<<<<<<<<<<<<<
*/
fst::script::EpsNormalize((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_t_1);
- /* "pywrapfst.pyx":3505
+ /* "pywrapfst.pyx":3513
* eps_norm_output else
* fst.EPS_NORM_INPUT)
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3505, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3513, __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":3479
+ /* "pywrapfst.pyx":3487
*
*
* 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, 3479, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "epsnormalize") < 0)) __PYX_ERR(0, 3487, __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, 3479, __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, 3487, __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, 3479, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("epsnormalize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3487, __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, 3479, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3487, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_24epsnormalize(__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, 3479, __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, 3487, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3508
+/* "pywrapfst.pyx":3516
*
*
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3528
+ /* "pywrapfst.pyx":3536
* 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 '%s'", "_fst");
- __PYX_ERR(0, 3528, __pyx_L1_error)
+ __PYX_ERR(0, 3536, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3528, __pyx_L1_error)
+ __PYX_ERR(0, 3536, __pyx_L1_error)
}
__pyx_r = fst::script::Equal((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3508
+ /* "pywrapfst.pyx":3516
*
*
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, 1); __PYX_ERR(0, 3508, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, 1); __PYX_ERR(0, 3516, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(0, 3508, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(0, 3516, __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, 3508, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3516, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__40;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3508, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3516, __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, 3508, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3508, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3516, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3516, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_26equal(__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, 3508, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3516, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3531
+/* "pywrapfst.pyx":3539
*
*
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3555
+ /* "pywrapfst.pyx":3563
* """
* cdef bool error
* cdef bool result = 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 '%s'", "_fst");
- __PYX_ERR(0, 3555, __pyx_L1_error)
+ __PYX_ERR(0, 3563, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3555, __pyx_L1_error)
+ __PYX_ERR(0, 3563, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3556
+ /* "pywrapfst.pyx":3564
* cdef bool error
* cdef bool result = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta,
* addr(error)) # <<<<<<<<<<<<<<
*/
__pyx_v_result = fst::script::Equivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta, (&__pyx_v_error));
- /* "pywrapfst.pyx":3557
+ /* "pywrapfst.pyx":3565
* cdef bool result = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta,
* addr(error))
* if error: # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_v_error != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":3558
+ /* "pywrapfst.pyx":3566
* addr(error))
* if error:
* raise FstOpError("Equivalence test encountered error") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3558, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3566, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3558, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3566, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 3558, __pyx_L1_error)
+ __PYX_ERR(0, 3566, __pyx_L1_error)
- /* "pywrapfst.pyx":3557
+ /* "pywrapfst.pyx":3565
* cdef bool result = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta,
* addr(error))
* if error: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3559
+ /* "pywrapfst.pyx":3567
* if error:
* raise FstOpError("Equivalence test encountered error")
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":3531
+ /* "pywrapfst.pyx":3539
*
*
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *: # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, 1); __PYX_ERR(0, 3531, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, 1); __PYX_ERR(0, 3539, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equivalent") < 0)) __PYX_ERR(0, 3531, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equivalent") < 0)) __PYX_ERR(0, 3539, __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, 3531, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3539, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__41;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3531, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3539, __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, 3531, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3531, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3539, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3539, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_28equivalent(__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(PyErr_Occurred())) __PYX_ERR(0, 3531, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3531, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_equivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3539, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3539, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3562
+/* "pywrapfst.pyx":3570
*
*
* cpdef _MutableFst intersect(_Fst ifst1, # <<<<<<<<<<<<<<
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
*/
static PyObject *__pyx_pw_9pywrapfst_31intersect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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_cf = ((PyObject *)__pyx_n_b_auto);
+ PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3565
+ /* "pywrapfst.pyx":3573
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
* """
- * intersect(ifst1, ifst2, cf="auto", connect=True)
+ * intersect(ifst1, ifst2, compose_filter="auto", connect=True)
*/
bool __pyx_v_connect = ((bool)1);
__pyx_t_9pywrapfst_VectorFstClass_ptr __pyx_v_tfst;
__Pyx_RefNannySetupContext("intersect", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
- __pyx_v_cf = __pyx_optional_args->cf;
+ __pyx_v_compose_filter = __pyx_optional_args->compose_filter;
if (__pyx_optional_args->__pyx_n > 1) {
__pyx_v_connect = __pyx_optional_args->connect;
}
}
}
- /* "pywrapfst.pyx":3586
+ /* "pywrapfst.pyx":3594
* An equivalent epsilon-normalized FST.
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type()) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
+ * opts.reset(new fst.ComposeOptions(connect,
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3586, __pyx_L1_error)
+ __PYX_ERR(0, 3594, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0));
- /* "pywrapfst.pyx":3588
- * cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type())
+ /* "pywrapfst.pyx":3597
* cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf)))) # <<<<<<<<<<<<<<
+ * opts.reset(new fst.ComposeOptions(connect,
+ * _get_compose_filter(tostring(compose_filter)))) # <<<<<<<<<<<<<<
* fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
* return _init_MutableFst(tfst)
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_cf, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3588, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3588, __pyx_L1_error)
- __pyx_v_opts.reset(new fst::script::ComposeOptions(__pyx_v_connect, __pyx_t_2));
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3597, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3597, __pyx_L1_error)
- /* "pywrapfst.pyx":3589
+ /* "pywrapfst.pyx":3596
+ * cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type())
* cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
+ * opts.reset(new fst.ComposeOptions(connect, # <<<<<<<<<<<<<<
+ * _get_compose_filter(tostring(compose_filter))))
+ * fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
+ */
+ __pyx_v_opts.reset(new fst::script::ComposeOptions(__pyx_v_connect, __pyx_t_2));
+
+ /* "pywrapfst.pyx":3598
+ * opts.reset(new fst.ComposeOptions(connect,
+ * _get_compose_filter(tostring(compose_filter))))
* fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts)) # <<<<<<<<<<<<<<
* return _init_MutableFst(tfst)
*
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3589, __pyx_L1_error)
+ __PYX_ERR(0, 3598, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3589, __pyx_L1_error)
+ __PYX_ERR(0, 3598, __pyx_L1_error)
}
fst::script::Intersect((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst, (*__pyx_v_opts));
- /* "pywrapfst.pyx":3590
- * opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
+ /* "pywrapfst.pyx":3599
+ * _get_compose_filter(tostring(compose_filter))))
* fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3590, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3599, __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":3562
+ /* "pywrapfst.pyx":3570
*
*
* cpdef _MutableFst intersect(_Fst ifst1, # <<<<<<<<<<<<<<
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
*/
/* function exit code */
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_31intersect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_30intersect[] = "\n intersect(ifst1, ifst2, cf=\"auto\", connect=True)\n\n Constructively intersects two FSTs.\n\n This operation computes the intersection (Hadamard product) of two FSTs.\n Only strings that are in both automata are retained in the result. The two\n arguments must be acceptors. One of the arguments must be label-sorted (or\n otherwise support appropriate matchers).\n\n Args:\n ifst1: The first input FST.\n ifst2: The second input FST.\n cf: A string matching a known composition filter; one of: \"alt_sequence\",\n \"auto\", \"match\", \"null\", \"sequence\", \"trivial\".\n connect: Should output be trimmed?\n\n Returns:\n An equivalent epsilon-normalized FST.\n ";
+static char __pyx_doc_9pywrapfst_30intersect[] = "\n intersect(ifst1, ifst2, compose_filter=\"auto\", connect=True)\n\n Constructively intersects two FSTs.\n\n This operation computes the intersection (Hadamard product) of two FSTs.\n Only strings that are in both automata are retained in the result. The two\n arguments must be acceptors. One of the arguments must be label-sorted (or\n otherwise support appropriate matchers).\n\n Args:\n ifst1: The first input FST.\n ifst2: The second input FST.\n compose_filter: A string matching a known composition filter; one of:\n \"alt_sequence\", \"auto\", \"match\", \"null\", \"sequence\", \"trivial\".\n connect: Should output be trimmed?\n\n Returns:\n An equivalent epsilon-normalized FST.\n ";
static PyObject *__pyx_pw_9pywrapfst_31intersect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1 = 0;
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2 = 0;
- PyObject *__pyx_v_cf = 0;
+ PyObject *__pyx_v_compose_filter = 0;
bool __pyx_v_connect;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("intersect (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_cf,&__pyx_n_s_connect,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_compose_filter,&__pyx_n_s_connect,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)__pyx_n_b_auto);
if (unlikely(__pyx_kwds)) {
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, 1); __PYX_ERR(0, 3562, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, 1); __PYX_ERR(0, 3570, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cf);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compose_filter);
if (value) { values[2] = value; kw_args--; }
}
case 3:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersect") < 0)) __PYX_ERR(0, 3562, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersect") < 0)) __PYX_ERR(0, 3570, __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]);
- __pyx_v_cf = values[2];
+ __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, 3565, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3573, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3565
+ /* "pywrapfst.pyx":3573
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
* """
- * intersect(ifst1, ifst2, cf="auto", connect=True)
+ * intersect(ifst1, ifst2, compose_filter="auto", connect=True)
*/
__pyx_v_connect = ((bool)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3562, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3570, __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, 3562, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3563, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_30intersect(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_cf, __pyx_v_connect);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3570, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3571, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_30intersect(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);
- /* "pywrapfst.pyx":3562
+ /* "pywrapfst.pyx":3570
*
*
* cpdef _MutableFst intersect(_Fst ifst1, # <<<<<<<<<<<<<<
* _Fst ifst2,
- * cf=b"auto",
+ * compose_filter=b"auto",
*/
/* function exit code */
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_30intersect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_cf, bool __pyx_v_connect) {
+static PyObject *__pyx_pf_9pywrapfst_30intersect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("intersect", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 2;
- __pyx_t_2.cf = __pyx_v_cf;
+ __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, 3562, __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, 3570, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3593
+/* "pywrapfst.pyx":3602
*
*
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3616
+ /* "pywrapfst.pyx":3625
* 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 '%s'", "_fst");
- __PYX_ERR(0, 3616, __pyx_L1_error)
+ __PYX_ERR(0, 3625, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3616, __pyx_L1_error)
+ __PYX_ERR(0, 3625, __pyx_L1_error)
}
__pyx_r = fst::script::Isomorphic((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3593
+ /* "pywrapfst.pyx":3602
*
*
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, 1); __PYX_ERR(0, 3593, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, 1); __PYX_ERR(0, 3602, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isomorphic") < 0)) __PYX_ERR(0, 3593, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isomorphic") < 0)) __PYX_ERR(0, 3602, __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, 3593, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3602, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__43;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3593, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3602, __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, 3593, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3593, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3602, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3602, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_32isomorphic(__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, 3593, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3619
+/* "pywrapfst.pyx":3628
*
*
* cpdef _MutableFst prune(_Fst ifst, # <<<<<<<<<<<<<<
float __pyx_v_delta = __pyx_k__44;
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__45;
- /* "pywrapfst.pyx":3622
+ /* "pywrapfst.pyx":3631
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3645
+ /* "pywrapfst.pyx":3654
* See also: The destructive variant.
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3645, __pyx_L1_error)
+ __PYX_ERR(0, 3654, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
- /* "pywrapfst.pyx":3646
+ /* "pywrapfst.pyx":3655
* """
* cdef VectorFstClass_ptr tfst = 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 '%s'", "weight_type");
- __PYX_ERR(0, 3646, __pyx_L1_error)
+ __PYX_ERR(0, 3655, __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, 3646, __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, 3655, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":3647
+ /* "pywrapfst.pyx":3656
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
* fst.Prune(deref(ifst._fst), tfst, wc, nstate, delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3647, __pyx_L1_error)
+ __PYX_ERR(0, 3656, __pyx_L1_error)
}
fst::script::Prune((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":3648
+ /* "pywrapfst.pyx":3657
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
* fst.Prune(deref(ifst._fst), tfst, wc, nstate, delta)
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3648, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3657, __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":3619
+ /* "pywrapfst.pyx":3628
*
*
* 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":3622
+ /* "pywrapfst.pyx":3631
* 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, 3619, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 3628, __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, 3620, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3629, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__44;
}
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, 3621, __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, 3630, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__45;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3619, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3628, __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, 3619, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3628, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_34prune(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);
- /* "pywrapfst.pyx":3619
+ /* "pywrapfst.pyx":3628
*
*
* 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, 3619, __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, 3628, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3651
+/* "pywrapfst.pyx":3660
*
*
* 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__46;
- /* "pywrapfst.pyx":3653
+ /* "pywrapfst.pyx":3662
* cpdef _MutableFst push(_Fst ifst,
* float delta=fst.kDelta,
* bool push_weights=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_push_weights = ((bool)0);
- /* "pywrapfst.pyx":3654
+ /* "pywrapfst.pyx":3663
* float delta=fst.kDelta,
* bool push_weights=False,
* bool push_labels=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_push_labels = ((bool)0);
- /* "pywrapfst.pyx":3655
+ /* "pywrapfst.pyx":3664
* bool push_weights=False,
* bool push_labels=False,
* bool remove_common_affix=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_common_affix = ((bool)0);
- /* "pywrapfst.pyx":3656
+ /* "pywrapfst.pyx":3665
* bool push_labels=False,
* bool remove_common_affix=False,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_total_weight = ((bool)0);
- /* "pywrapfst.pyx":3657
+ /* "pywrapfst.pyx":3666
* bool remove_common_affix=False,
* bool remove_total_weight=False,
* bool to_final=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3696
+ /* "pywrapfst.pyx":3705
* """
* # This is copied, almost verbatim, from nlp/fst/bin/fstpush.cc.
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3696, __pyx_L1_error)
+ __PYX_ERR(0, 3705, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
- /* "pywrapfst.pyx":3697
+ /* "pywrapfst.pyx":3706
* # This is copied, almost verbatim, from nlp/fst/bin/fstpush.cc.
* cdef VectorFstClass_ptr tfst = 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":3699
+ /* "pywrapfst.pyx":3708
* cdef uint32 flags = fst.GetPushFlags(push_weights, push_labels,
* remove_common_affix, remove_total_weight)
* fst.Push(deref(ifst._fst), tfst, flags, fst.GetReweightType(to_final), delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3699, __pyx_L1_error)
+ __PYX_ERR(0, 3708, __pyx_L1_error)
}
fst::script::Push((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_v_flags, fst::script::GetReweightType(__pyx_v_to_final), __pyx_v_delta);
- /* "pywrapfst.pyx":3700
+ /* "pywrapfst.pyx":3709
* remove_common_affix, remove_total_weight)
* fst.Push(deref(ifst._fst), tfst, flags, fst.GetReweightType(to_final), delta)
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3700, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3709, __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":3651
+ /* "pywrapfst.pyx":3660
*
*
* 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, 3651, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 3660, __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, 3652, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3661, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__46;
}
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, 3653, __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, 3662, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3653
+ /* "pywrapfst.pyx":3662
* 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, 3654, __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, 3663, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3654
+ /* "pywrapfst.pyx":3663
* 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, 3655, __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, 3664, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3655
+ /* "pywrapfst.pyx":3664
* 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, 3656, __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, 3665, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3656
+ /* "pywrapfst.pyx":3665
* 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, 3657, __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, 3666, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3657
+ /* "pywrapfst.pyx":3666
* 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, 3651, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("push", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3660, __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, 3651, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3660, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_36push(__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":3651
+ /* "pywrapfst.pyx":3660
*
*
* 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, 3651, __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, 3660, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3703
+/* "pywrapfst.pyx":3712
*
*
* cpdef bool randequivalent(_Fst ifst1, # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3741
+ /* "pywrapfst.pyx":3750
* 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, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3741, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3741, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3750, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3750, __pyx_L1_error)
__pyx_v_ras = __pyx_t_2;
- /* "pywrapfst.pyx":3744
+ /* "pywrapfst.pyx":3753
* 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":3746
+ /* "pywrapfst.pyx":3755
* 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":3747
+ /* "pywrapfst.pyx":3756
* 1, False, False))
* if seed == 0:
* seed = time(NULL) + getpid() # <<<<<<<<<<<<<<
*/
__pyx_v_seed = (time(NULL) + getpid());
- /* "pywrapfst.pyx":3746
+ /* "pywrapfst.pyx":3755
* opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,
* 1, False, False))
* if seed == 0: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3749
+ /* "pywrapfst.pyx":3758
* seed = time(NULL) + getpid()
* cdef bool error
* cdef bool result = fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3749, __pyx_L1_error)
+ __PYX_ERR(0, 3758, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3749, __pyx_L1_error)
+ __PYX_ERR(0, 3758, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3751
+ /* "pywrapfst.pyx":3760
* cdef bool result = fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst),
* npath, delta, seed, deref(opts),
* addr(error)) # <<<<<<<<<<<<<<
*/
__pyx_v_result = fst::script::RandEquivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_npath, __pyx_v_delta, __pyx_v_seed, (*__pyx_v_opts), (&__pyx_v_error));
- /* "pywrapfst.pyx":3752
+ /* "pywrapfst.pyx":3761
* npath, delta, seed, deref(opts),
* addr(error))
* if error: # <<<<<<<<<<<<<<
__pyx_t_3 = (__pyx_v_error != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":3753
+ /* "pywrapfst.pyx":3762
* addr(error))
* if error:
* raise FstOpError("Random equivalence test encountered error") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3753, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3762, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3753, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3762, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __PYX_ERR(0, 3753, __pyx_L1_error)
+ __PYX_ERR(0, 3762, __pyx_L1_error)
- /* "pywrapfst.pyx":3752
+ /* "pywrapfst.pyx":3761
* npath, delta, seed, deref(opts),
* addr(error))
* if error: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3754
+ /* "pywrapfst.pyx":3763
* if error:
* raise FstOpError("Random equivalence test encountered error")
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":3703
+ /* "pywrapfst.pyx":3712
*
*
* cpdef bool randequivalent(_Fst ifst1, # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, 1); __PYX_ERR(0, 3703, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, 1); __PYX_ERR(0, 3712, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randequivalent") < 0)) __PYX_ERR(0, 3703, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randequivalent") < 0)) __PYX_ERR(0, 3712, __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, 3705, __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, 3714, __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, 3706, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3715, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__47;
}
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, 3707, __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, 3716, __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, 3709, __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, 3718, __pyx_L3_error)
} else {
__pyx_v_max_length = __pyx_k__48;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3703, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3712, __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, 3703, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3704, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3712, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3713, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_38randequivalent(__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(PyErr_Occurred())) __PYX_ERR(0, 3703, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3703, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_randequivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3712, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3757
+/* "pywrapfst.pyx":3766
*
*
* cpdef _MutableFst randgen(_Fst ifst, # <<<<<<<<<<<<<<
PyObject *__pyx_v_select = ((PyObject *)__pyx_n_b_uniform);
__pyx_t_10basictypes_int32 __pyx_v_max_length = __pyx_k__50;
- /* "pywrapfst.pyx":3762
+ /* "pywrapfst.pyx":3771
* select=b"uniform",
* int32 max_length=INT32_MAX,
* bool weighted=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_weighted = ((bool)0);
- /* "pywrapfst.pyx":3763
+ /* "pywrapfst.pyx":3772
* int32 max_length=INT32_MAX,
* bool weighted=False,
* bool remove_total_weight=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3795
+ /* "pywrapfst.pyx":3804
* 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, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3795, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3795, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3804, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3804, __pyx_L1_error)
__pyx_v_ras = __pyx_t_2;
- /* "pywrapfst.pyx":3797
+ /* "pywrapfst.pyx":3806
* 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":3800
+ /* "pywrapfst.pyx":3809
* npath, weighted,
* remove_total_weight))
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3800, __pyx_L1_error)
+ __PYX_ERR(0, 3809, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
- /* "pywrapfst.pyx":3801
+ /* "pywrapfst.pyx":3810
* remove_total_weight))
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* if seed == 0: # <<<<<<<<<<<<<<
__pyx_t_3 = ((__pyx_v_seed == 0) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":3802
+ /* "pywrapfst.pyx":3811
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* if seed == 0:
* seed = time(NULL) + getpid() # <<<<<<<<<<<<<<
*/
__pyx_v_seed = (time(NULL) + getpid());
- /* "pywrapfst.pyx":3801
+ /* "pywrapfst.pyx":3810
* remove_total_weight))
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* if seed == 0: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3803
+ /* "pywrapfst.pyx":3812
* if seed == 0:
* seed = time(NULL) + getpid()
* fst.RandGen(deref(ifst._fst), tfst, seed, deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3803, __pyx_L1_error)
+ __PYX_ERR(0, 3812, __pyx_L1_error)
}
fst::script::RandGen((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_v_seed, (*__pyx_v_opts));
- /* "pywrapfst.pyx":3804
+ /* "pywrapfst.pyx":3813
* seed = time(NULL) + getpid()
* fst.RandGen(deref(ifst._fst), tfst, seed, deref(opts))
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3804, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3813, __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":3757
+ /* "pywrapfst.pyx":3766
*
*
* 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, 3757, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randgen") < 0)) __PYX_ERR(0, 3766, __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, 3758, __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, 3767, __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, 3759, __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, 3768, __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, 3761, __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, 3770, __pyx_L3_error)
} else {
__pyx_v_max_length = __pyx_k__50;
}
if (values[5]) {
- __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3762, __pyx_L3_error)
+ __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3771, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3762
+ /* "pywrapfst.pyx":3771
* 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, 3763, __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, 3772, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3763
+ /* "pywrapfst.pyx":3772
* 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, 3757, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randgen", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3766, __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, 3757, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3766, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_40randgen(__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":3757
+ /* "pywrapfst.pyx":3766
*
*
* 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, 3757, __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, 3766, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3807
+/* "pywrapfst.pyx":3816
*
*
* 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":3810
+ /* "pywrapfst.pyx":3819
* call_arc_labeling=b"input",
* return_arc_labeling=b"neither",
* bool epsilon_on_replace=False, # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3852
+ /* "pywrapfst.pyx":3861
* 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, 3852, __pyx_L1_error)
+ __pyx_t_1 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3861, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_it = __pyx_t_1;
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":3853
+ /* "pywrapfst.pyx":3862
* cdef _Fst ifst
* it = iter(pairs)
* (root_label, ifst) = next(it) # <<<<<<<<<<<<<<
* _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
*/
- __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3853, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3862, __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, 3853, __pyx_L1_error)
+ __PYX_ERR(0, 3862, __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, 3853, __pyx_L1_error)
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3862, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3853, __pyx_L1_error)
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3862, __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, 3853, __pyx_L1_error)
+ __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3862, __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, 3853, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 3862, __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, 3853, __pyx_L1_error)
+ __PYX_ERR(0, 3862, __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, 3853, __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, 3862, __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, 3853, __pyx_L1_error)
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3862, __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":3854
+ /* "pywrapfst.pyx":3863
* 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 '%s'", "_fst");
- __PYX_ERR(0, 3854, __pyx_L1_error)
+ __PYX_ERR(0, 3863, __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, 3854, __pyx_L1_error)
+ __PYX_ERR(0, 3863, __pyx_L1_error)
}
try {
__pyx_v__pairs.push_back(__pyx_t_7);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 3854, __pyx_L1_error)
+ __PYX_ERR(0, 3863, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3855
+ /* "pywrapfst.pyx":3864
* (root_label, ifst) = next(it)
* _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3855, __pyx_L1_error)
+ __PYX_ERR(0, 3864, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
- /* "pywrapfst.pyx":3856
+ /* "pywrapfst.pyx":3865
* _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
* cdef VectorFstClass_ptr tfst = 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, 3856, __pyx_L1_error)
+ __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3865, __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, 3856, __pyx_L1_error)
+ __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3865, __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, 3856, __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, 3865, __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, 3856, __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, 3865, __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, 3856, __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, 3865, __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, 3856, __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, 3865, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 3856, __pyx_L1_error)
+ else __PYX_ERR(0, 3865, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 3856, __pyx_L1_error)
+ __PYX_ERR(0, 3865, __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, 3856, __pyx_L1_error)
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3865, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3856, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3865, __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, 3856, __pyx_L1_error)
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3865, __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, 3856, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_10), 2) < 0) __PYX_ERR(0, 3865, __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, 3856, __pyx_L1_error)
+ __PYX_ERR(0, 3865, __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, 3856, __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, 3865, __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, 3856, __pyx_L1_error)
+ if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3865, __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":3857
+ /* "pywrapfst.pyx":3866
* cdef VectorFstClass_ptr tfst = 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 '%s'", "_fst");
- __PYX_ERR(0, 3857, __pyx_L1_error)
+ __PYX_ERR(0, 3866, __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, 3857, __pyx_L1_error)
+ __PYX_ERR(0, 3866, __pyx_L1_error)
}
try {
__pyx_v__pairs.push_back(__pyx_t_7);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 3857, __pyx_L1_error)
+ __PYX_ERR(0, 3866, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3856
+ /* "pywrapfst.pyx":3865
* _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* for (label, ifst) in it: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":3859
+ /* "pywrapfst.pyx":3868
* _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, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3859, __pyx_L1_error)
+ __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_call_arc_labeling, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3868, __pyx_L1_error)
- /* "pywrapfst.pyx":3858
+ /* "pywrapfst.pyx":3867
* 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, 3858, __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, 3867, __pyx_L1_error)
__pyx_v_cal = __pyx_t_12;
- /* "pywrapfst.pyx":3861
+ /* "pywrapfst.pyx":3870
* 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, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L1_error)
+ __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_return_arc_labeling, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3870, __pyx_L1_error)
- /* "pywrapfst.pyx":3860
+ /* "pywrapfst.pyx":3869
* 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, 3860, __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, 3869, __pyx_L1_error)
__pyx_v_ral = __pyx_t_12;
- /* "pywrapfst.pyx":3863
+ /* "pywrapfst.pyx":3872
* 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":3864
+ /* "pywrapfst.pyx":3873
* cdef unique_ptr[fst.ReplaceOptions] opts
* opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label))
* fst.Replace(_pairs, tfst, deref(opts)) # <<<<<<<<<<<<<<
*/
fst::script::Replace(__pyx_v__pairs, __pyx_v_tfst, (*__pyx_v_opts));
- /* "pywrapfst.pyx":3865
+ /* "pywrapfst.pyx":3874
* opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label))
* fst.Replace(_pairs, tfst, deref(opts))
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3865, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3874, __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":3807
+ /* "pywrapfst.pyx":3816
*
*
* 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, 3807, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(0, 3816, __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, 3810, __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, 3819, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3810
+ /* "pywrapfst.pyx":3819
* 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, 3811, __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, 3820, __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, 3807, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("replace", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3816, __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_42replace(__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":3807
+ /* "pywrapfst.pyx":3816
*
*
* 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, 3807, __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, 3816, __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":3877
*
*
* cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=True): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3887
+ /* "pywrapfst.pyx":3896
* A reversed FST.
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3887, __pyx_L1_error)
+ __PYX_ERR(0, 3896, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
- /* "pywrapfst.pyx":3888
+ /* "pywrapfst.pyx":3897
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* fst.Reverse(deref(ifst._fst), tfst, require_superinitial) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3888, __pyx_L1_error)
+ __PYX_ERR(0, 3897, __pyx_L1_error)
}
fst::script::Reverse((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_v_require_superinitial);
- /* "pywrapfst.pyx":3889
+ /* "pywrapfst.pyx":3898
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* fst.Reverse(deref(ifst._fst), tfst, require_superinitial)
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3889, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3898, __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":3877
*
*
* 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, 3868, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reverse") < 0)) __PYX_ERR(0, 3877, __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, 3868, __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, 3877, __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, 3868, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3877, __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, 3868, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3877, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_44reverse(__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, 3868, __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, 3877, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3892
+/* "pywrapfst.pyx":3901
*
*
* cpdef _MutableFst rmepsilon(_Fst ifst, # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_47rmepsilon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_rmepsilon(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_rmepsilon *__pyx_optional_args) {
- /* "pywrapfst.pyx":3893
+ /* "pywrapfst.pyx":3902
*
* cpdef _MutableFst rmepsilon(_Fst ifst,
* bool connect=True, # <<<<<<<<<<<<<<
bool __pyx_v_connect = ((bool)1);
float __pyx_v_delta = __pyx_k__51;
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__52;
- PyObject *__pyx_v_qt = ((PyObject *)__pyx_n_b_auto);
+ PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3897
+ /* "pywrapfst.pyx":3906
* int64 nstate=fst.kNoStateId,
- * qt=b"auto",
+ * queue_type=b"auto",
* bool reverse=False, # <<<<<<<<<<<<<<
* weight=None):
* """
*/
bool __pyx_v_reverse = ((bool)0);
- /* "pywrapfst.pyx":3898
- * qt=b"auto",
+ /* "pywrapfst.pyx":3907
+ * queue_type=b"auto",
* bool reverse=False,
* weight=None): # <<<<<<<<<<<<<<
* """
- * rmepsilon(ifst, connect=True, delta=0.0009765625, nstate=-1, qt="auto",
+ * rmepsilon(ifst, connect=True, delta=0.0009765625, nstate=-1,
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
fst::script::WeightClass __pyx_v_wc;
if (__pyx_optional_args->__pyx_n > 2) {
__pyx_v_nstate = __pyx_optional_args->nstate;
if (__pyx_optional_args->__pyx_n > 3) {
- __pyx_v_qt = __pyx_optional_args->qt;
+ __pyx_v_queue_type = __pyx_optional_args->queue_type;
if (__pyx_optional_args->__pyx_n > 4) {
__pyx_v_reverse = __pyx_optional_args->reverse;
if (__pyx_optional_args->__pyx_n > 5) {
}
}
- /* "pywrapfst.pyx":3922
+ /* "pywrapfst.pyx":3931
* An equivalent FST with no epsilon transitions.
* """
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.RmEpsilonOptions] opts
- * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(qt)), delta,
+ * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 3922, __pyx_L1_error)
+ __PYX_ERR(0, 3931, __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, 3922, __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, 3931, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":3924
+ /* "pywrapfst.pyx":3933
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
* cdef unique_ptr[fst.RmEpsilonOptions] opts
- * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(qt)), delta, # <<<<<<<<<<<<<<
- * connect, wc, nstate))
+ * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
+ * delta, connect, wc, nstate))
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_qt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3924, __pyx_L1_error)
- __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3924, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3933, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3933, __pyx_L1_error)
- /* "pywrapfst.pyx":3925
+ /* "pywrapfst.pyx":3934
* cdef unique_ptr[fst.RmEpsilonOptions] opts
- * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(qt)), delta,
- * connect, wc, nstate)) # <<<<<<<<<<<<<<
+ * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
+ * delta, connect, wc, nstate)) # <<<<<<<<<<<<<<
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* fst.RmEpsilon(deref(ifst._fst), tfst, reverse, deref(opts))
*/
__pyx_v_opts.reset(new fst::script::RmEpsilonOptions(__pyx_t_3, __pyx_v_delta, __pyx_v_connect, __pyx_v_wc, __pyx_v_nstate));
- /* "pywrapfst.pyx":3926
- * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(qt)), delta,
- * connect, wc, nstate))
+ /* "pywrapfst.pyx":3935
+ * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
+ * delta, connect, wc, nstate))
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type()) # <<<<<<<<<<<<<<
* fst.RmEpsilon(deref(ifst._fst), tfst, reverse, deref(opts))
* return _init_MutableFst(tfst)
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3926, __pyx_L1_error)
+ __PYX_ERR(0, 3935, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
- /* "pywrapfst.pyx":3927
- * connect, wc, nstate))
+ /* "pywrapfst.pyx":3936
+ * delta, connect, wc, nstate))
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* fst.RmEpsilon(deref(ifst._fst), tfst, reverse, deref(opts)) # <<<<<<<<<<<<<<
* return _init_MutableFst(tfst)
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3927, __pyx_L1_error)
+ __PYX_ERR(0, 3936, __pyx_L1_error)
}
fst::script::RmEpsilon((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_v_reverse, (*__pyx_v_opts));
- /* "pywrapfst.pyx":3928
+ /* "pywrapfst.pyx":3937
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* fst.RmEpsilon(deref(ifst._fst), tfst, reverse, deref(opts))
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3928, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3937, __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":3892
+ /* "pywrapfst.pyx":3901
*
*
* cpdef _MutableFst rmepsilon(_Fst ifst, # <<<<<<<<<<<<<<
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_47rmepsilon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_46rmepsilon[] = "\n rmepsilon(ifst, connect=True, delta=0.0009765625, nstate=-1, qt=\"auto\",\n reverse=False, weight=None)\n\n Constructively removes epsilon transitions from an FST.\n\n This operation removes epsilon transitions (those where both input and output\n labels are epsilon) from an FST.\n\n Args:\n ifst: The input FST.\n connect: Should output be trimmed?\n delta: Comparison/quantization delta.\n nstate: State number threshold.\n qt: A string matching a known queue type; one of: \"auto\", \"fifo\", \"lifo\",\n \"shortest\", \"state\", \"top\".\n reverse: Should epsilon transitions be removed in reverse order?\n weight: A string indicating the desired weight threshold; paths with\n weights below this threshold will be pruned.\n\n Returns:\n An equivalent FST with no epsilon transitions.\n ";
+static char __pyx_doc_9pywrapfst_46rmepsilon[] = "\n rmepsilon(ifst, connect=True, delta=0.0009765625, nstate=-1,\n queue_type=\"auto\", reverse=False, weight=None)\n\n Constructively removes epsilon transitions from an FST.\n\n This operation removes epsilon transitions (those where both input and output\n labels are epsilon) from an FST.\n\n Args:\n ifst: The input FST.\n connect: Should output be trimmed?\n delta: Comparison/quantization delta.\n nstate: State number threshold.\n queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n \"lifo\", \"shortest\", \"state\", \"top\".\n reverse: Should epsilon transitions be removed in reverse order?\n weight: A string indicating the desired weight threshold; paths with\n weights below this threshold will be pruned.\n\n Returns:\n An equivalent FST with no epsilon transitions.\n ";
static PyObject *__pyx_pw_9pywrapfst_47rmepsilon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
bool __pyx_v_connect;
float __pyx_v_delta;
__pyx_t_10basictypes_int64 __pyx_v_nstate;
- PyObject *__pyx_v_qt = 0;
+ PyObject *__pyx_v_queue_type = 0;
bool __pyx_v_reverse;
PyObject *__pyx_v_weight = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("rmepsilon (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_connect,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_qt,&__pyx_n_s_reverse,&__pyx_n_s_weight,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_connect,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_queue_type,&__pyx_n_s_reverse,&__pyx_n_s_weight,0};
PyObject* values[7] = {0,0,0,0,0,0,0};
values[4] = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3898
- * qt=b"auto",
+ /* "pywrapfst.pyx":3907
+ * queue_type=b"auto",
* bool reverse=False,
* weight=None): # <<<<<<<<<<<<<<
* """
- * rmepsilon(ifst, connect=True, delta=0.0009765625, nstate=-1, qt="auto",
+ * rmepsilon(ifst, connect=True, delta=0.0009765625, nstate=-1,
*/
values[6] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
}
case 4:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qt);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_type);
if (value) { values[4] = value; kw_args--; }
}
case 5:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 3892, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 3901, __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_connect = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3893, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3902, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3893
+ /* "pywrapfst.pyx":3902
*
* cpdef _MutableFst rmepsilon(_Fst ifst,
* bool connect=True, # <<<<<<<<<<<<<<
__pyx_v_connect = ((bool)1);
}
if (values[2]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3894, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3903, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__51;
}
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, 3895, __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, 3904, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__52;
}
- __pyx_v_qt = values[4];
+ __pyx_v_queue_type = values[4];
if (values[5]) {
- __pyx_v_reverse = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_reverse == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3897, __pyx_L3_error)
+ __pyx_v_reverse = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_reverse == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3906, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3897
+ /* "pywrapfst.pyx":3906
* int64 nstate=fst.kNoStateId,
- * qt=b"auto",
+ * queue_type=b"auto",
* bool reverse=False, # <<<<<<<<<<<<<<
* weight=None):
* """
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3892, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3901, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.rmepsilon", __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, 3892, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_46rmepsilon(__pyx_self, __pyx_v_ifst, __pyx_v_connect, __pyx_v_delta, __pyx_v_nstate, __pyx_v_qt, __pyx_v_reverse, __pyx_v_weight);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3901, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_46rmepsilon(__pyx_self, __pyx_v_ifst, __pyx_v_connect, __pyx_v_delta, __pyx_v_nstate, __pyx_v_queue_type, __pyx_v_reverse, __pyx_v_weight);
- /* "pywrapfst.pyx":3892
+ /* "pywrapfst.pyx":3901
*
*
* cpdef _MutableFst rmepsilon(_Fst ifst, # <<<<<<<<<<<<<<
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_46rmepsilon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, bool __pyx_v_connect, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_qt, bool __pyx_v_reverse, PyObject *__pyx_v_weight) {
+static PyObject *__pyx_pf_9pywrapfst_46rmepsilon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, bool __pyx_v_connect, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_reverse, PyObject *__pyx_v_weight) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__pyx_t_2.connect = __pyx_v_connect;
__pyx_t_2.delta = __pyx_v_delta;
__pyx_t_2.nstate = __pyx_v_nstate;
- __pyx_t_2.qt = __pyx_v_qt;
+ __pyx_t_2.queue_type = __pyx_v_queue_type;
__pyx_t_2.reverse = __pyx_v_reverse;
__pyx_t_2.weight = __pyx_v_weight;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_rmepsilon(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3892, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_rmepsilon(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3901, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3934
+/* "pywrapfst.pyx":3943
*
*
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
- * float delta=fst.kDelta, int64 nstate=fst.kNoStateId, qt=b"auto",
+ * float delta=fst.kDelta, int64 nstate=fst.kNoStateId, queue_type=b"auto",
* bool reverse=False) except *:
*/
static std::vector<fst::script::WeightClass> *__pyx_f_9pywrapfst__shortestdistance(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args) {
float __pyx_v_delta = __pyx_k__53;
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__54;
- PyObject *__pyx_v_qt = ((PyObject *)__pyx_n_b_auto);
+ PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3936
+ /* "pywrapfst.pyx":3945
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,
- * float delta=fst.kDelta, int64 nstate=fst.kNoStateId, qt=b"auto",
+ * float delta=fst.kDelta, int64 nstate=fst.kNoStateId, queue_type=b"auto",
* bool reverse=False) except *: # <<<<<<<<<<<<<<
- * cdef vector[fst.WeightClass] *distance = new vector[fst.WeightClass]()
- * # For scoping reasons, these have to be declared here even though they may
+ * cdef unique_ptr[vector[fst.WeightClass]] distance
+ * distance.reset(new vector[fst.WeightClass]())
*/
bool __pyx_v_reverse = ((bool)0);
- std::vector<fst::script::WeightClass> *__pyx_v_distance;
+ std::unique_ptr<std::vector<fst::script::WeightClass> > __pyx_v_distance;
std::unique_ptr<fst::script::ShortestDistanceOptions> __pyx_v_opts;
std::vector<fst::script::WeightClass> *__pyx_r;
__Pyx_RefNannyDeclarations
if (__pyx_optional_args->__pyx_n > 1) {
__pyx_v_nstate = __pyx_optional_args->nstate;
if (__pyx_optional_args->__pyx_n > 2) {
- __pyx_v_qt = __pyx_optional_args->qt;
+ __pyx_v_queue_type = __pyx_optional_args->queue_type;
if (__pyx_optional_args->__pyx_n > 3) {
__pyx_v_reverse = __pyx_optional_args->reverse;
}
}
}
- /* "pywrapfst.pyx":3937
- * float delta=fst.kDelta, int64 nstate=fst.kNoStateId, qt=b"auto",
+ /* "pywrapfst.pyx":3947
* bool reverse=False) except *:
- * cdef vector[fst.WeightClass] *distance = new vector[fst.WeightClass]() # <<<<<<<<<<<<<<
+ * cdef unique_ptr[vector[fst.WeightClass]] distance
+ * distance.reset(new vector[fst.WeightClass]()) # <<<<<<<<<<<<<<
* # For scoping reasons, these have to be declared here even though they may
* # not be used in all cases.
*/
__pyx_t_1 = new std::vector<fst::script::WeightClass> ();
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 3937, __pyx_L1_error)
+ __PYX_ERR(0, 3947, __pyx_L1_error)
}
- __pyx_v_distance = __pyx_t_1;
+ __pyx_v_distance.reset(__pyx_t_1);
- /* "pywrapfst.pyx":3941
+ /* "pywrapfst.pyx":3951
* # not be used in all cases.
* cdef unique_ptr[fst.ShortestDistanceOptions] opts
* if reverse: # <<<<<<<<<<<<<<
* # Only the simpler signature supports shortest distance to final states;
- * # `nstate` and `qt` arguments are ignored.
+ * # `nstate` and `queue_type` arguments are ignored.
*/
__pyx_t_2 = (__pyx_v_reverse != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":3944
+ /* "pywrapfst.pyx":3954
* # Only the simpler signature supports shortest distance to final states;
- * # `nstate` and `qt` arguments are ignored.
- * fst.ShortestDistance(deref(ifst._fst), distance, True, delta) # <<<<<<<<<<<<<<
+ * # `nstate` and `queue_type` arguments are ignored.
+ * fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta) # <<<<<<<<<<<<<<
* else:
* opts.reset(new fst.ShortestDistanceOptions(
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3944, __pyx_L1_error)
+ __PYX_ERR(0, 3954, __pyx_L1_error)
}
- fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance, 1, __pyx_v_delta);
+ fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance.get(), 1, __pyx_v_delta);
- /* "pywrapfst.pyx":3941
+ /* "pywrapfst.pyx":3951
* # not be used in all cases.
* cdef unique_ptr[fst.ShortestDistanceOptions] opts
* if reverse: # <<<<<<<<<<<<<<
* # Only the simpler signature supports shortest distance to final states;
- * # `nstate` and `qt` arguments are ignored.
+ * # `nstate` and `queue_type` arguments are ignored.
*/
goto __pyx_L3;
}
- /* "pywrapfst.pyx":3946
- * fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
+ /* "pywrapfst.pyx":3956
+ * fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta)
* else:
* opts.reset(new fst.ShortestDistanceOptions( # <<<<<<<<<<<<<<
- * _get_queue_type(tostring(qt)), fst.ANY_ARC_FILTER, nstate, delta))
- * fst.ShortestDistance(deref(ifst._fst), distance, deref(opts))
+ * _get_queue_type(tostring(queue_type)), fst.ANY_ARC_FILTER, nstate,
+ * delta))
*/
/*else*/ {
- /* "pywrapfst.pyx":3947
+ /* "pywrapfst.pyx":3957
* else:
* opts.reset(new fst.ShortestDistanceOptions(
- * _get_queue_type(tostring(qt)), fst.ANY_ARC_FILTER, nstate, delta)) # <<<<<<<<<<<<<<
- * fst.ShortestDistance(deref(ifst._fst), distance, deref(opts))
- * return distance
+ * _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_qt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3947, __pyx_L1_error)
- __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3947, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3957, __pyx_L1_error)
+ __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3957, __pyx_L1_error)
- /* "pywrapfst.pyx":3946
- * fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
+ /* "pywrapfst.pyx":3956
+ * fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta)
* else:
* opts.reset(new fst.ShortestDistanceOptions( # <<<<<<<<<<<<<<
- * _get_queue_type(tostring(qt)), fst.ANY_ARC_FILTER, nstate, delta))
- * fst.ShortestDistance(deref(ifst._fst), distance, deref(opts))
+ * _get_queue_type(tostring(queue_type)), fst.ANY_ARC_FILTER, nstate,
+ * delta))
*/
__pyx_v_opts.reset(new fst::script::ShortestDistanceOptions(__pyx_t_4, fst::script::ANY_ARC_FILTER, __pyx_v_nstate, __pyx_v_delta));
- /* "pywrapfst.pyx":3948
- * opts.reset(new fst.ShortestDistanceOptions(
- * _get_queue_type(tostring(qt)), fst.ANY_ARC_FILTER, nstate, delta))
- * fst.ShortestDistance(deref(ifst._fst), distance, deref(opts)) # <<<<<<<<<<<<<<
- * return distance
+ /* "pywrapfst.pyx":3959
+ * _get_queue_type(tostring(queue_type)), fst.ANY_ARC_FILTER, nstate,
+ * delta))
+ * fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts)) # <<<<<<<<<<<<<<
+ * return distance.release()
*
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3948, __pyx_L1_error)
+ __PYX_ERR(0, 3959, __pyx_L1_error)
}
- fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance, (*__pyx_v_opts));
+ fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance.get(), (*__pyx_v_opts));
}
__pyx_L3:;
- /* "pywrapfst.pyx":3949
- * _get_queue_type(tostring(qt)), fst.ANY_ARC_FILTER, nstate, delta))
- * fst.ShortestDistance(deref(ifst._fst), distance, deref(opts))
- * return distance # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3960
+ * delta))
+ * fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts))
+ * return distance.release() # <<<<<<<<<<<<<<
*
*
*/
- __pyx_r = __pyx_v_distance;
+ __pyx_r = __pyx_v_distance.release();
goto __pyx_L0;
- /* "pywrapfst.pyx":3934
+ /* "pywrapfst.pyx":3943
*
*
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
- * float delta=fst.kDelta, int64 nstate=fst.kNoStateId, qt=b"auto",
+ * float delta=fst.kDelta, int64 nstate=fst.kNoStateId, queue_type=b"auto",
* bool reverse=False) except *:
*/
return __pyx_r;
}
-/* "pywrapfst.pyx":3952
+/* "pywrapfst.pyx":3963
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_49shortestdistance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_48shortestdistance[] = "\n shortestdistance(ifst, delta=0.0009765625, nstate=-1, qt=\"auto\",\n reverse=False)\n\n Compute the shortest distance from the initial or final state.\n\n This operation computes the shortest distance from the initial state (when\n `reverse` is False) or from every state to the final state (when `reverse` is\n True). The shortest distance from p to q is the \\otimes-sum of the weights of\n all the paths between p and q. The weights must be right (if `reverse` is\n False) or left (if `reverse` is True) distributive, and k-closed (i.e., 1\n \\otimes x \\otimes x^2 \\otimes ... \\otimes x^{k + 1} = 1 \\otimes x \\otimes x^2\n \\otimes ... \\otimes x^k; e.g., TropicalWeight).\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta.\n nstate: State number threshold (this is ignored if `reverse` is True).\n qt: A string matching a known queue type; one of: \"auto\", \"fifo\", \"lifo\",\n \"shortest\", \"state\", \"top\" (this is ignored if `reverse` is True).\n reverse: Should the reverse distance (from each state to the final state)\n be computed?\n\n Returns:\n A list of Weight objects representing the shortest distance for each state.\n ";
+static char __pyx_doc_9pywrapfst_48shortestdistance[] = "\n shortestdistance(ifst, delta=0.0009765625, nstate=-1, queue_type=\"auto\",\n reverse=False)\n\n Compute the shortest distance from the initial or final state.\n\n This operation computes the shortest distance from the initial state (when\n `reverse` is False) or from every state to the final state (when `reverse` is\n True). The shortest distance from p to q is the \\otimes-sum of the weights of\n all the paths between p and q. The weights must be right (if `reverse` is\n False) or left (if `reverse` is True) distributive, and k-closed (i.e., 1\n \\otimes x \\otimes x^2 \\otimes ... \\otimes x^{k + 1} = 1 \\otimes x \\otimes x^2\n \\otimes ... \\otimes x^k; e.g., TropicalWeight).\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta.\n nstate: State number threshold (this is ignored if `reverse` is True).\n queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n \"lifo\", \"shortest\", \"state\", \"top\" (this is ignored if `reverse` is\n True).\n reverse: Should the reverse distance (from each state to the final state)\n be computed?\n\n Returns:\n A list of Weight objects representing the shortest distance for each state.\n ";
static PyMethodDef __pyx_mdef_9pywrapfst_49shortestdistance = {"shortestdistance", (PyCFunction)__pyx_pw_9pywrapfst_49shortestdistance, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_48shortestdistance};
static PyObject *__pyx_pw_9pywrapfst_49shortestdistance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
float __pyx_v_delta;
__pyx_t_10basictypes_int64 __pyx_v_nstate;
- PyObject *__pyx_v_qt = 0;
+ PyObject *__pyx_v_queue_type = 0;
bool __pyx_v_reverse;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("shortestdistance (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_qt,&__pyx_n_s_reverse,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_queue_type,&__pyx_n_s_reverse,0};
PyObject* values[5] = {0,0,0,0,0};
values[3] = ((PyObject *)__pyx_n_b_auto);
if (unlikely(__pyx_kwds)) {
}
case 3:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qt);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_type);
if (value) { values[3] = value; kw_args--; }
}
case 4:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 3952, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 3963, __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, 3953, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3964, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__55;
}
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, 3954, __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, 3965, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__56;
}
- __pyx_v_qt = values[3];
+ __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, 3956, __pyx_L3_error)
+ __pyx_v_reverse = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_reverse == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3967, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3956
+ /* "pywrapfst.pyx":3967
* int64 nstate=fst.kNoStateId,
- * qt=b"auto",
+ * queue_type=b"auto",
* bool reverse=False): # <<<<<<<<<<<<<<
* """
- * shortestdistance(ifst, delta=0.0009765625, nstate=-1, qt="auto",
+ * shortestdistance(ifst, delta=0.0009765625, nstate=-1, queue_type="auto",
*/
__pyx_v_reverse = ((bool)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3952, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3963, __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, 3952, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_48shortestdistance(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_qt, __pyx_v_reverse);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3963, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_48shortestdistance(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_queue_type, __pyx_v_reverse);
- /* "pywrapfst.pyx":3952
+ /* "pywrapfst.pyx":3963
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_qt, bool __pyx_v_reverse) {
+static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_reverse) {
std::unique_ptr<std::vector<fst::script::WeightClass> > __pyx_v_distance;
std::string __pyx_v_weight_type;
PyObject *__pyx_v_result = NULL;
int __pyx_t_7;
__Pyx_RefNannySetupContext("shortestdistance", 0);
- /* "pywrapfst.pyx":3984
+ /* "pywrapfst.pyx":3996
* """
* cdef unique_ptr[vector[fst.WeightClass]] distance
- * distance.reset(_shortestdistance(ifst, delta, nstate, qt, reverse)) # <<<<<<<<<<<<<<
+ * distance.reset(_shortestdistance(ifst, delta, nstate, queue_type, reverse)) # <<<<<<<<<<<<<<
* # Packs the distances, as strings, into a Python list.
* cdef string weight_type = ifst.weight_type()
*/
__pyx_t_2.__pyx_n = 4;
__pyx_t_2.delta = __pyx_v_delta;
__pyx_t_2.nstate = __pyx_v_nstate;
- __pyx_t_2.qt = __pyx_v_qt;
+ __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, 3984, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__shortestdistance(__pyx_v_ifst, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3996, __pyx_L1_error)
__pyx_v_distance.reset(__pyx_t_1);
- /* "pywrapfst.pyx":3986
- * distance.reset(_shortestdistance(ifst, delta, nstate, qt, reverse))
+ /* "pywrapfst.pyx":3998
+ * distance.reset(_shortestdistance(ifst, delta, nstate, queue_type, reverse))
* # Packs the distances, as strings, into a Python list.
* cdef string weight_type = ifst.weight_type() # <<<<<<<<<<<<<<
* result = []
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 3986, __pyx_L1_error)
+ __PYX_ERR(0, 3998, __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":3987
+ /* "pywrapfst.pyx":3999
* # Packs the distances, as strings, into a Python list.
* cdef string weight_type = ifst.weight_type()
* result = [] # <<<<<<<<<<<<<<
* # This is just the Cython version of the normal vector iteration idiom.
* cdef vector[fst.WeightClass].iterator it = distance.get().begin()
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3987, __pyx_L1_error)
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3999, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_result = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "pywrapfst.pyx":3989
+ /* "pywrapfst.pyx":4001
* result = []
* # This is just the Cython version of the normal vector iteration idiom.
* cdef vector[fst.WeightClass].iterator it = distance.get().begin() # <<<<<<<<<<<<<<
*/
__pyx_v_it = __pyx_v_distance.get()->begin();
- /* "pywrapfst.pyx":3990
+ /* "pywrapfst.pyx":4002
* # This is just the Cython version of the normal vector iteration idiom.
* cdef vector[fst.WeightClass].iterator it = distance.get().begin()
* while it != distance.get().end(): # <<<<<<<<<<<<<<
__pyx_t_4 = ((__pyx_v_it != __pyx_v_distance.get()->end()) != 0);
if (!__pyx_t_4) break;
- /* "pywrapfst.pyx":3991
+ /* "pywrapfst.pyx":4003
* cdef vector[fst.WeightClass].iterator it = distance.get().begin()
* while it != distance.get().end():
* result.append(Weight(weight_type, deref(it).ToString())) # <<<<<<<<<<<<<<
* inc(it)
* return result
*/
- __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_weight_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3991, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_weight_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4003, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string((*__pyx_v_it).ToString()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3991, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string((*__pyx_v_it).ToString()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4003, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3991, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4003, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3991, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4003, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 3991, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 4003, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "pywrapfst.pyx":3992
+ /* "pywrapfst.pyx":4004
* while it != distance.get().end():
* result.append(Weight(weight_type, deref(it).ToString()))
* inc(it) # <<<<<<<<<<<<<<
(++__pyx_v_it);
}
- /* "pywrapfst.pyx":3993
+ /* "pywrapfst.pyx":4005
* result.append(Weight(weight_type, deref(it).ToString()))
* inc(it)
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":3952
+ /* "pywrapfst.pyx":3963
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3996
+/* "pywrapfst.pyx":4008
*
*
* cpdef _MutableFst shortestpath(_Fst ifst, # <<<<<<<<<<<<<<
float __pyx_v_delta = __pyx_k__57;
__pyx_t_10basictypes_int32 __pyx_v_nshortest = ((__pyx_t_10basictypes_int32)1);
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__58;
- PyObject *__pyx_v_qt = ((PyObject *)__pyx_n_b_auto);
+ PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":4001
+ /* "pywrapfst.pyx":4013
* int64 nstate=fst.kNoStateId,
- * qt=b"auto",
+ * queue_type=b"auto",
* bool unique=False, # <<<<<<<<<<<<<<
* weight=None):
* """
*/
bool __pyx_v_unique = ((bool)0);
- /* "pywrapfst.pyx":4002
- * qt=b"auto",
+ /* "pywrapfst.pyx":4014
+ * queue_type=b"auto",
* bool unique=False,
* weight=None): # <<<<<<<<<<<<<<
* """
- * shortestpath(ifst, delta=0.0009765625, nshortest=1, nstate=-1, qt="auto",
+ * shortestpath(ifst, delta=0.0009765625, nshortest=1, nstate=-1,
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
__pyx_t_9pywrapfst_VectorFstClass_ptr __pyx_v_tfst;
if (__pyx_optional_args->__pyx_n > 2) {
__pyx_v_nstate = __pyx_optional_args->nstate;
if (__pyx_optional_args->__pyx_n > 3) {
- __pyx_v_qt = __pyx_optional_args->qt;
+ __pyx_v_queue_type = __pyx_optional_args->queue_type;
if (__pyx_optional_args->__pyx_n > 4) {
__pyx_v_unique = __pyx_optional_args->unique;
if (__pyx_optional_args->__pyx_n > 5) {
}
}
- /* "pywrapfst.pyx":4033
+ /* "pywrapfst.pyx":4045
* An FST containing the n-shortest paths.
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 4033, __pyx_L1_error)
+ __PYX_ERR(0, 4045, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
- /* "pywrapfst.pyx":4035
+ /* "pywrapfst.pyx":4047
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* 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, 4035, __pyx_L1_error)
+ __PYX_ERR(0, 4047, __pyx_L1_error)
}
__pyx_v_distance.reset(__pyx_t_1);
- /* "pywrapfst.pyx":4037
+ /* "pywrapfst.pyx":4049
* distance.reset(new vector[fst.WeightClass]())
* # 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.ShortestPathOptions] opts
- * opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(qt)),
+ * opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 4037, __pyx_L1_error)
+ __PYX_ERR(0, 4049, __pyx_L1_error)
}
- __pyx_t_2 = __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, 4037, __pyx_L1_error)
+ __pyx_t_2 = __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, 4049, __pyx_L1_error)
__pyx_v_wc = __pyx_t_2;
- /* "pywrapfst.pyx":4039
+ /* "pywrapfst.pyx":4051
* 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(qt)), # <<<<<<<<<<<<<<
+ * opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
* nshortest, unique, False, delta,
* False, wc, nstate))
*/
- __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_qt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4039, __pyx_L1_error)
- __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4039, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4051, __pyx_L1_error)
+ __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4051, __pyx_L1_error)
- /* "pywrapfst.pyx":4041
- * opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(qt)),
+ /* "pywrapfst.pyx":4053
+ * opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),
* nshortest, unique, False, delta,
* False, wc, nstate)) # <<<<<<<<<<<<<<
* fst.ShortestPath(deref(ifst._fst), tfst, distance.get(), deref(opts))
*/
__pyx_v_opts.reset(new fst::script::ShortestPathOptions(__pyx_t_4, __pyx_v_nshortest, __pyx_v_unique, 0, __pyx_v_delta, 0, __pyx_v_wc, __pyx_v_nstate));
- /* "pywrapfst.pyx":4042
+ /* "pywrapfst.pyx":4054
* nshortest, unique, False, delta,
* False, wc, nstate))
* fst.ShortestPath(deref(ifst._fst), tfst, distance.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 4042, __pyx_L1_error)
+ __PYX_ERR(0, 4054, __pyx_L1_error)
}
fst::script::ShortestPath((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_v_distance.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":4043
+ /* "pywrapfst.pyx":4055
* False, wc, nstate))
* fst.ShortestPath(deref(ifst._fst), tfst, distance.get(), deref(opts))
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_5 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4043, __pyx_L1_error)
+ __pyx_t_5 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4055, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_5);
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3996
+ /* "pywrapfst.pyx":4008
*
*
* cpdef _MutableFst shortestpath(_Fst ifst, # <<<<<<<<<<<<<<
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_51shortestpath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_50shortestpath[] = "\n shortestpath(ifst, delta=0.0009765625, nshortest=1, nstate=-1, qt=\"auto\",\n unique=False, weight=None)\n\n Construct an FST containing the shortest path(s) in the input FST.\n\n This operation produces an FST containing the n-shortest paths in the input\n FST. The n-shortest paths are the n-lowest weight paths w.r.t. the natural\n semiring order. The single path that can be read from the ith of at most n\n transitions leaving the initial state of the resulting FST is the ith\n shortest path. The weights need to be right distributive and have the path\n property. They also need to be left distributive as well for n-shortest with\n n > 1 (e.g., TropicalWeight).\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta.\n nshortest: The number of paths to return.\n nstate: State number threshold.\n qt: A string matching a known queue type; one of: \"auto\", \"fifo\", \"lifo\",\n \"shortest\", \"state\", \"top\".\n unique: Should the resulting FST only contain distinct paths? (Requires\n the input FST to be an acceptor; epsilons are treated as if they are\n regular symbols.)\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 An FST containing the n-shortest paths.\n ";
+static char __pyx_doc_9pywrapfst_50shortestpath[] = "\n shortestpath(ifst, delta=0.0009765625, nshortest=1, nstate=-1,\n queue_type=\"auto\", unique=False, weight=None)\n\n Construct an FST containing the shortest path(s) in the input FST.\n\n This operation produces an FST containing the n-shortest paths in the input\n FST. The n-shortest paths are the n-lowest weight paths w.r.t. the natural\n semiring order. The single path that can be read from the ith of at most n\n transitions leaving the initial state of the resulting FST is the ith\n shortest path. The weights need to be right distributive and have the path\n property. They also need to be left distributive as well for n-shortest with\n n > 1 (e.g., TropicalWeight).\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta.\n nshortest: The number of paths to return.\n nstate: State number threshold.\n queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n \"lifo\", \"shortest\", \"state\", \"top\".\n unique: Should the resulting FST only contain distinct paths? (Requires\n the input FST to be an acceptor; epsilons are treated as if they are\n regular symbols.)\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 An FST containing the n-shortest paths.\n ";
static PyObject *__pyx_pw_9pywrapfst_51shortestpath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
float __pyx_v_delta;
__pyx_t_10basictypes_int32 __pyx_v_nshortest;
__pyx_t_10basictypes_int64 __pyx_v_nstate;
- PyObject *__pyx_v_qt = 0;
+ PyObject *__pyx_v_queue_type = 0;
bool __pyx_v_unique;
PyObject *__pyx_v_weight = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("shortestpath (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nshortest,&__pyx_n_s_nstate,&__pyx_n_s_qt,&__pyx_n_s_unique,&__pyx_n_s_weight,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nshortest,&__pyx_n_s_nstate,&__pyx_n_s_queue_type,&__pyx_n_s_unique,&__pyx_n_s_weight,0};
PyObject* values[7] = {0,0,0,0,0,0,0};
values[4] = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":4002
- * qt=b"auto",
+ /* "pywrapfst.pyx":4014
+ * queue_type=b"auto",
* bool unique=False,
* weight=None): # <<<<<<<<<<<<<<
* """
- * shortestpath(ifst, delta=0.0009765625, nshortest=1, nstate=-1, qt="auto",
+ * shortestpath(ifst, delta=0.0009765625, nshortest=1, nstate=-1,
*/
values[6] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
}
case 4:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qt);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_type);
if (value) { values[4] = value; kw_args--; }
}
case 5:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestpath") < 0)) __PYX_ERR(0, 3996, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestpath") < 0)) __PYX_ERR(0, 4008, __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, 3997, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 4009, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__57;
}
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, 3998, __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, 4010, __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, 3999, __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, 4011, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__58;
}
- __pyx_v_qt = values[4];
+ __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, 4001, __pyx_L3_error)
+ __pyx_v_unique = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_unique == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4013, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4001
+ /* "pywrapfst.pyx":4013
* int64 nstate=fst.kNoStateId,
- * qt=b"auto",
+ * queue_type=b"auto",
* bool unique=False, # <<<<<<<<<<<<<<
* weight=None):
* """
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3996, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4008, __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, 3996, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_50shortestpath(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nshortest, __pyx_v_nstate, __pyx_v_qt, __pyx_v_unique, __pyx_v_weight);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4008, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_50shortestpath(__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":3996
+ /* "pywrapfst.pyx":4008
*
*
* cpdef _MutableFst shortestpath(_Fst ifst, # <<<<<<<<<<<<<<
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_50shortestpath(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int32 __pyx_v_nshortest, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_qt, bool __pyx_v_unique, PyObject *__pyx_v_weight) {
+static PyObject *__pyx_pf_9pywrapfst_50shortestpath(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int32 __pyx_v_nshortest, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_unique, PyObject *__pyx_v_weight) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__pyx_t_2.delta = __pyx_v_delta;
__pyx_t_2.nshortest = __pyx_v_nshortest;
__pyx_t_2.nstate = __pyx_v_nstate;
- __pyx_t_2.qt = __pyx_v_qt;
+ __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, 3996, __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, 4008, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4046
+/* "pywrapfst.pyx":4058
*
*
- * cpdef _Fst statemap(_Fst ifst, mt): # <<<<<<<<<<<<<<
+ * cpdef _Fst statemap(_Fst ifst, map_type): # <<<<<<<<<<<<<<
* """
* state_map(ifst, map_type)
*/
static PyObject *__pyx_pw_9pywrapfst_53statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_statemap(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, PyObject *__pyx_v_mt, CYTHON_UNUSED int __pyx_skip_dispatch) {
+static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_statemap(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, PyObject *__pyx_v_map_type, CYTHON_UNUSED int __pyx_skip_dispatch) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst__map __pyx_t_2;
__Pyx_RefNannySetupContext("statemap", 0);
- /* "pywrapfst.pyx":4069
+ /* "pywrapfst.pyx":4081
* See also: `arcmap`.
* """
- * return _map(ifst, fst.kDelta, mt, None) # <<<<<<<<<<<<<<
+ * return _map(ifst, fst.kDelta, map_type, None) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_2.__pyx_n = 3;
__pyx_t_2.delta = fst::kDelta;
- __pyx_t_2.mt = __pyx_v_mt;
+ __pyx_t_2.map_type = __pyx_v_map_type;
__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, 4069, __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, 4081, __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":4046
+ /* "pywrapfst.pyx":4058
*
*
- * cpdef _Fst statemap(_Fst ifst, mt): # <<<<<<<<<<<<<<
+ * cpdef _Fst statemap(_Fst ifst, map_type): # <<<<<<<<<<<<<<
* """
* state_map(ifst, map_type)
*/
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_53statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_52statemap[] = "\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 mt: A string matching a known mapping operation; one of: \"arc_sum\" (sum\n 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_52statemap[] = "\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 PyObject *__pyx_pw_9pywrapfst_53statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
- PyObject *__pyx_v_mt = 0;
+ PyObject *__pyx_v_map_type = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("statemap (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_mt,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_map_type,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mt)) != 0)) kw_args--;
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_map_type)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4046, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4058, __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, 4046, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "statemap") < 0)) __PYX_ERR(0, 4058, __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_mt = values[1];
+ __pyx_v_map_type = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4046, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4058, __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, 4046, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_52statemap(__pyx_self, __pyx_v_ifst, __pyx_v_mt);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4058, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_52statemap(__pyx_self, __pyx_v_ifst, __pyx_v_map_type);
/* function exit code */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_52statemap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, PyObject *__pyx_v_mt) {
+static PyObject *__pyx_pf_9pywrapfst_52statemap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, PyObject *__pyx_v_map_type) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
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_mt, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4046, __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, 4058, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4072
+/* "pywrapfst.pyx":4084
*
*
* cpdef _MutableFst synchronize(_Fst ifst): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("synchronize", 0);
- /* "pywrapfst.pyx":4091
+ /* "pywrapfst.pyx":4103
* An equivalent synchronized FST.
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 4091, __pyx_L1_error)
+ __PYX_ERR(0, 4103, __pyx_L1_error)
}
__pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
- /* "pywrapfst.pyx":4092
+ /* "pywrapfst.pyx":4104
* """
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* fst.Synchronize(deref(ifst._fst), tfst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 4092, __pyx_L1_error)
+ __PYX_ERR(0, 4104, __pyx_L1_error)
}
fst::script::Synchronize((*__pyx_v_ifst->_fst), __pyx_v_tfst);
- /* "pywrapfst.pyx":4093
+ /* "pywrapfst.pyx":4105
* cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
* fst.Synchronize(deref(ifst._fst), tfst)
* return _init_MutableFst(tfst) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4093, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4105, __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":4072
+ /* "pywrapfst.pyx":4084
*
*
* 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, 4072, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4084, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_54synchronize(__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, 4072, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_synchronize(__pyx_v_ifst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4150
+/* "pywrapfst.pyx":4162
* """
*
* 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":4153
+ /* "pywrapfst.pyx":4165
* 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":4154
+ /* "pywrapfst.pyx":4166
* string arc_type=b"standard",
* SymbolTable isymbols=None,
* SymbolTable osymbols=None, # <<<<<<<<<<<<<<
*/
values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
- /* "pywrapfst.pyx":4155
+ /* "pywrapfst.pyx":4167
* 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, 4150, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 4162, __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, 4151, __pyx_L3_error)
+ __pyx_v_fst_type = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4163, __pyx_L3_error)
} else {
__pyx_v_fst_type = __pyx_k__59;
}
if (values[1]) {
- __pyx_v_arc_type = __pyx_convert_string_from_py_std__in_string(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4152, __pyx_L3_error)
+ __pyx_v_arc_type = __pyx_convert_string_from_py_std__in_string(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4164, __pyx_L3_error)
} else {
__pyx_v_arc_type = __pyx_k__60;
}
__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, 4156, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4168, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4156
+ /* "pywrapfst.pyx":4168
* 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, 4157, __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, 4169, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4157
+ /* "pywrapfst.pyx":4169
* 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, 4158, __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, 4170, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4158
+ /* "pywrapfst.pyx":4170
* 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, 4159, __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, 4171, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4159
+ /* "pywrapfst.pyx":4171
* 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, 4160, __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, 4172, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4160
+ /* "pywrapfst.pyx":4172
* 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, 4150, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4162, __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, 4153, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4154, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4155, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 4165, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4166, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4167, __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":4150
+ /* "pywrapfst.pyx":4162
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
fst::SymbolTable *__pyx_t_5;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "pywrapfst.pyx":4161
+ /* "pywrapfst.pyx":4173
* 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 '%s'", "_sstrm");
- __PYX_ERR(0, 4161, __pyx_L1_error)
+ __PYX_ERR(0, 4173, __pyx_L1_error)
}
__pyx_v_self->_sstrm.reset(new std::stringstream());
- /* "pywrapfst.pyx":4162
+ /* "pywrapfst.pyx":4174
* 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_PyBytes_string_to_py_std__in_string(__pyx_v_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4162, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4162, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4174, __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 '%s'", "_fst_type");
- __PYX_ERR(0, 4162, __pyx_L1_error)
+ __PYX_ERR(0, 4174, __pyx_L1_error)
}
__pyx_v_self->_fst_type = __pyx_t_2;
- /* "pywrapfst.pyx":4163
+ /* "pywrapfst.pyx":4175
* 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_PyBytes_string_to_py_std__in_string(__pyx_v_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4163, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4163, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4175, __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 '%s'", "_arc_type");
- __PYX_ERR(0, 4163, __pyx_L1_error)
+ __PYX_ERR(0, 4175, __pyx_L1_error)
}
__pyx_v_self->_arc_type = __pyx_t_2;
- /* "pywrapfst.pyx":4164
+ /* "pywrapfst.pyx":4176
* 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 '%s'", "_isymbols");
- __PYX_ERR(0, 4164, __pyx_L1_error)
+ __PYX_ERR(0, 4176, __pyx_L1_error)
}
__pyx_v_self->_isymbols = NULL;
- /* "pywrapfst.pyx":4165
+ /* "pywrapfst.pyx":4177
* 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":4166
+ /* "pywrapfst.pyx":4178
* 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 '%s'", "_table");
- __PYX_ERR(0, 4166, __pyx_L1_error)
+ __PYX_ERR(0, 4178, __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 '%s'", "_isymbols");
- __PYX_ERR(0, 4166, __pyx_L1_error)
+ __PYX_ERR(0, 4178, __pyx_L1_error)
}
__pyx_v_self->_isymbols = __pyx_t_5;
- /* "pywrapfst.pyx":4165
+ /* "pywrapfst.pyx":4177
* self._arc_type = tostring(arc_type)
* self._isymbols = NULL
* if isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4167
+ /* "pywrapfst.pyx":4179
* 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 '%s'", "_osymbols");
- __PYX_ERR(0, 4167, __pyx_L1_error)
+ __PYX_ERR(0, 4179, __pyx_L1_error)
}
__pyx_v_self->_osymbols = NULL;
- /* "pywrapfst.pyx":4168
+ /* "pywrapfst.pyx":4180
* 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":4169
+ /* "pywrapfst.pyx":4181
* 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 '%s'", "_table");
- __PYX_ERR(0, 4169, __pyx_L1_error)
+ __PYX_ERR(0, 4181, __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 '%s'", "_osymbols");
- __PYX_ERR(0, 4169, __pyx_L1_error)
+ __PYX_ERR(0, 4181, __pyx_L1_error)
}
__pyx_v_self->_osymbols = __pyx_t_5;
- /* "pywrapfst.pyx":4168
+ /* "pywrapfst.pyx":4180
* self._isymbols = isymbols._table
* self._osymbols = NULL
* if osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4170
+ /* "pywrapfst.pyx":4182
* 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 '%s'", "_ssymbols");
- __PYX_ERR(0, 4170, __pyx_L1_error)
+ __PYX_ERR(0, 4182, __pyx_L1_error)
}
__pyx_v_self->_ssymbols = NULL;
- /* "pywrapfst.pyx":4171
+ /* "pywrapfst.pyx":4183
* 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":4172
+ /* "pywrapfst.pyx":4184
* 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 '%s'", "_table");
- __PYX_ERR(0, 4172, __pyx_L1_error)
+ __PYX_ERR(0, 4184, __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 '%s'", "_ssymbols");
- __PYX_ERR(0, 4172, __pyx_L1_error)
+ __PYX_ERR(0, 4184, __pyx_L1_error)
}
__pyx_v_self->_ssymbols = __pyx_t_5;
- /* "pywrapfst.pyx":4171
+ /* "pywrapfst.pyx":4183
* self._osymbols = osymbols._table
* self._ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4173
+ /* "pywrapfst.pyx":4185
* 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 '%s'", "_acceptor");
- __PYX_ERR(0, 4173, __pyx_L1_error)
+ __PYX_ERR(0, 4185, __pyx_L1_error)
}
__pyx_v_self->_acceptor = __pyx_v_acceptor;
- /* "pywrapfst.pyx":4174
+ /* "pywrapfst.pyx":4186
* 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 '%s'", "_keep_isymbols");
- __PYX_ERR(0, 4174, __pyx_L1_error)
+ __PYX_ERR(0, 4186, __pyx_L1_error)
}
__pyx_v_self->_keep_isymbols = __pyx_v_keep_isymbols;
- /* "pywrapfst.pyx":4175
+ /* "pywrapfst.pyx":4187
* 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 '%s'", "_keep_osymbols");
- __PYX_ERR(0, 4175, __pyx_L1_error)
+ __PYX_ERR(0, 4187, __pyx_L1_error)
}
__pyx_v_self->_keep_osymbols = __pyx_v_keep_osymbols;
- /* "pywrapfst.pyx":4176
+ /* "pywrapfst.pyx":4188
* 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 '%s'", "_keep_state_numbering");
- __PYX_ERR(0, 4176, __pyx_L1_error)
+ __PYX_ERR(0, 4188, __pyx_L1_error)
}
__pyx_v_self->_keep_state_numbering = __pyx_v_keep_state_numbering;
- /* "pywrapfst.pyx":4177
+ /* "pywrapfst.pyx":4189
* 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 '%s'", "_allow_negative_labels");
- __PYX_ERR(0, 4177, __pyx_L1_error)
+ __PYX_ERR(0, 4189, __pyx_L1_error)
}
__pyx_v_self->_allow_negative_labels = __pyx_v_allow_negative_labels;
- /* "pywrapfst.pyx":4150
+ /* "pywrapfst.pyx":4162
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4179
+/* "pywrapfst.pyx":4191
* self._allow_negative_labels = allow_negative_labels
*
* cpdef _Fst compile(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4179, __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, 4191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_8Compiler_3compile)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4179, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4191, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4179, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4191, __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, 4179, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 4191, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4193
+ /* "pywrapfst.pyx":4205
* FstOpError: Compilation failed.
* """
* cdef fst.FstClass *tfst = fst.CompileFstInternal(deref(self._sstrm), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_sstrm");
- __PYX_ERR(0, 4193, __pyx_L1_error)
+ __PYX_ERR(0, 4205, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4194
+ /* "pywrapfst.pyx":4206
* """
* cdef fst.FstClass *tfst = fst.CompileFstInternal(deref(self._sstrm),
* "<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,
*/
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_pywrapfst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4194, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_pywrapfst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4206, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst_type");
- __PYX_ERR(0, 4194, __pyx_L1_error)
+ __PYX_ERR(0, 4206, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc_type");
- __PYX_ERR(0, 4194, __pyx_L1_error)
+ __PYX_ERR(0, 4206, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_isymbols");
- __PYX_ERR(0, 4194, __pyx_L1_error)
+ __PYX_ERR(0, 4206, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4195
+ /* "pywrapfst.pyx":4207
* cdef fst.FstClass *tfst = fst.CompileFstInternal(deref(self._sstrm),
* "<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 '%s'", "_osymbols");
- __PYX_ERR(0, 4195, __pyx_L1_error)
+ __PYX_ERR(0, 4207, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_ssymbols");
- __PYX_ERR(0, 4195, __pyx_L1_error)
+ __PYX_ERR(0, 4207, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_acceptor");
- __PYX_ERR(0, 4195, __pyx_L1_error)
+ __PYX_ERR(0, 4207, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_keep_isymbols");
- __PYX_ERR(0, 4195, __pyx_L1_error)
+ __PYX_ERR(0, 4207, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4196
+ /* "pywrapfst.pyx":4208
* "<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 '%s'", "_keep_osymbols");
- __PYX_ERR(0, 4196, __pyx_L1_error)
+ __PYX_ERR(0, 4208, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_keep_state_numbering");
- __PYX_ERR(0, 4196, __pyx_L1_error)
+ __PYX_ERR(0, 4208, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4197
+ /* "pywrapfst.pyx":4209
* 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 '%s'", "_allow_negative_labels");
- __PYX_ERR(0, 4197, __pyx_L1_error)
+ __PYX_ERR(0, 4209, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4193
+ /* "pywrapfst.pyx":4205
* FstOpError: Compilation failed.
* """
* cdef fst.FstClass *tfst = fst.CompileFstInternal(deref(self._sstrm), # <<<<<<<<<<<<<<
*/
__pyx_v_tfst = fst::script::CompileFstInternal((*__pyx_v_self->_sstrm), __pyx_t_5, __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":4198
+ /* "pywrapfst.pyx":4210
* 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 '%s'", "_sstrm");
- __PYX_ERR(0, 4198, __pyx_L1_error)
+ __PYX_ERR(0, 4210, __pyx_L1_error)
}
__pyx_v_self->_sstrm.reset(new std::stringstream());
- /* "pywrapfst.pyx":4199
+ /* "pywrapfst.pyx":4211
* self._allow_negative_labels)
* self._sstrm.reset(new stringstream())
* if tfst == NULL: # <<<<<<<<<<<<<<
__pyx_t_6 = ((__pyx_v_tfst == NULL) != 0);
if (__pyx_t_6) {
- /* "pywrapfst.pyx":4200
+ /* "pywrapfst.pyx":4212
* self._sstrm.reset(new stringstream())
* if tfst == NULL:
* raise FstOpError("Compilation failed") # <<<<<<<<<<<<<<
* return _init_XFst(tfst)
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4200, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4212, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4200, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4212, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 4200, __pyx_L1_error)
+ __PYX_ERR(0, 4212, __pyx_L1_error)
- /* "pywrapfst.pyx":4199
+ /* "pywrapfst.pyx":4211
* self._allow_negative_labels)
* self._sstrm.reset(new stringstream())
* if tfst == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4201
+ /* "pywrapfst.pyx":4213
* if tfst == NULL:
* raise FstOpError("Compilation failed")
* return _init_XFst(tfst) # <<<<<<<<<<<<<<
* cpdef void write(self, expression):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4201, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4213, __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":4179
+ /* "pywrapfst.pyx":4191
* 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, 4179, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_8Compiler_compile(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4203
+/* "pywrapfst.pyx":4215
* return _init_XFst(tfst)
*
* cpdef void write(self, expression): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4203, __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, 4215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_8Compiler_5write)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4203, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_expression};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4203, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4215, __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[2] = {__pyx_t_4, __pyx_v_expression};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4203, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4215, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4203, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(__pyx_v_expression);
__Pyx_GIVEREF(__pyx_v_expression);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_expression);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4203, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4219
+ /* "pywrapfst.pyx":4231
* expression: A string expression to add to compiler string buffer.
* """
* deref(self._sstrm) << tostring(expression) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_sstrm");
- __PYX_ERR(0, 4219, __pyx_L1_error)
+ __PYX_ERR(0, 4231, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4219, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4231, __pyx_L1_error)
((*__pyx_v_self->_sstrm) << __pyx_t_6);
- /* "pywrapfst.pyx":4203
+ /* "pywrapfst.pyx":4215
* return _init_XFst(tfst)
*
* 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, 4203, __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, 4215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4244
+/* "pywrapfst.pyx":4256
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":4245
+ /* "pywrapfst.pyx":4257
*
* def __init__(self):
* raise FstDeletedConstructorError( # <<<<<<<<<<<<<<
* "Cannot construct {}".format(self.__class__.__name__))
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4245, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4246
+ /* "pywrapfst.pyx":4258
* def __init__(self):
* raise FstDeletedConstructorError(
* "Cannot construct {}".format(self.__class__.__name__)) # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4246, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4258, __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, 4246, __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, 4258, __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, 4246, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4246, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4258, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4246, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4258, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4246, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4258, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4246, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4246, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4245, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4257, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4245, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4257, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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[2] = {__pyx_t_4, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4245, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4257, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4245, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4245, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__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, 4245, __pyx_L1_error)
+ __PYX_ERR(0, 4257, __pyx_L1_error)
- /* "pywrapfst.pyx":4244
+ /* "pywrapfst.pyx":4256
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4248
+/* "pywrapfst.pyx":4260
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":4249
+ /* "pywrapfst.pyx":4261
*
* 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_s_FarReader_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4249, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_FarReader_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4261, __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 '%s'", "far_type");
- __PYX_ERR(0, 4249, __pyx_L1_error)
+ __PYX_ERR(0, 4261, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_convert_PyBytes_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, 4249, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyBytes_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, 4261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4249, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4249, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
- __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, 4249, __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, 4261, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_t_3, __pyx_t_5};
- __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, 4249, __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, 4261, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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, 4249, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4249, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4261, __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":4248
+ /* "pywrapfst.pyx":4260
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4252
+/* "pywrapfst.pyx":4264
*
* @classmethod
* def open(cls, *filenames): # <<<<<<<<<<<<<<
__Pyx_RefNannySetupContext("open", 0);
__Pyx_INCREF(__pyx_v_filenames);
- /* "pywrapfst.pyx":4270
+ /* "pywrapfst.pyx":4282
* FstIOError: Read failed.
* """
* filenames = [tostring(filename) for filename in filenames] # <<<<<<<<<<<<<<
* cdef fst.FarReaderClass *tfar = fst.FarReaderClass.Open(filenames)
* if tfar == NULL:
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4270, __pyx_L1_error)
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_v_filenames; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
for (;;) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 4270, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 4282, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4270, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_XDECREF_SET(__pyx_v_filename, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4270, __pyx_L1_error)
- __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4270, __pyx_L1_error)
+ __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4282, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4270, __pyx_L1_error)
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4282, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_filenames, __pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":4271
+ /* "pywrapfst.pyx":4283
* """
* filenames = [tostring(filename) for filename in filenames]
* cdef fst.FarReaderClass *tfar = fst.FarReaderClass.Open(filenames) # <<<<<<<<<<<<<<
* if tfar == NULL:
* raise FstIOError("Read failed: {!r}".format(filenames))
*/
- __pyx_t_6 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_v_filenames); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4271, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_v_filenames); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4283, __pyx_L1_error)
__pyx_v_tfar = fst::script::FarReaderClass::Open(__pyx_t_6);
- /* "pywrapfst.pyx":4272
+ /* "pywrapfst.pyx":4284
* filenames = [tostring(filename) for filename in filenames]
* cdef fst.FarReaderClass *tfar = fst.FarReaderClass.Open(filenames)
* if tfar == NULL: # <<<<<<<<<<<<<<
__pyx_t_7 = ((__pyx_v_tfar == NULL) != 0);
if (__pyx_t_7) {
- /* "pywrapfst.pyx":4273
+ /* "pywrapfst.pyx":4285
* cdef fst.FarReaderClass *tfar = fst.FarReaderClass.Open(filenames)
* if tfar == NULL:
* raise FstIOError("Read failed: {!r}".format(filenames)) # <<<<<<<<<<<<<<
* cdef FarReader result = FarReader.__new__(FarReader)
* result._reader.reset(tfar)
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
}
}
if (!__pyx_t_9) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_filenames); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_filenames); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_8)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_filenames};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4285, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_filenames};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4285, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
{
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
__Pyx_INCREF(__pyx_v_filenames);
__Pyx_GIVEREF(__pyx_v_filenames);
PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_filenames);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
}
}
if (!__pyx_t_8) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4285, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4285, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4285, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4273, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__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, 4273, __pyx_L1_error)
+ __PYX_ERR(0, 4285, __pyx_L1_error)
- /* "pywrapfst.pyx":4272
+ /* "pywrapfst.pyx":4284
* filenames = [tostring(filename) for filename in filenames]
* cdef fst.FarReaderClass *tfar = fst.FarReaderClass.Open(filenames)
* if tfar == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4274
+ /* "pywrapfst.pyx":4286
* if tfar == NULL:
* raise FstIOError("Read failed: {!r}".format(filenames))
* cdef FarReader result = FarReader.__new__(FarReader) # <<<<<<<<<<<<<<
* result._reader.reset(tfar)
* return result
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_FarReader(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarReader), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4274, __pyx_L1_error)
+ __pyx_t_1 = __pyx_tp_new_9pywrapfst_FarReader(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarReader), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4286, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_FarReader)))) __PYX_ERR(0, 4274, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_FarReader)))) __PYX_ERR(0, 4286, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":4275
+ /* "pywrapfst.pyx":4287
* raise FstIOError("Read failed: {!r}".format(filenames))
* cdef FarReader result = FarReader.__new__(FarReader)
* result._reader.reset(tfar) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
- __PYX_ERR(0, 4275, __pyx_L1_error)
+ __PYX_ERR(0, 4287, __pyx_L1_error)
}
__pyx_v_result->_reader.reset(__pyx_v_tfar);
- /* "pywrapfst.pyx":4276
+ /* "pywrapfst.pyx":4288
* cdef FarReader result = FarReader.__new__(FarReader)
* result._reader.reset(tfar)
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":4252
+ /* "pywrapfst.pyx":4264
*
* @classmethod
* def open(cls, *filenames): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4279
+/* "pywrapfst.pyx":4291
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":4280
+ /* "pywrapfst.pyx":4292
* # 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":4279
+ /* "pywrapfst.pyx":4291
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4283
+/* "pywrapfst.pyx":4295
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "pywrapfst.pyx":4284
+ /* "pywrapfst.pyx":4296
* # 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 '%s'", "done");
- __PYX_ERR(0, 4284, __pyx_L1_error)
+ __PYX_ERR(0, 4296, __pyx_L1_error)
}
__pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":4285
+ /* "pywrapfst.pyx":4297
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* cdef _MutableFst f = self.get_fst()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 4285, __pyx_L1_error)
+ __PYX_ERR(0, 4297, __pyx_L1_error)
- /* "pywrapfst.pyx":4284
+ /* "pywrapfst.pyx":4296
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4286
+ /* "pywrapfst.pyx":4298
* if self.done():
* raise StopIteration
* cdef string k = self.get_key() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get_key");
- __PYX_ERR(0, 4286, __pyx_L1_error)
+ __PYX_ERR(0, 4298, __pyx_L1_error)
}
__pyx_v_k = ((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_key(__pyx_v_self, 0);
- /* "pywrapfst.pyx":4287
+ /* "pywrapfst.pyx":4299
* raise StopIteration
* cdef string k = self.get_key()
* cdef _MutableFst f = self.get_fst() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get_fst");
- __PYX_ERR(0, 4287, __pyx_L1_error)
+ __PYX_ERR(0, 4299, __pyx_L1_error)
}
- __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_fst(__pyx_v_self, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4287, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_fst(__pyx_v_self, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4299, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__MutableFst))))) __PYX_ERR(0, 4287, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__MutableFst))))) __PYX_ERR(0, 4299, __pyx_L1_error)
__pyx_v_f = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":4288
+ /* "pywrapfst.pyx":4300
* cdef string k = self.get_key()
* cdef _MutableFst f = self.get_fst()
* self.next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "next");
- __PYX_ERR(0, 4288, __pyx_L1_error)
+ __PYX_ERR(0, 4300, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":4289
+ /* "pywrapfst.pyx":4301
* cdef _MutableFst f = self.get_fst()
* self.next()
* return (k, f) # <<<<<<<<<<<<<<
* cpdef string arc_type(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4289, __pyx_L1_error)
+ __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4301, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4289, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4301, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4283
+ /* "pywrapfst.pyx":4295
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4291
+/* "pywrapfst.pyx":4303
* return (k, f)
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4291, __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, 4303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_11arc_type)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4291, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4303, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4291, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4303, __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, 4291, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4303, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4292
+ /* "pywrapfst.pyx":4304
*
* cpdef string arc_type(self):
* return self._reader.get().ArcType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
- __PYX_ERR(0, 4292, __pyx_L1_error)
+ __PYX_ERR(0, 4304, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":4291
+ /* "pywrapfst.pyx":4303
* return (k, f)
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("arc_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4291, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4294
+/* "pywrapfst.pyx":4306
* return self._reader.get().ArcType()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4294, __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, 4306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_13done)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4294, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4306, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4294, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4306, __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, 4294, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4306, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4306
+ /* "pywrapfst.pyx":4318
* 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 '%s'", "_reader");
- __PYX_ERR(0, 4306, __pyx_L1_error)
+ __PYX_ERR(0, 4318, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":4294
+ /* "pywrapfst.pyx":4306
* 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, 4294, __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, 4306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4308
+/* "pywrapfst.pyx":4320
* return self._reader.get().Done()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4308, __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, 4320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_15error)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4308, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4320, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4308, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4320, __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, 4308, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4320, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4317
+ /* "pywrapfst.pyx":4329
* 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 '%s'", "_reader");
- __PYX_ERR(0, 4317, __pyx_L1_error)
+ __PYX_ERR(0, 4329, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->Error();
goto __pyx_L0;
- /* "pywrapfst.pyx":4308
+ /* "pywrapfst.pyx":4320
* 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, 4308, __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, 4320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4319
+/* "pywrapfst.pyx":4331
* return self._reader.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4319, __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, 4331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_17far_type)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4319, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4331, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4319, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4331, __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, 4319, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4331, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4320
+ /* "pywrapfst.pyx":4332
*
* 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 '%s'", "_reader");
- __PYX_ERR(0, 4320, __pyx_L1_error)
+ __PYX_ERR(0, 4332, __pyx_L1_error)
}
__pyx_r = fst::GetFarTypeString(__pyx_v_self->_reader.get()->Type());
goto __pyx_L0;
- /* "pywrapfst.pyx":4319
+ /* "pywrapfst.pyx":4331
* 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_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4319, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4322
+/* "pywrapfst.pyx":4334
* return fst.GetFarTypeString(self._reader.get().Type())
*
* cpdef bool find(self, key): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4322, __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, 4334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_19find)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4322, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4322, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4334, __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[2] = {__pyx_t_4, __pyx_v_key};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4322, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4334, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4322, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(__pyx_v_key);
__Pyx_GIVEREF(__pyx_v_key);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4322, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4322, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4334, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_6;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4338
+ /* "pywrapfst.pyx":4350
* 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 '%s'", "_reader");
- __PYX_ERR(0, 4338, __pyx_L1_error)
+ __PYX_ERR(0, 4350, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4338, __pyx_L1_error)
+ __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4350, __pyx_L1_error)
__pyx_r = __pyx_v_self->_reader.get()->Find(__pyx_t_7);
goto __pyx_L0;
- /* "pywrapfst.pyx":4322
+ /* "pywrapfst.pyx":4334
* return fst.GetFarTypeString(self._reader.get().Type())
*
* cpdef bool find(self, key): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("find", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarReader_find(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4322, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarReader_find(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4340
+/* "pywrapfst.pyx":4352
* return self._reader.get().Find(tostring(key))
*
* cpdef _Fst get_fst(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4340, __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, 4352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_21get_fst)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4340, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4352, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4340, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4352, __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, 4340, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 4352, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4353
+ /* "pywrapfst.pyx":4365
* """
* cdef fst.FstClass *tfst = 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 '%s'", "_reader");
- __PYX_ERR(0, 4353, __pyx_L1_error)
+ __PYX_ERR(0, 4365, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4352
+ /* "pywrapfst.pyx":4364
* A copy of the FST at the current position.
* """
* cdef fst.FstClass *tfst = new fst.FstClass( # <<<<<<<<<<<<<<
*/
__pyx_v_tfst = new fst::script::FstClass((*__pyx_v_self->_reader.get()->GetFstClass()));
- /* "pywrapfst.pyx":4354
+ /* "pywrapfst.pyx":4366
* cdef fst.FstClass *tfst = new fst.FstClass(
* deref(self._reader.get().GetFstClass()))
* return _init_XFst(tfst) # <<<<<<<<<<<<<<
* cpdef string get_key(self):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4354, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4366, __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":4340
+ /* "pywrapfst.pyx":4352
* 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, 4340, __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, 4352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4356
+/* "pywrapfst.pyx":4368
* return _init_XFst(tfst)
*
* cpdef string get_key(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4356, __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, 4368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_23get_key)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4356, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4368, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4356, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4368, __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, 4356, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4368, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4368
+ /* "pywrapfst.pyx":4380
* 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 '%s'", "_reader");
- __PYX_ERR(0, 4368, __pyx_L1_error)
+ __PYX_ERR(0, 4380, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->GetKey();
goto __pyx_L0;
- /* "pywrapfst.pyx":4356
+ /* "pywrapfst.pyx":4368
* return _init_XFst(tfst)
*
* cpdef string get_key(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("get_key", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_get_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4356, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_get_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4370
+/* "pywrapfst.pyx":4382
* return self._reader.get().GetKey()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4370, __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, 4382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_25next)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4370, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4382, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4370, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4382, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4379
+ /* "pywrapfst.pyx":4391
* should use the Pythonic API.
* """
* self._reader.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
- __PYX_ERR(0, 4379, __pyx_L1_error)
+ __PYX_ERR(0, 4391, __pyx_L1_error)
}
__pyx_v_self->_reader.get()->Next();
- /* "pywrapfst.pyx":4370
+ /* "pywrapfst.pyx":4382
* 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, 4370, __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, 4382, __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":4393
* self._reader.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __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, 4393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_27reset)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4381, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4393, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4381, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4393, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4390
+ /* "pywrapfst.pyx":4402
* should use the Pythonic API.
* """
* self._reader.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
- __PYX_ERR(0, 4390, __pyx_L1_error)
+ __PYX_ERR(0, 4402, __pyx_L1_error)
}
__pyx_v_self->_reader.get()->Reset();
- /* "pywrapfst.pyx":4381
+ /* "pywrapfst.pyx":4393
* 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, 4393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4393
+/* "pywrapfst.pyx":4405
*
* # Dictionary-like access by combining `find` and `get_fst`.
* def __getitem__(self, key): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "pywrapfst.pyx":4394
+ /* "pywrapfst.pyx":4406
* # Dictionary-like access by combining `find` and `get_fst`.
* def __getitem__(self, key):
* if not self.find(key): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "find");
- __PYX_ERR(0, 4394, __pyx_L1_error)
+ __PYX_ERR(0, 4406, __pyx_L1_error)
}
__pyx_t_1 = ((!(((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->find(__pyx_v_self, __pyx_v_key, 0) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":4395
+ /* "pywrapfst.pyx":4407
* def __getitem__(self, key):
* if not self.find(key):
* raise KeyError(key) # <<<<<<<<<<<<<<
* return self.get_fst()
*
*/
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4395, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_key);
__Pyx_GIVEREF(__pyx_v_key);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4395, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 4395, __pyx_L1_error)
+ __PYX_ERR(0, 4407, __pyx_L1_error)
- /* "pywrapfst.pyx":4394
+ /* "pywrapfst.pyx":4406
* # Dictionary-like access by combining `find` and `get_fst`.
* def __getitem__(self, key):
* if not self.find(key): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4396
+ /* "pywrapfst.pyx":4408
* if not self.find(key):
* raise KeyError(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 '%s'", "get_fst");
- __PYX_ERR(0, 4396, __pyx_L1_error)
+ __PYX_ERR(0, 4408, __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, 4396, __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, 4408, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4393
+ /* "pywrapfst.pyx":4405
*
* # Dictionary-like access by combining `find` and `get_fst`.
* def __getitem__(self, key): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4419
+/* "pywrapfst.pyx":4431
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":4420
+ /* "pywrapfst.pyx":4432
*
* def __init__(self):
* raise FstDeletedConstructorError( # <<<<<<<<<<<<<<
* "Cannot construct {}".format(self.__class__.__name__))
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4420, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4421
+ /* "pywrapfst.pyx":4433
* def __init__(self):
* raise FstDeletedConstructorError(
* "Cannot construct {}".format(self.__class__.__name__)) # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4433, __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, 4421, __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, 4433, __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, 4421, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4433, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
}
}
if (!__pyx_t_5) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4433, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4433, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4433, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4433, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4421, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4433, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4420, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4432, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4420, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4432, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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[2] = {__pyx_t_4, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4420, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4432, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4420, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4420, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__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, 4420, __pyx_L1_error)
+ __PYX_ERR(0, 4432, __pyx_L1_error)
- /* "pywrapfst.pyx":4419
+ /* "pywrapfst.pyx":4431
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4423
+/* "pywrapfst.pyx":4435
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":4424
+ /* "pywrapfst.pyx":4436
*
* 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_s_FarWriter_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4424, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_FarWriter_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4436, __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 '%s'", "far_type");
- __PYX_ERR(0, 4424, __pyx_L1_error)
+ __PYX_ERR(0, 4436, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_convert_PyBytes_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, 4424, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyBytes_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, 4436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4424, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4424, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
- __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, 4424, __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, 4436, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_t_3, __pyx_t_5};
- __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, 4424, __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, 4436, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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, 4424, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4424, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4436, __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":4423
+ /* "pywrapfst.pyx":4435
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4427
+/* "pywrapfst.pyx":4439
*
* @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, 4427, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 4439, __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, 4427, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4439, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.FarWriter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_t_9 = NULL;
__Pyx_RefNannySetupContext("create", 0);
- /* "pywrapfst.pyx":4448
+ /* "pywrapfst.pyx":4460
* 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, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4448, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_far_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4460, __pyx_L1_error)
__pyx_v_ft = fst::script::GetFarType(__pyx_t_1);
- /* "pywrapfst.pyx":4450
+ /* "pywrapfst.pyx":4462
* 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, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4450, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4450, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4462, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4462, __pyx_L1_error)
- /* "pywrapfst.pyx":4449
+ /* "pywrapfst.pyx":4461
* """
* 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":4451
+ /* "pywrapfst.pyx":4463
* 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 (__pyx_t_3) {
- /* "pywrapfst.pyx":4452
+ /* "pywrapfst.pyx":4464
* 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_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4452, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Open_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4452, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Open_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
}
}
if (!__pyx_t_8) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_filename); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4452, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_filename); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_filename};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4452, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_filename};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4452, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
{
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4452, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
__Pyx_INCREF(__pyx_v_filename);
__Pyx_GIVEREF(__pyx_v_filename);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_filename);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4452, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
}
}
if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4452, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4452, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4452, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4452, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4452, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
__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, 4452, __pyx_L1_error)
+ __PYX_ERR(0, 4464, __pyx_L1_error)
- /* "pywrapfst.pyx":4451
+ /* "pywrapfst.pyx":4463
* cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
* tostring(filename), tostring(arc_type), ft)
* if tfar == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4453
+ /* "pywrapfst.pyx":4465
* 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 = __pyx_tp_new_9pywrapfst_FarWriter(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarWriter), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4453, __pyx_L1_error)
+ __pyx_t_4 = __pyx_tp_new_9pywrapfst_FarWriter(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarWriter), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst_FarWriter)))) __PYX_ERR(0, 4453, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst_FarWriter)))) __PYX_ERR(0, 4465, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "pywrapfst.pyx":4454
+ /* "pywrapfst.pyx":4466
* 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 '%s'", "_writer");
- __PYX_ERR(0, 4454, __pyx_L1_error)
+ __PYX_ERR(0, 4466, __pyx_L1_error)
}
__pyx_v_result->_writer.reset(__pyx_v_tfar);
- /* "pywrapfst.pyx":4455
+ /* "pywrapfst.pyx":4467
* cdef FarWriter result = FarWriter.__new__(FarWriter)
* result._writer.reset(tfar)
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":4427
+ /* "pywrapfst.pyx":4439
*
* @classmethod
* def create(cls, filename, arc_type=b"standard", far_type=b"default"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4459
+/* "pywrapfst.pyx":4471
* # NB: Invoking this method is 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":4460
+ /* "pywrapfst.pyx":4472
* # 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 '%s'", "_writer");
- __PYX_ERR(0, 4460, __pyx_L1_error)
+ __PYX_ERR(0, 4472, __pyx_L1_error)
}
__pyx_v_self->_writer.reset();
- /* "pywrapfst.pyx":4459
+ /* "pywrapfst.pyx":4471
* # NB: Invoking this method is 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":4462
+/* "pywrapfst.pyx":4474
* self._writer.reset()
*
* cpdef void add(self, key, _Fst ifst) except *: # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4462, __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, 4474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__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, 4462, __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, 4474, __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, 4462, __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, 4474, __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, 4462, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4474, __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, 4462, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4484
+ /* "pywrapfst.pyx":4496
* # 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 '%s'", "_writer");
- __PYX_ERR(0, 4484, __pyx_L1_error)
+ __PYX_ERR(0, 4496, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4484, __pyx_L1_error)
+ __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4496, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 4484, __pyx_L1_error)
+ __PYX_ERR(0, 4496, __pyx_L1_error)
}
__pyx_t_8 = ((!(__pyx_v_self->_writer.get()->Add(__pyx_t_7, (*__pyx_v_ifst->_fst)) != 0)) != 0);
if (__pyx_t_8) {
- /* "pywrapfst.pyx":4485
+ /* "pywrapfst.pyx":4497
* # 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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4485, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4485, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 4485, __pyx_L1_error)
+ __PYX_ERR(0, 4497, __pyx_L1_error)
- /* "pywrapfst.pyx":4484
+ /* "pywrapfst.pyx":4496
* # 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":4487
+ /* "pywrapfst.pyx":4499
* 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 '%s'", "_writer");
- __PYX_ERR(0, 4487, __pyx_L1_error)
+ __PYX_ERR(0, 4499, __pyx_L1_error)
}
__pyx_t_8 = (__pyx_v_self->_writer.get()->Error() != 0);
if (__pyx_t_8) {
- /* "pywrapfst.pyx":4488
+ /* "pywrapfst.pyx":4500
* # 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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4488, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4500, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4488, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4500, __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, 4488, __pyx_L1_error)
+ __PYX_ERR(0, 4500, __pyx_L1_error)
- /* "pywrapfst.pyx":4487
+ /* "pywrapfst.pyx":4499
* raise FstOpError("Incompatible or invalid arc type")
* # An error here usually indicates a key out of order.
* if self._writer.get().Error(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4462
+ /* "pywrapfst.pyx":4474
* self._writer.reset()
*
* cpdef void add(self, key, _Fst ifst) except *: # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 4462, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 4474, __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, 4462, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 4474, __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, 4462, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4474, __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, 4462, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4474, __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, 4462, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4462, __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, 4474, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4490
+/* "pywrapfst.pyx":4502
* raise FstArgError("Key out of order")
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4490, __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, 4502, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_9arc_type)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4490, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4502, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4490, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4502, __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, 4490, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4502, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4491
+ /* "pywrapfst.pyx":4503
*
* cpdef string arc_type(self):
* return self._writer.get().ArcType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_writer");
- __PYX_ERR(0, 4491, __pyx_L1_error)
+ __PYX_ERR(0, 4503, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_writer.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":4490
+ /* "pywrapfst.pyx":4502
* 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_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4490, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4502, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4493
+/* "pywrapfst.pyx":4505
* return self._writer.get().ArcType()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4493, __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, 4505, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_11error)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4493, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4505, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4493, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4505, __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, 4493, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4505, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4502
+ /* "pywrapfst.pyx":4514
* 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 '%s'", "_writer");
- __PYX_ERR(0, 4502, __pyx_L1_error)
+ __PYX_ERR(0, 4514, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_writer.get()->Error();
goto __pyx_L0;
- /* "pywrapfst.pyx":4493
+ /* "pywrapfst.pyx":4505
* 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, 4493, __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, 4505, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4504
+/* "pywrapfst.pyx":4516
* return self._writer.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4504, __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, 4516, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_13far_type)) {
__Pyx_INCREF(__pyx_t_1);
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4504, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4516, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4504, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4516, __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, 4504, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4516, __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":4505
+ /* "pywrapfst.pyx":4517
*
* cpdef string far_type(self):
* return fst.GetFarTypeString(self._writer.get().Type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_writer");
- __PYX_ERR(0, 4505, __pyx_L1_error)
+ __PYX_ERR(0, 4517, __pyx_L1_error)
}
__pyx_r = fst::GetFarTypeString(__pyx_v_self->_writer.get()->Type());
goto __pyx_L0;
- /* "pywrapfst.pyx":4504
+ /* "pywrapfst.pyx":4516
* 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_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4504, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4516, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4508
+/* "pywrapfst.pyx":4520
*
* # 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, 4508, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst), __pyx_ptype_9pywrapfst__Fst, 1, "fst", 0))) __PYX_ERR(0, 4520, __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":4509
+ /* "pywrapfst.pyx":4521
* # 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 '%s'", "add");
- __PYX_ERR(0, 4509, __pyx_L1_error)
+ __PYX_ERR(0, 4521, __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, 4509, __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, 4521, __pyx_L1_error)
- /* "pywrapfst.pyx":4508
+ /* "pywrapfst.pyx":4520
*
* # Dictionary-like assignment.
* def __setitem__(self, key, _Fst fst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4524
+/* "pywrapfst.pyx":4536
*
* @atexit.register
* def _reset_fst_error_fatal(): # <<<<<<<<<<<<<<
bool __pyx_t_2;
__Pyx_RefNannySetupContext("_reset_fst_error_fatal", 0);
- /* "pywrapfst.pyx":4525
+ /* "pywrapfst.pyx":4537
* @atexit.register
* def _reset_fst_error_fatal():
* fst.FLAGS_fst_error_fatal = _fst_error_fatal_old # <<<<<<<<<<<<<<
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_fst_error_fatal_old); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4525, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_fst_error_fatal_old); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4537, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4525, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4537, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
FLAGS_fst_error_fatal = __pyx_t_2;
- /* "pywrapfst.pyx":4524
+ /* "pywrapfst.pyx":4536
*
* @atexit.register
* def _reset_fst_error_fatal(): # <<<<<<<<<<<<<<
{&__pyx_n_b_auto, __pyx_k_auto, sizeof(__pyx_k_auto), 0, 0, 0, 1},
{&__pyx_n_s_available_key, __pyx_k_available_key, sizeof(__pyx_k_available_key), 0, 0, 1, 1},
{&__pyx_n_s_call_arc_labeling, __pyx_k_call_arc_labeling, sizeof(__pyx_k_call_arc_labeling), 0, 0, 1, 1},
- {&__pyx_n_s_cf, __pyx_k_cf, sizeof(__pyx_k_cf), 0, 0, 1, 1},
{&__pyx_n_s_checksum, __pyx_k_checksum, sizeof(__pyx_k_checksum), 0, 0, 1, 1},
{&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
{&__pyx_n_s_closure_plus, __pyx_k_closure_plus, sizeof(__pyx_k_closure_plus), 0, 0, 1, 1},
{&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
{&__pyx_n_s_communicate, __pyx_k_communicate, sizeof(__pyx_k_communicate), 0, 0, 1, 1},
{&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
+ {&__pyx_n_s_compose_filter, __pyx_k_compose_filter, sizeof(__pyx_k_compose_filter), 0, 0, 1, 1},
{&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1},
{&__pyx_kp_s_const_EncodeMapper_SymbolTable, __pyx_k_const_EncodeMapper_SymbolTable, sizeof(__pyx_k_const_EncodeMapper_SymbolTable), 0, 0, 1, 0},
{&__pyx_kp_s_const_Fst_SymbolTable_r_at_0x_x, __pyx_k_const_Fst_SymbolTable_r_at_0x_x, sizeof(__pyx_k_const_Fst_SymbolTable_r_at_0x_x), 0, 0, 1, 0},
{&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
{&__pyx_n_b_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 0, 1},
{&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 0, 0, 1, 1},
+ {&__pyx_n_s_det_type, __pyx_k_det_type, sizeof(__pyx_k_det_type), 0, 0, 1, 1},
{&__pyx_n_s_distance, __pyx_k_distance, sizeof(__pyx_k_distance), 0, 0, 1, 1},
{&__pyx_n_s_divide, __pyx_k_divide, sizeof(__pyx_k_divide), 0, 0, 1, 1},
{&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
{&__pyx_n_s_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 0, 1, 1},
{&__pyx_n_s_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 0, 0, 1, 1},
{&__pyx_n_s_draw, __pyx_k_draw, sizeof(__pyx_k_draw), 0, 0, 1, 1},
- {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
{&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
{&__pyx_n_s_encode_labels, __pyx_k_encode_labels, sizeof(__pyx_k_encode_labels), 0, 0, 1, 1},
{&__pyx_n_s_encode_weights, __pyx_k_encode_weights, sizeof(__pyx_k_encode_weights), 0, 0, 1, 1},
{&__pyx_n_s_lhs, __pyx_k_lhs, sizeof(__pyx_k_lhs), 0, 0, 1, 1},
{&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
{&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_map_type, __pyx_k_map_type, sizeof(__pyx_k_map_type), 0, 0, 1, 1},
{&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
{&__pyx_n_s_max_length, __pyx_k_max_length, sizeof(__pyx_k_max_length), 0, 0, 1, 1},
{&__pyx_n_s_member, __pyx_k_member, sizeof(__pyx_k_member), 0, 0, 1, 1},
{&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
{&__pyx_n_s_missing_sym, __pyx_k_missing_sym, sizeof(__pyx_k_missing_sym), 0, 0, 1, 1},
{&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
- {&__pyx_n_s_mt, __pyx_k_mt, sizeof(__pyx_k_mt), 0, 0, 1, 1},
{&__pyx_n_s_mutable_arcs, __pyx_k_mutable_arcs, sizeof(__pyx_k_mutable_arcs), 0, 0, 1, 1},
{&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
{&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
{&__pyx_kp_b_pywrapfst, __pyx_k_pywrapfst, sizeof(__pyx_k_pywrapfst), 0, 0, 0, 0},
{&__pyx_n_s_pywrapfst_2, __pyx_k_pywrapfst_2, sizeof(__pyx_k_pywrapfst_2), 0, 0, 1, 1},
{&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
- {&__pyx_n_s_qt, __pyx_k_qt, sizeof(__pyx_k_qt), 0, 0, 1, 1},
{&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
+ {&__pyx_n_s_queue_type, __pyx_k_queue_type, sizeof(__pyx_k_queue_type), 0, 0, 1, 1},
{&__pyx_n_s_ranksep, __pyx_k_ranksep, sizeof(__pyx_k_ranksep), 0, 0, 1, 1},
{&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
{&__pyx_n_s_read_from_string, __pyx_k_read_from_string, sizeof(__pyx_k_read_from_string), 0, 0, 1, 1},
{&__pyx_n_s_set_value, __pyx_k_set_value, sizeof(__pyx_k_set_value), 0, 0, 1, 1},
{&__pyx_n_s_shortestdistance, __pyx_k_shortestdistance, sizeof(__pyx_k_shortestdistance), 0, 0, 1, 1},
{&__pyx_n_s_show_weight_one, __pyx_k_show_weight_one, sizeof(__pyx_k_show_weight_one), 0, 0, 1, 1},
+ {&__pyx_n_s_sort_type, __pyx_k_sort_type, sizeof(__pyx_k_sort_type), 0, 0, 1, 1},
{&__pyx_n_s_ssymbols, __pyx_k_ssymbols, sizeof(__pyx_k_ssymbols), 0, 0, 1, 1},
- {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1},
{&__pyx_n_b_standard, __pyx_k_standard, sizeof(__pyx_k_standard), 0, 0, 0, 1},
{&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
{&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
__pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 131, __pyx_L1_error)
__pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 136, __pyx_L1_error)
__pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 141, __pyx_L1_error)
- __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 2667, __pyx_L1_error)
- __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 2687, __pyx_L1_error)
- __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 366, __pyx_L1_error)
- __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 430, __pyx_L1_error)
- __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 722, __pyx_L1_error)
- __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 1141, __pyx_L1_error)
+ __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 2671, __pyx_L1_error)
+ __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 2691, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 370, __pyx_L1_error)
+ __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 434, __pyx_L1_error)
+ __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 726, __pyx_L1_error)
+ __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 1145, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "pywrapfst.pyx":1386
+ /* "pywrapfst.pyx":1390
* if proc.returncode != 0: # Just to be explicit.
* raise subprocess.CalledProcessError(proc.returncode, self._DOT_TSVG)
* return sout.decode("utf8") # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 1386, __pyx_L1_error)
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 1390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
- /* "pywrapfst.pyx":1545
+ /* "pywrapfst.pyx":1549
* cdef size_t result = self._fst.get().NumArcs(state)
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 1545, __pyx_L1_error)
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 1549, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "pywrapfst.pyx":1567
+ /* "pywrapfst.pyx":1571
* cdef size_t result = self._fst.get().NumInputEpsilons(state)
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 1567, __pyx_L1_error)
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 1571, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "pywrapfst.pyx":1589
+ /* "pywrapfst.pyx":1593
* cdef size_t result = self._fst.get().NumOutputEpsilons(state)
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 1589, __pyx_L1_error)
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 1593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "pywrapfst.pyx":1730
+ /* "pywrapfst.pyx":1734
* """
* if self._fst.get().Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed") # <<<<<<<<<<<<<<
*
* cdef void _add_arc(self, int64 state, Arc arc) except *:
*/
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1730, __pyx_L1_error)
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1734, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__6);
__Pyx_GIVEREF(__pyx_tuple__6);
- /* "pywrapfst.pyx":1734
+ /* "pywrapfst.pyx":1738
* cdef void _add_arc(self, int64 state, Arc arc) except *:
* if not self._fst.get().ValidStateId(state):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* if not self._mfst.get().AddArc(state, deref(arc._arc)):
* raise FstOpError("Incompatible or invalid weight type")
*/
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1734, __pyx_L1_error)
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1738, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__7);
__Pyx_GIVEREF(__pyx_tuple__7);
- /* "pywrapfst.pyx":1736
+ /* "pywrapfst.pyx":1740
* raise FstIndexError("State index out of range")
* if not self._mfst.get().AddArc(state, deref(arc._arc)):
* raise FstOpError("Incompatible or invalid weight type") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight_t); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1736, __pyx_L1_error)
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight_t); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
- /* "pywrapfst.pyx":1901
+ /* "pywrapfst.pyx":1905
* 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_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1901, __pyx_L1_error)
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1905, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__9);
__Pyx_GIVEREF(__pyx_tuple__9);
- /* "pywrapfst.pyx":1931
+ /* "pywrapfst.pyx":1935
* 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_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1931, __pyx_L1_error)
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1935, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__10);
__Pyx_GIVEREF(__pyx_tuple__10);
- /* "pywrapfst.pyx":2186
+ /* "pywrapfst.pyx":2190
* _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_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_No_relabeling_pairs_specified); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 2186, __pyx_L1_error)
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_No_relabeling_pairs_specified); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 2190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__19);
__Pyx_GIVEREF(__pyx_tuple__19);
- /* "pywrapfst.pyx":2225
+ /* "pywrapfst.pyx":2229
* 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_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_No_new_SymbolTables_specified); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 2225, __pyx_L1_error)
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_No_new_SymbolTables_specified); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 2229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__20);
__Pyx_GIVEREF(__pyx_tuple__20);
- /* "pywrapfst.pyx":2293
+ /* "pywrapfst.pyx":2297
* 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_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 2293, __pyx_L1_error)
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 2297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__21);
__Pyx_GIVEREF(__pyx_tuple__21);
- /* "pywrapfst.pyx":2416
+ /* "pywrapfst.pyx":2420
* 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_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 2416, __pyx_L1_error)
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 2420, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__26);
__Pyx_GIVEREF(__pyx_tuple__26);
- /* "pywrapfst.pyx":2420
+ /* "pywrapfst.pyx":2424
* weight)
* if not self._mfst.get().SetFinal(state, wc):
* raise FstOpError("Incompatible or invalid weight") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 2420, __pyx_L1_error)
+ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 2424, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__27);
__Pyx_GIVEREF(__pyx_tuple__27);
- /* "pywrapfst.pyx":2465
+ /* "pywrapfst.pyx":2469
* 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_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 2465, __pyx_L1_error)
+ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 2469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__28);
__Pyx_GIVEREF(__pyx_tuple__28);
- /* "pywrapfst.pyx":2543
+ /* "pywrapfst.pyx":2547
* # 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_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Cannot_topsort_cyclic_FST); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 2543, __pyx_L1_error)
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Cannot_topsort_cyclic_FST); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 2547, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__29);
__Pyx_GIVEREF(__pyx_tuple__29);
- /* "pywrapfst.pyx":2612
+ /* "pywrapfst.pyx":2616
* cdef _Fst _init_Fst(FstClass_ptr tfst):
* if tfst.Properties(fst.kError, True):
* raise FstOpError("Operation failed") # <<<<<<<<<<<<<<
* cdef _Fst ofst = _Fst.__new__(_Fst)
* ofst._fst.reset(<FstClass_ptr> tfst)
*/
- __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 2612, __pyx_L1_error)
+ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 2616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__30);
__Pyx_GIVEREF(__pyx_tuple__30);
- /* "pywrapfst.pyx":2620
+ /* "pywrapfst.pyx":2624
* cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
* if tfst.Properties(fst.kError, True):
* raise FstOpError("Operation failed") # <<<<<<<<<<<<<<
* cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
* ofst._fst.reset(<MutableFstClass_ptr> tfst)
*/
- __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2620, __pyx_L1_error)
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2624, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__31);
__Pyx_GIVEREF(__pyx_tuple__31);
- /* "pywrapfst.pyx":2878
+ /* "pywrapfst.pyx":2882
* 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_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2878, __pyx_L1_error)
+ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2882, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__32);
__Pyx_GIVEREF(__pyx_tuple__32);
- /* "pywrapfst.pyx":3016
+ /* "pywrapfst.pyx":3020
* 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_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 3016, __pyx_L1_error)
+ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 3020, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__33);
__Pyx_GIVEREF(__pyx_tuple__33);
- /* "pywrapfst.pyx":3558
+ /* "pywrapfst.pyx":3566
* addr(error))
* if error:
* raise FstOpError("Equivalence test encountered error") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Equivalence_test_encountered_err); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 3558, __pyx_L1_error)
+ __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Equivalence_test_encountered_err); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 3566, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__42);
__Pyx_GIVEREF(__pyx_tuple__42);
- /* "pywrapfst.pyx":3753
+ /* "pywrapfst.pyx":3762
* addr(error))
* if error:
* raise FstOpError("Random equivalence test encountered error") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Random_equivalence_test_encounte); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3753, __pyx_L1_error)
+ __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Random_equivalence_test_encounte); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3762, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__49);
__Pyx_GIVEREF(__pyx_tuple__49);
- /* "pywrapfst.pyx":4200
+ /* "pywrapfst.pyx":4212
* self._sstrm.reset(new stringstream())
* if tfst == NULL:
* raise FstOpError("Compilation failed") # <<<<<<<<<<<<<<
* return _init_XFst(tfst)
*
*/
- __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_Compilation_failed); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 4200, __pyx_L1_error)
+ __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_Compilation_failed); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 4212, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__61);
__Pyx_GIVEREF(__pyx_tuple__61);
- /* "pywrapfst.pyx":4485
+ /* "pywrapfst.pyx":4497
* # 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_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_arc_type); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 4485, __pyx_L1_error)
+ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_arc_type); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 4497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__62);
__Pyx_GIVEREF(__pyx_tuple__62);
- /* "pywrapfst.pyx":4488
+ /* "pywrapfst.pyx":4500
* # 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_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Key_out_of_order); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 4488, __pyx_L1_error)
+ __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Key_out_of_order); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 4500, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__63);
__Pyx_GIVEREF(__pyx_tuple__63);
- /* "pywrapfst.pyx":446
+ /* "pywrapfst.pyx":450
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* plus(lhs, rhs)
*/
- __pyx_tuple__64 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 446, __pyx_L1_error)
+ __pyx_tuple__64 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 450, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__64);
__Pyx_GIVEREF(__pyx_tuple__64);
- __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_plus, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 446, __pyx_L1_error)
+ __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_plus, 450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 450, __pyx_L1_error)
- /* "pywrapfst.pyx":478
+ /* "pywrapfst.pyx":482
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* times(lhs, rhs)
*/
- __pyx_tuple__66 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 478, __pyx_L1_error)
+ __pyx_tuple__66 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__66);
__Pyx_GIVEREF(__pyx_tuple__66);
- __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_times, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 478, __pyx_L1_error)
+ __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_times, 482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 482, __pyx_L1_error)
- /* "pywrapfst.pyx":510
+ /* "pywrapfst.pyx":514
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* divide(lhs, rhs)
*/
- __pyx_tuple__68 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 510, __pyx_L1_error)
+ __pyx_tuple__68 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__68);
__Pyx_GIVEREF(__pyx_tuple__68);
- __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_divide, 510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 510, __pyx_L1_error)
+ __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_divide, 514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 514, __pyx_L1_error)
- /* "pywrapfst.pyx":543
+ /* "pywrapfst.pyx":547
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
* """
* times(lhs, rhs)
*/
- __pyx_tuple__70 = PyTuple_Pack(3, __pyx_n_s_w, __pyx_n_s_n, __pyx_n_s_result); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 543, __pyx_L1_error)
+ __pyx_tuple__70 = PyTuple_Pack(3, __pyx_n_s_w, __pyx_n_s_n, __pyx_n_s_result); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 547, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__70);
__Pyx_GIVEREF(__pyx_tuple__70);
- __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_power, 543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 543, __pyx_L1_error)
+ __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_power, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 547, __pyx_L1_error)
- /* "pywrapfst.pyx":2684
+ /* "pywrapfst.pyx":2688
* """
*
* def __new__(cls, arc_type=b"standard"): # <<<<<<<<<<<<<<
* return _create_Fst(arc_type)
*
*/
- __pyx_tuple__72 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_arc_type); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 2684, __pyx_L1_error)
+ __pyx_tuple__72 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_arc_type); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 2688, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__72);
__Pyx_GIVEREF(__pyx_tuple__72);
- __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_new, 2684, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 2684, __pyx_L1_error)
- __pyx_tuple__74 = PyTuple_Pack(1, ((PyObject*)__pyx_n_b_standard)); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 2684, __pyx_L1_error)
+ __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_new, 2688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 2688, __pyx_L1_error)
+ __pyx_tuple__74 = PyTuple_Pack(1, ((PyObject*)__pyx_n_b_standard)); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 2688, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__74);
__Pyx_GIVEREF(__pyx_tuple__74);
- /* "pywrapfst.pyx":2688
+ /* "pywrapfst.pyx":2692
*
* @staticmethod
* def read(filename, fst_type=None): # <<<<<<<<<<<<<<
* """
* read(filename, fst_type=None)
*/
- __pyx_tuple__75 = PyTuple_Pack(2, __pyx_n_s_filename, __pyx_n_s_fst_type); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 2688, __pyx_L1_error)
+ __pyx_tuple__75 = PyTuple_Pack(2, __pyx_n_s_filename, __pyx_n_s_fst_type); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 2692, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__75);
__Pyx_GIVEREF(__pyx_tuple__75);
- __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_read, 2688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 2688, __pyx_L1_error)
- __pyx_tuple__77 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 2688, __pyx_L1_error)
+ __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_read, 2692, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 2692, __pyx_L1_error)
+ __pyx_tuple__77 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 2692, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__77);
__Pyx_GIVEREF(__pyx_tuple__77);
- /* "pywrapfst.pyx":2709
+ /* "pywrapfst.pyx":2713
*
* @staticmethod
* def read_from_string(fst_string, fst_type=None): # <<<<<<<<<<<<<<
* """
* read_from_string(fst_string, fst_type=None)
*/
- __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_fst_string, __pyx_n_s_fst_type); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 2709, __pyx_L1_error)
+ __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_fst_string, __pyx_n_s_fst_type); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 2713, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__78);
__Pyx_GIVEREF(__pyx_tuple__78);
- __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_read_from_string, 2709, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 2709, __pyx_L1_error)
- __pyx_tuple__80 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 2709, __pyx_L1_error)
+ __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_read_from_string, 2713, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 2713, __pyx_L1_error)
+ __pyx_tuple__80 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 2713, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__80);
__Pyx_GIVEREF(__pyx_tuple__80);
- /* "pywrapfst.pyx":3952
+ /* "pywrapfst.pyx":3963
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_tuple__81 = PyTuple_Pack(9, __pyx_n_s_ifst, __pyx_n_s_delta, __pyx_n_s_nstate, __pyx_n_s_qt, __pyx_n_s_reverse, __pyx_n_s_distance, __pyx_n_s_weight_type, __pyx_n_s_result, __pyx_n_s_it); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 3952, __pyx_L1_error)
+ __pyx_tuple__81 = PyTuple_Pack(9, __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_result, __pyx_n_s_it); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 3963, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__81);
__Pyx_GIVEREF(__pyx_tuple__81);
- __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_shortestdistance, 3952, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 3952, __pyx_L1_error)
+ __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_shortestdistance, 3963, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 3963, __pyx_L1_error)
- /* "pywrapfst.pyx":4524
+ /* "pywrapfst.pyx":4536
*
* @atexit.register
* def _reset_fst_error_fatal(): # <<<<<<<<<<<<<<
* fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
*
*/
- __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_reset_fst_error_fatal, 4524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 4524, __pyx_L1_error)
+ __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_reset_fst_error_fatal, 4536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 4536, __pyx_L1_error)
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
__pyx_vtable_9pywrapfst_Weight.copy = (struct __pyx_obj_9pywrapfst_Weight *(*)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_6Weight_copy;
__pyx_vtable_9pywrapfst_Weight.to_string = (std::string (*)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_6Weight_to_string;
__pyx_vtable_9pywrapfst_Weight.type = (std::string (*)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_6Weight_type;
- if (PyType_Ready(&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 344, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
__pyx_type_9pywrapfst_Weight.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Weight.tp_dict, __pyx_vtabptr_9pywrapfst_Weight) < 0) __PYX_ERR(0, 344, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "Weight", (PyObject *)&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 344, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Weight.tp_dict, __pyx_vtabptr_9pywrapfst_Weight) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "Weight", (PyObject *)&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
__pyx_ptype_9pywrapfst_Weight = &__pyx_type_9pywrapfst_Weight;
__pyx_vtabptr_9pywrapfst__SymbolTable = &__pyx_vtable_9pywrapfst__SymbolTable;
__pyx_vtable_9pywrapfst__SymbolTable.available_key = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_available_key;
__pyx_vtable_9pywrapfst__SymbolTable.num_symbols = (size_t (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_num_symbols;
__pyx_vtable_9pywrapfst__SymbolTable.write = (void (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_write;
__pyx_vtable_9pywrapfst__SymbolTable.write_text = (void (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_write_text;
- if (PyType_Ready(&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 665, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 669, __pyx_L1_error)
__pyx_type_9pywrapfst__SymbolTable.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst__SymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 665, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_SymbolTable", (PyObject *)&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 665, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__SymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 669, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_SymbolTable", (PyObject *)&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 669, __pyx_L1_error)
__pyx_ptype_9pywrapfst__SymbolTable = &__pyx_type_9pywrapfst__SymbolTable;
__pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTable = &__pyx_vtable_9pywrapfst__EncodeMapperSymbolTable;
__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, 817, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 821, __pyx_L1_error)
__pyx_type_9pywrapfst__EncodeMapperSymbolTable.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst__EncodeMapperSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 817, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_EncodeMapperSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 817, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__EncodeMapperSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 821, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_EncodeMapperSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 821, __pyx_L1_error)
__pyx_ptype_9pywrapfst__EncodeMapperSymbolTable = &__pyx_type_9pywrapfst__EncodeMapperSymbolTable;
__pyx_vtabptr_9pywrapfst__FstSymbolTable = &__pyx_vtable_9pywrapfst__FstSymbolTable;
__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, 837, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 841, __pyx_L1_error)
__pyx_type_9pywrapfst__FstSymbolTable.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst__FstSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_FstSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__FstSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 841, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_FstSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 841, __pyx_L1_error)
__pyx_ptype_9pywrapfst__FstSymbolTable = &__pyx_type_9pywrapfst__FstSymbolTable;
__pyx_vtabptr_9pywrapfst__MutableSymbolTable = &__pyx_vtable_9pywrapfst__MutableSymbolTable;
__pyx_vtable_9pywrapfst__MutableSymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst__SymbolTable;
__pyx_vtable_9pywrapfst__MutableSymbolTable.add_table = (void (*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19_MutableSymbolTable_add_table;
__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, 856, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 860, __pyx_L1_error)
__pyx_type_9pywrapfst__MutableSymbolTable.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 856, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_MutableSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 856, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 860, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_MutableSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 860, __pyx_L1_error)
__pyx_ptype_9pywrapfst__MutableSymbolTable = &__pyx_type_9pywrapfst__MutableSymbolTable;
__pyx_vtabptr_9pywrapfst__MutableFstSymbolTable = &__pyx_vtable_9pywrapfst__MutableFstSymbolTable;
__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, 907, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
__pyx_type_9pywrapfst__MutableFstSymbolTable.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableFstSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 907, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_MutableFstSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 907, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableFstSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_MutableFstSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
__pyx_ptype_9pywrapfst__MutableFstSymbolTable = &__pyx_type_9pywrapfst__MutableFstSymbolTable;
__pyx_vtabptr_9pywrapfst_SymbolTable = &__pyx_vtable_9pywrapfst_SymbolTable;
__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, 927, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 931, __pyx_L1_error)
__pyx_type_9pywrapfst_SymbolTable.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_SymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 927, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "SymbolTable", (PyObject *)&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 927, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_SymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 931, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "SymbolTable", (PyObject *)&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 931, __pyx_L1_error)
__pyx_ptype_9pywrapfst_SymbolTable = &__pyx_type_9pywrapfst_SymbolTable;
__pyx_vtabptr_9pywrapfst_SymbolTableIterator = &__pyx_vtable_9pywrapfst_SymbolTableIterator;
__pyx_vtable_9pywrapfst_SymbolTableIterator.done = (bool (*)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19SymbolTableIterator_done;
__pyx_vtable_9pywrapfst_SymbolTableIterator.reset = (void (*)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19SymbolTableIterator_reset;
__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, 1117, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1121, __pyx_L1_error)
__pyx_type_9pywrapfst_SymbolTableIterator.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_SymbolTableIterator.tp_dict, __pyx_vtabptr_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1117, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "SymbolTableIterator", (PyObject *)&__pyx_type_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1117, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_SymbolTableIterator.tp_dict, __pyx_vtabptr_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1121, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "SymbolTableIterator", (PyObject *)&__pyx_type_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1121, __pyx_L1_error)
__pyx_ptype_9pywrapfst_SymbolTableIterator = &__pyx_type_9pywrapfst_SymbolTableIterator;
__pyx_vtabptr_9pywrapfst_EncodeMapper = &__pyx_vtable_9pywrapfst_EncodeMapper;
__pyx_vtable_9pywrapfst_EncodeMapper.arc_type = (std::string (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_arc_type;
__pyx_vtable_9pywrapfst_EncodeMapper.set_input_symbols = (void (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_set_input_symbols;
__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, 1217, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1221, __pyx_L1_error)
__pyx_type_9pywrapfst_EncodeMapper.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9pywrapfst_EncodeMapper, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1217, __pyx_L1_error)
+ PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9pywrapfst_EncodeMapper, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1221, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_9pywrapfst_12EncodeMapper_6__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_9pywrapfst_12EncodeMapper_6__call__.doc = __pyx_doc_9pywrapfst_12EncodeMapper_6__call__;
}
}
#endif
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_EncodeMapper.tp_dict, __pyx_vtabptr_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1217, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "EncodeMapper", (PyObject *)&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1217, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_EncodeMapper.tp_dict, __pyx_vtabptr_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1221, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "EncodeMapper", (PyObject *)&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1221, __pyx_L1_error)
__pyx_ptype_9pywrapfst_EncodeMapper = &__pyx_type_9pywrapfst_EncodeMapper;
__pyx_vtabptr_9pywrapfst__Fst = &__pyx_vtable_9pywrapfst__Fst;
__pyx_vtable_9pywrapfst__Fst.arc_type = (std::string (*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_arc_type;
__pyx_vtable_9pywrapfst__Fst.weight_type = (std::string (*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_weight_type;
__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.WriteToString = (std::string (*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_WriteToString;
- if (PyType_Ready(&__pyx_type_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1348, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1352, __pyx_L1_error)
__pyx_type_9pywrapfst__Fst.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst__Fst.tp_dict, __pyx_vtabptr_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1348, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_Fst", (PyObject *)&__pyx_type_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1348, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__Fst.tp_dict, __pyx_vtabptr_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1352, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_Fst", (PyObject *)&__pyx_type_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1352, __pyx_L1_error)
__pyx_ptype_9pywrapfst__Fst = &__pyx_type_9pywrapfst__Fst;
__pyx_vtabptr_9pywrapfst__MutableFst = &__pyx_vtable_9pywrapfst__MutableFst;
__pyx_vtable_9pywrapfst__MutableFst.__pyx_base = *__pyx_vtabptr_9pywrapfst__Fst;
__pyx_vtable_9pywrapfst__MutableFst._topsort = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *))__pyx_f_9pywrapfst_11_MutableFst__topsort;
__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, 1714, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1718, __pyx_L1_error)
__pyx_type_9pywrapfst__MutableFst.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableFst.tp_dict, __pyx_vtabptr_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1714, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_MutableFst", (PyObject *)&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1714, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableFst.tp_dict, __pyx_vtabptr_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1718, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_MutableFst", (PyObject *)&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1718, __pyx_L1_error)
__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, 2795, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2799, __pyx_L1_error)
__pyx_type_9pywrapfst_Arc.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Arc.tp_dict, __pyx_vtabptr_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2795, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "Arc", (PyObject *)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2795, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Arc.tp_dict, __pyx_vtabptr_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2799, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "Arc", (PyObject *)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2799, __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, 2863, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2867, __pyx_L1_error)
__pyx_type_9pywrapfst_ArcIterator.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_ArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2863, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "ArcIterator", (PyObject *)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2863, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_ArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2867, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "ArcIterator", (PyObject *)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2867, __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, 3000, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3004, __pyx_L1_error)
__pyx_type_9pywrapfst_MutableArcIterator.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_MutableArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3000, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "MutableArcIterator", (PyObject *)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3000, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_MutableArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3004, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "MutableArcIterator", (PyObject *)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3004, __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, 3152, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3156, __pyx_L1_error)
__pyx_type_9pywrapfst_StateIterator.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_StateIterator.tp_dict, __pyx_vtabptr_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3152, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "StateIterator", (PyObject *)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3152, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_StateIterator.tp_dict, __pyx_vtabptr_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3156, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "StateIterator", (PyObject *)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3156, __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, 4099, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4111, __pyx_L1_error)
__pyx_type_9pywrapfst_Compiler.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Compiler.tp_dict, __pyx_vtabptr_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4099, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "Compiler", (PyObject *)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4099, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Compiler.tp_dict, __pyx_vtabptr_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4111, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "Compiler", (PyObject *)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4111, __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, 4225, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4237, __pyx_L1_error)
__pyx_type_9pywrapfst_FarReader.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarReader.tp_dict, __pyx_vtabptr_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4225, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "FarReader", (PyObject *)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4225, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarReader.tp_dict, __pyx_vtabptr_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4237, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "FarReader", (PyObject *)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4237, __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, 4399, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4411, __pyx_L1_error)
__pyx_type_9pywrapfst_FarWriter.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarWriter.tp_dict, __pyx_vtabptr_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4399, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "FarWriter", (PyObject *)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4399, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarWriter.tp_dict, __pyx_vtabptr_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4411, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "FarWriter", (PyObject *)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4411, __pyx_L1_error)
__pyx_ptype_9pywrapfst_FarWriter = &__pyx_type_9pywrapfst_FarWriter;
/*--- Type import code ---*/
/*--- Variable import code ---*/
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":403
+ /* "pywrapfst.pyx":407
*
* @classmethod
* def Zero(cls, weight_type): # <<<<<<<<<<<<<<
* """
* Weight.Zero(weight_type)
*/
- __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_Zero); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_Zero); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":402
+ /* "pywrapfst.pyx":406
* # the C part out-of-class and then call it from within.
*
* @classmethod # <<<<<<<<<<<<<<
* def Zero(cls, weight_type):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_Zero, __pyx_t_1) < 0) __PYX_ERR(0, 403, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_Zero, __pyx_t_1) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Weight);
- /* "pywrapfst.pyx":410
+ /* "pywrapfst.pyx":414
*
* @classmethod
* def One(cls, weight_type): # <<<<<<<<<<<<<<
* """
* Weight.One(weight_type)
*/
- __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_One); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_One); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":409
+ /* "pywrapfst.pyx":413
* return _Weight_Zero(weight_type)
*
* @classmethod # <<<<<<<<<<<<<<
* def One(cls, weight_type):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_One, __pyx_t_2) < 0) __PYX_ERR(0, 410, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_One, __pyx_t_2) < 0) __PYX_ERR(0, 414, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Weight);
- /* "pywrapfst.pyx":417
+ /* "pywrapfst.pyx":421
*
* @classmethod
* def NoWeight(cls, weight_type): # <<<<<<<<<<<<<<
* """
* Weight.NoWeight(weight_type)
*/
- __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_NoWeight); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_NoWeight); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":416
+ /* "pywrapfst.pyx":420
* return _Weight_One(weight_type)
*
* @classmethod # <<<<<<<<<<<<<<
* def NoWeight(cls, weight_type):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_NoWeight, __pyx_t_1) < 0) __PYX_ERR(0, 417, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_NoWeight, __pyx_t_1) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Weight);
- /* "pywrapfst.pyx":446
+ /* "pywrapfst.pyx":450
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* plus(lhs, rhs)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_1plus, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error)
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_1plus, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_plus, __pyx_t_1) < 0) __PYX_ERR(0, 446, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_plus, __pyx_t_1) < 0) __PYX_ERR(0, 450, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":478
+ /* "pywrapfst.pyx":482
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* times(lhs, rhs)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_3times, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error)
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_3times, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_times, __pyx_t_1) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_times, __pyx_t_1) < 0) __PYX_ERR(0, 482, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":510
+ /* "pywrapfst.pyx":514
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* divide(lhs, rhs)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_5divide, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_5divide, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_divide, __pyx_t_1) < 0) __PYX_ERR(0, 510, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_divide, __pyx_t_1) < 0) __PYX_ERR(0, 514, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":543
+ /* "pywrapfst.pyx":547
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
* """
* times(lhs, rhs)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_7power, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_7power, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_power, __pyx_t_1) < 0) __PYX_ERR(0, 543, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_power, __pyx_t_1) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":960
+ /* "pywrapfst.pyx":964
*
* @classmethod
* def read(cls, filename): # <<<<<<<<<<<<<<
* """
* SymbolTable.read(filename)
*/
- __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":959
+ /* "pywrapfst.pyx":963
* self._smart_table.reset(self._table)
*
* @classmethod # <<<<<<<<<<<<<<
* def read(cls, filename):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read, __pyx_t_2) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read, __pyx_t_2) < 0) __PYX_ERR(0, 964, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":982
+ /* "pywrapfst.pyx":986
*
* @classmethod
* def read_text(cls, filename, bool allow_negative_labels=False): # <<<<<<<<<<<<<<
* """
* SymbolTable.read_text(filename)
*/
- __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":981
+ /* "pywrapfst.pyx":985
* return _init_SymbolTable(tsyms)
*
* @classmethod # <<<<<<<<<<<<<<
* def read_text(cls, filename, bool allow_negative_labels=False):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_text, __pyx_t_1) < 0) __PYX_ERR(0, 982, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_text, __pyx_t_1) < 0) __PYX_ERR(0, 986, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":1009
+ /* "pywrapfst.pyx":1013
*
* @classmethod
* def read_fst(cls, filename, bool input_table): # <<<<<<<<<<<<<<
* """
* SymbolTable.read_fst(filename, input_table)
*/
- __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":1008
+ /* "pywrapfst.pyx":1012
* return _init_SymbolTable(tsyms)
*
* @classmethod # <<<<<<<<<<<<<<
* def read_fst(cls, filename, bool input_table):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_fst, __pyx_t_2) < 0) __PYX_ERR(0, 1009, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_fst, __pyx_t_2) < 0) __PYX_ERR(0, 1013, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":2004
+ /* "pywrapfst.pyx":2008
* return self
*
* cdef void _minimize(self, float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__11 = fst::kDelta;
- /* "pywrapfst.pyx":2010
+ /* "pywrapfst.pyx":2014
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
*/
__pyx_k__12 = fst::kDelta;
- /* "pywrapfst.pyx":2096
+ /* "pywrapfst.pyx":2100
* 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":2105
+ /* "pywrapfst.pyx":2109
*
* def prune(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__15 = fst::kDelta;
- /* "pywrapfst.pyx":2106
+ /* "pywrapfst.pyx":2110
* def prune(self,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__16 = fst::kNoStateId;
- /* "pywrapfst.pyx":2133
+ /* "pywrapfst.pyx":2137
*
* cdef void _push(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__17 = fst::kDelta;
- /* "pywrapfst.pyx":2141
+ /* "pywrapfst.pyx":2145
*
* def push(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__18 = fst::kDelta;
- /* "pywrapfst.pyx":2376
+ /* "pywrapfst.pyx":2380
* cdef void _rmepsilon(self,
* bool connect=True,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__22 = fst::kDelta;
- /* "pywrapfst.pyx":2377
+ /* "pywrapfst.pyx":2381
* bool connect=True,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__23 = fst::kNoStateId;
- /* "pywrapfst.pyx":2387
+ /* "pywrapfst.pyx":2391
* def rmepsilon(self,
* bool connect=True,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__24 = fst::kDelta;
- /* "pywrapfst.pyx":2388
+ /* "pywrapfst.pyx":2392
* bool connect=True,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__25 = fst::kNoStateId;
- /* "pywrapfst.pyx":2667
+ /* "pywrapfst.pyx":2671
* return _init_XFst(ofst)
*
* class Fst(object): # <<<<<<<<<<<<<<
*
* """
*/
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2671, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_builtin_object);
__Pyx_GIVEREF(__pyx_builtin_object);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object);
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2667, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2671, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Fst, __pyx_n_s_Fst, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, __pyx_kp_s_Fst_arc_type_standard_Construct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2667, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Fst, __pyx_n_s_Fst, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, __pyx_kp_s_Fst_arc_type_standard_Construct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2671, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":2684
+ /* "pywrapfst.pyx":2688
* """
*
* def __new__(cls, arc_type=b"standard"): # <<<<<<<<<<<<<<
* return _create_Fst(arc_type)
*
*/
- __pyx_t_4 = __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__73)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2684, __pyx_L1_error)
+ __pyx_t_4 = __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__73)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2688, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__74);
- if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_t_4) < 0) __PYX_ERR(0, 2684, __pyx_L1_error)
+ if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_t_4) < 0) __PYX_ERR(0, 2688, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "pywrapfst.pyx":2688
+ /* "pywrapfst.pyx":2692
*
* @staticmethod
* def read(filename, fst_type=None): # <<<<<<<<<<<<<<
* """
* read(filename, fst_type=None)
*/
- __pyx_t_4 = __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__76)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2688, __pyx_L1_error)
+ __pyx_t_4 = __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__76)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2692, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__77);
- /* "pywrapfst.pyx":2687
+ /* "pywrapfst.pyx":2691
* return _create_Fst(arc_type)
*
* @staticmethod # <<<<<<<<<<<<<<
* def read(filename, fst_type=None):
* """
*/
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2687, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2691, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2687, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2691, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read, __pyx_t_4) < 0) __PYX_ERR(0, 2688, __pyx_L1_error)
+ if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read, __pyx_t_4) < 0) __PYX_ERR(0, 2692, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "pywrapfst.pyx":2709
+ /* "pywrapfst.pyx":2713
*
* @staticmethod
* def read_from_string(fst_string, fst_type=None): # <<<<<<<<<<<<<<
* """
* read_from_string(fst_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__79)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2709, __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__79)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2713, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__80);
- /* "pywrapfst.pyx":2708
+ /* "pywrapfst.pyx":2712
* return _read_Fst(filename, fst_type)
*
* @staticmethod # <<<<<<<<<<<<<<
* def read_from_string(fst_string, fst_type=None):
* """
*/
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2708, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2708, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_from_string, __pyx_t_4) < 0) __PYX_ERR(0, 2709, __pyx_L1_error)
+ if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_from_string, __pyx_t_4) < 0) __PYX_ERR(0, 2713, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "pywrapfst.pyx":2667
+ /* "pywrapfst.pyx":2671
* return _init_XFst(ofst)
*
* class Fst(object): # <<<<<<<<<<<<<<
*
* """
*/
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Fst, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2667, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Fst, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2671, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Fst, __pyx_t_4) < 0) __PYX_ERR(0, 2667, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Fst, __pyx_t_4) < 0) __PYX_ERR(0, 2671, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2732
+ /* "pywrapfst.pyx":2736
*
*
* EXPANDED = fst.kExpanded # <<<<<<<<<<<<<<
* MUTABLE = fst.kMutable
* ERROR = fst.kError
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2732, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2736, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXPANDED, __pyx_t_2) < 0) __PYX_ERR(0, 2732, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXPANDED, __pyx_t_2) < 0) __PYX_ERR(0, 2736, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2733
+ /* "pywrapfst.pyx":2737
*
* EXPANDED = fst.kExpanded
* MUTABLE = fst.kMutable # <<<<<<<<<<<<<<
* ERROR = fst.kError
* ACCEPTOR = fst.kAcceptor
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2733, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2737, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_MUTABLE, __pyx_t_2) < 0) __PYX_ERR(0, 2733, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MUTABLE, __pyx_t_2) < 0) __PYX_ERR(0, 2737, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2734
+ /* "pywrapfst.pyx":2738
* EXPANDED = fst.kExpanded
* MUTABLE = fst.kMutable
* ERROR = fst.kError # <<<<<<<<<<<<<<
* ACCEPTOR = fst.kAcceptor
* NOT_ACCEPTOR = fst.kNotAcceptor
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2734, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2738, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_2) < 0) __PYX_ERR(0, 2734, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_2) < 0) __PYX_ERR(0, 2738, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2735
+ /* "pywrapfst.pyx":2739
* MUTABLE = fst.kMutable
* ERROR = fst.kError
* ACCEPTOR = fst.kAcceptor # <<<<<<<<<<<<<<
* NOT_ACCEPTOR = fst.kNotAcceptor
* I_DETERMINISTIC = fst.kIDeterministic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2739, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCEPTOR, __pyx_t_2) < 0) __PYX_ERR(0, 2735, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCEPTOR, __pyx_t_2) < 0) __PYX_ERR(0, 2739, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2736
+ /* "pywrapfst.pyx":2740
* ERROR = fst.kError
* ACCEPTOR = fst.kAcceptor
* NOT_ACCEPTOR = fst.kNotAcceptor # <<<<<<<<<<<<<<
* I_DETERMINISTIC = fst.kIDeterministic
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2736, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_2) < 0) __PYX_ERR(0, 2736, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_2) < 0) __PYX_ERR(0, 2740, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2737
+ /* "pywrapfst.pyx":2741
* ACCEPTOR = fst.kAcceptor
* NOT_ACCEPTOR = fst.kNotAcceptor
* I_DETERMINISTIC = fst.kIDeterministic # <<<<<<<<<<<<<<
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
* O_DETERMINISTIC = fst.kODeterministic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2737, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2741, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2737, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2741, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2738
+ /* "pywrapfst.pyx":2742
* NOT_ACCEPTOR = fst.kNotAcceptor
* I_DETERMINISTIC = fst.kIDeterministic
* NON_I_DETERMINISTIC = fst.kNonIDeterministic # <<<<<<<<<<<<<<
* O_DETERMINISTIC = fst.kODeterministic
* NON_O_DETERMINISTIC = fst.kNonODeterministic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2738, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2742, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2738, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2742, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2739
+ /* "pywrapfst.pyx":2743
* I_DETERMINISTIC = fst.kIDeterministic
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
* O_DETERMINISTIC = fst.kODeterministic # <<<<<<<<<<<<<<
* NON_O_DETERMINISTIC = fst.kNonODeterministic
* EPSILONS = fst.kEpsilons
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2739, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2743, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2739, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2743, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2740
+ /* "pywrapfst.pyx":2744
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
* O_DETERMINISTIC = fst.kODeterministic
* NON_O_DETERMINISTIC = fst.kNonODeterministic # <<<<<<<<<<<<<<
* EPSILONS = fst.kEpsilons
* NO_EPSILONS = fst.kNoEpsilons
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2740, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2744, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2740, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2744, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2741
+ /* "pywrapfst.pyx":2745
* O_DETERMINISTIC = fst.kODeterministic
* NON_O_DETERMINISTIC = fst.kNonODeterministic
* EPSILONS = fst.kEpsilons # <<<<<<<<<<<<<<
* NO_EPSILONS = fst.kNoEpsilons
* I_EPSILONS = fst.kIEpsilons
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2741, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2745, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2741, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2745, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2742
+ /* "pywrapfst.pyx":2746
* NON_O_DETERMINISTIC = fst.kNonODeterministic
* EPSILONS = fst.kEpsilons
* NO_EPSILONS = fst.kNoEpsilons # <<<<<<<<<<<<<<
* I_EPSILONS = fst.kIEpsilons
* NO_I_EPSILONS = fst.kNoIEpsilons
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2742, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2746, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2742, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2746, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2743
+ /* "pywrapfst.pyx":2747
* EPSILONS = fst.kEpsilons
* NO_EPSILONS = fst.kNoEpsilons
* I_EPSILONS = fst.kIEpsilons # <<<<<<<<<<<<<<
* NO_I_EPSILONS = fst.kNoIEpsilons
* O_EPSILONS = fst.kOEpsilons
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2743, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2743, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2747, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2744
+ /* "pywrapfst.pyx":2748
* NO_EPSILONS = fst.kNoEpsilons
* I_EPSILONS = fst.kIEpsilons
* NO_I_EPSILONS = fst.kNoIEpsilons # <<<<<<<<<<<<<<
* O_EPSILONS = fst.kOEpsilons
* NO_O_EPSILONS = fst.kNoOEpsilons
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2744, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2748, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_I_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2744, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_I_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2748, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2745
+ /* "pywrapfst.pyx":2749
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2745, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2749, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2745, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2749, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2746
+ /* "pywrapfst.pyx":2750
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2746, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2750, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_O_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2746, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_O_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2750, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2747
+ /* "pywrapfst.pyx":2751
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2751, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2747, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2751, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2748
+ /* "pywrapfst.pyx":2752
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2748, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2752, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2748, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2752, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2749
+ /* "pywrapfst.pyx":2753
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2749, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2753, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2749, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2753, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2750
+ /* "pywrapfst.pyx":2754
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2750, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2754, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2750, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2754, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2751
+ /* "pywrapfst.pyx":2755
* O_LABEL_SORTED = fst.kOLabelSorted
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
* WEIGHTED = fst.kWeighted # <<<<<<<<<<<<<<
* UNWEIGHTED = fst.kUnweighted
* CYCLIC = fst.kCyclic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2751, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2755, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED, __pyx_t_2) < 0) __PYX_ERR(0, 2751, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED, __pyx_t_2) < 0) __PYX_ERR(0, 2755, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2752
+ /* "pywrapfst.pyx":2756
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
* WEIGHTED = fst.kWeighted
* UNWEIGHTED = fst.kUnweighted # <<<<<<<<<<<<<<
* CYCLIC = fst.kCyclic
* ACYCLIC = fst.kAcyclic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2752, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED, __pyx_t_2) < 0) __PYX_ERR(0, 2752, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED, __pyx_t_2) < 0) __PYX_ERR(0, 2756, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2753
+ /* "pywrapfst.pyx":2757
* WEIGHTED = fst.kWeighted
* UNWEIGHTED = fst.kUnweighted
* CYCLIC = fst.kCyclic # <<<<<<<<<<<<<<
* ACYCLIC = fst.kAcyclic
* INITIAL_CYCLIC = fst.kInitialCyclic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2753, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_CYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2753, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2757, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2754
+ /* "pywrapfst.pyx":2758
* UNWEIGHTED = fst.kUnweighted
* CYCLIC = fst.kCyclic
* ACYCLIC = fst.kAcyclic # <<<<<<<<<<<<<<
* INITIAL_CYCLIC = fst.kInitialCyclic
* INITIAL_ACYCLIC = fst.kInitialAcyclic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2754, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2758, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2754, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2758, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2755
+ /* "pywrapfst.pyx":2759
* CYCLIC = fst.kCyclic
* ACYCLIC = fst.kAcyclic
* INITIAL_CYCLIC = fst.kInitialCyclic # <<<<<<<<<<<<<<
* INITIAL_ACYCLIC = fst.kInitialAcyclic
* TOP_SORTED = fst.kTopSorted
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2755, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2759, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2755, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2759, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2756
+ /* "pywrapfst.pyx":2760
* ACYCLIC = fst.kAcyclic
* INITIAL_CYCLIC = fst.kInitialCyclic
* INITIAL_ACYCLIC = fst.kInitialAcyclic # <<<<<<<<<<<<<<
* TOP_SORTED = fst.kTopSorted
* NOT_TOP_SORTED = fst.kNotTopSorted
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2756, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2760, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2756, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2760, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2757
+ /* "pywrapfst.pyx":2761
* INITIAL_CYCLIC = fst.kInitialCyclic
* INITIAL_ACYCLIC = fst.kInitialAcyclic
* TOP_SORTED = fst.kTopSorted # <<<<<<<<<<<<<<
* NOT_TOP_SORTED = fst.kNotTopSorted
* ACCESSIBLE = fst.kAccessible
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2757, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2761, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOP_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2757, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOP_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2761, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2758
+ /* "pywrapfst.pyx":2762
* INITIAL_ACYCLIC = fst.kInitialAcyclic
* TOP_SORTED = fst.kTopSorted
* NOT_TOP_SORTED = fst.kNotTopSorted # <<<<<<<<<<<<<<
* ACCESSIBLE = fst.kAccessible
* NOT_ACCESSIBLE = fst.kNotAccessible
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2758, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2762, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2758, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2762, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2759
+ /* "pywrapfst.pyx":2763
* TOP_SORTED = fst.kTopSorted
* NOT_TOP_SORTED = fst.kNotTopSorted
* ACCESSIBLE = fst.kAccessible # <<<<<<<<<<<<<<
* NOT_ACCESSIBLE = fst.kNotAccessible
* COACCESSIBLE = fst.kCoAccessible
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2759, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2763, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2759, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2763, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2760
+ /* "pywrapfst.pyx":2764
* NOT_TOP_SORTED = fst.kNotTopSorted
* ACCESSIBLE = fst.kAccessible
* NOT_ACCESSIBLE = fst.kNotAccessible # <<<<<<<<<<<<<<
* COACCESSIBLE = fst.kCoAccessible
* NOT_COACCESSIBLE = fst.kNotCoAccessible
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2760, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2764, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2760, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2764, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2761
+ /* "pywrapfst.pyx":2765
* ACCESSIBLE = fst.kAccessible
* NOT_ACCESSIBLE = fst.kNotAccessible
* COACCESSIBLE = fst.kCoAccessible # <<<<<<<<<<<<<<
* NOT_COACCESSIBLE = fst.kNotCoAccessible
* STRING = fst.kString
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2761, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2765, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2761, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_COACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2765, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2762
+ /* "pywrapfst.pyx":2766
* NOT_ACCESSIBLE = fst.kNotAccessible
* COACCESSIBLE = fst.kCoAccessible
* NOT_COACCESSIBLE = fst.kNotCoAccessible # <<<<<<<<<<<<<<
* STRING = fst.kString
* NOT_STRING = fst.kNotString
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2762, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2766, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2762, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2766, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2763
+ /* "pywrapfst.pyx":2767
* COACCESSIBLE = fst.kCoAccessible
* NOT_COACCESSIBLE = fst.kNotCoAccessible
* STRING = fst.kString # <<<<<<<<<<<<<<
* NOT_STRING = fst.kNotString
* WEIGHTED_CYCLES = fst.kWeightedCycles
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2763, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2767, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 2763, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 2767, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2764
+ /* "pywrapfst.pyx":2768
* NOT_COACCESSIBLE = fst.kNotCoAccessible
* STRING = fst.kString
* NOT_STRING = fst.kNotString # <<<<<<<<<<<<<<
* WEIGHTED_CYCLES = fst.kWeightedCycles
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2764, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 2764, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 2768, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2765
+ /* "pywrapfst.pyx":2769
* STRING = fst.kString
* NOT_STRING = fst.kNotString
* WEIGHTED_CYCLES = fst.kWeightedCycles # <<<<<<<<<<<<<<
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
* NULL_PROPERTIES = fst.kNullProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2765, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2769, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_2) < 0) __PYX_ERR(0, 2765, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_2) < 0) __PYX_ERR(0, 2769, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2766
+ /* "pywrapfst.pyx":2770
* NOT_STRING = fst.kNotString
* WEIGHTED_CYCLES = fst.kWeightedCycles
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles # <<<<<<<<<<<<<<
* NULL_PROPERTIES = fst.kNullProperties
* COPY_PROPERTIES = fst.kCopyProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2766, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2770, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_2) < 0) __PYX_ERR(0, 2766, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_2) < 0) __PYX_ERR(0, 2770, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2767
+ /* "pywrapfst.pyx":2771
* WEIGHTED_CYCLES = fst.kWeightedCycles
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
* NULL_PROPERTIES = fst.kNullProperties # <<<<<<<<<<<<<<
* COPY_PROPERTIES = fst.kCopyProperties
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2767, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2771, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2767, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2771, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2768
+ /* "pywrapfst.pyx":2772
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
* NULL_PROPERTIES = fst.kNullProperties
* COPY_PROPERTIES = fst.kCopyProperties # <<<<<<<<<<<<<<
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2768, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2772, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COPY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2768, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_COPY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2772, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2769
+ /* "pywrapfst.pyx":2773
* NULL_PROPERTIES = fst.kNullProperties
* COPY_PROPERTIES = fst.kCopyProperties
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties # <<<<<<<<<<<<<<
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
* SET_START_PROPERTIES = fst.kSetStartProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2769, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2773, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2769, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2773, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2770
+ /* "pywrapfst.pyx":2774
* COPY_PROPERTIES = fst.kCopyProperties
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties # <<<<<<<<<<<<<<
* SET_START_PROPERTIES = fst.kSetStartProperties
* SET_FINAL_PROPERTIES = fst.kSetFinalProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2770, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2774, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2770, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2774, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2771
+ /* "pywrapfst.pyx":2775
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2771, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2775, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2771, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2775, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2772
+ /* "pywrapfst.pyx":2776
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2772, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2776, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2772, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2776, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2773
+ /* "pywrapfst.pyx":2777
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2773, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2777, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2773, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2777, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2774
+ /* "pywrapfst.pyx":2778
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2774, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2778, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2774, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2778, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2775
+ /* "pywrapfst.pyx":2779
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2775, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2779, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2775, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2779, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2776
+ /* "pywrapfst.pyx":2780
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2776, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2780, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2776, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2780, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2777
+ /* "pywrapfst.pyx":2781
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2777, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2781, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2777, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2781, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2778
+ /* "pywrapfst.pyx":2782
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2778, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2782, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2778, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2782, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2779
+ /* "pywrapfst.pyx":2783
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2779, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2779, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2783, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2780
+ /* "pywrapfst.pyx":2784
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2780, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2784, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2780, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2784, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2781
+ /* "pywrapfst.pyx":2785
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2781, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2785, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2781, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2785, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2782
+ /* "pywrapfst.pyx":2786
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2782, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2786, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2782, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2786, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2783
+ /* "pywrapfst.pyx":2787
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2783, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2787, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2783, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2787, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2784
+ /* "pywrapfst.pyx":2788
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2784, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2788, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2784, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2788, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2785
+ /* "pywrapfst.pyx":2789
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2785, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2789, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2785, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2789, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2786
+ /* "pywrapfst.pyx":2790
* 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_2 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2786, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2790, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2786, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2790, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2787
+ /* "pywrapfst.pyx":2791
* BINARY_PROPERTIES = fst.kBinaryProperties
* TRINARY_PROPERTIES = fst.kTrinaryProperties
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties # <<<<<<<<<<<<<<
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
* FST_PROPERTIES = fst.kFstProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2787, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2791, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2787, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2791, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2788
+ /* "pywrapfst.pyx":2792
* TRINARY_PROPERTIES = fst.kTrinaryProperties
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties # <<<<<<<<<<<<<<
* FST_PROPERTIES = fst.kFstProperties
*
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2788, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2792, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2788, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2792, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2789
+ /* "pywrapfst.pyx":2793
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
* FST_PROPERTIES = fst.kFstProperties # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2789, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2793, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FST_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2789, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FST_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2793, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3234
+ /* "pywrapfst.pyx":3238
*
* cdef _Fst _map(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
- * mt=b"identity",
+ * map_type=b"identity",
* weight=None):
*/
__pyx_k__34 = fst::kDelta;
- /* "pywrapfst.pyx":3247
+ /* "pywrapfst.pyx":3251
*
* cpdef _Fst arcmap(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
- * mt=b"identity",
+ * map_type=b"identity",
* weight=None):
*/
__pyx_k__35 = fst::kDelta;
- /* "pywrapfst.pyx":3246
+ /* "pywrapfst.pyx":3250
*
*
* cpdef _Fst arcmap(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * mt=b"identity",
+ * map_type=b"identity",
*/
__pyx_k__35 = fst::kDelta;
- /* "pywrapfst.pyx":3350
+ /* "pywrapfst.pyx":3356
*
* cpdef _MutableFst determinize(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
- * dt=b"functional",
+ * det_type=b"functional",
* int64 nstate=fst.kNoStateId,
*/
__pyx_k__36 = fst::kDelta;
- /* "pywrapfst.pyx":3352
+ /* "pywrapfst.pyx":3358
* float delta=fst.kDelta,
- * dt=b"functional",
+ * det_type=b"functional",
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* int64 subsequential_label=0,
* weight=None,
*/
__pyx_k__37 = fst::kNoStateId;
- /* "pywrapfst.pyx":3350
+ /* "pywrapfst.pyx":3356
*
* cpdef _MutableFst determinize(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
- * dt=b"functional",
+ * det_type=b"functional",
* int64 nstate=fst.kNoStateId,
*/
__pyx_k__36 = fst::kDelta;
- /* "pywrapfst.pyx":3352
+ /* "pywrapfst.pyx":3358
* float delta=fst.kDelta,
- * dt=b"functional",
+ * det_type=b"functional",
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* int64 subsequential_label=0,
* weight=None,
*/
__pyx_k__37 = fst::kNoStateId;
- /* "pywrapfst.pyx":3439
+ /* "pywrapfst.pyx":3447
*
* cpdef _MutableFst disambiguate(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__38 = fst::kDelta;
- /* "pywrapfst.pyx":3440
+ /* "pywrapfst.pyx":3448
* cpdef _MutableFst disambiguate(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__39 = fst::kNoStateId;
- /* "pywrapfst.pyx":3439
+ /* "pywrapfst.pyx":3447
*
* cpdef _MutableFst disambiguate(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__38 = fst::kDelta;
- /* "pywrapfst.pyx":3440
+ /* "pywrapfst.pyx":3448
* cpdef _MutableFst disambiguate(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__39 = fst::kNoStateId;
- /* "pywrapfst.pyx":3508
+ /* "pywrapfst.pyx":3516
*
*
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
__pyx_k__40 = fst::kDelta;
__pyx_k__40 = fst::kDelta;
- /* "pywrapfst.pyx":3531
+ /* "pywrapfst.pyx":3539
*
*
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *: # <<<<<<<<<<<<<<
__pyx_k__41 = fst::kDelta;
__pyx_k__41 = fst::kDelta;
- /* "pywrapfst.pyx":3593
+ /* "pywrapfst.pyx":3602
*
*
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
__pyx_k__43 = fst::kDelta;
__pyx_k__43 = fst::kDelta;
- /* "pywrapfst.pyx":3620
+ /* "pywrapfst.pyx":3629
*
* cpdef _MutableFst prune(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__44 = fst::kDelta;
- /* "pywrapfst.pyx":3621
+ /* "pywrapfst.pyx":3630
* cpdef _MutableFst prune(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__45 = fst::kNoStateId;
- /* "pywrapfst.pyx":3620
+ /* "pywrapfst.pyx":3629
*
* cpdef _MutableFst prune(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__44 = fst::kDelta;
- /* "pywrapfst.pyx":3621
+ /* "pywrapfst.pyx":3630
* cpdef _MutableFst prune(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__45 = fst::kNoStateId;
- /* "pywrapfst.pyx":3652
+ /* "pywrapfst.pyx":3661
*
* cpdef _MutableFst push(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__46 = fst::kDelta;
- /* "pywrapfst.pyx":3651
+ /* "pywrapfst.pyx":3660
*
*
* cpdef _MutableFst push(_Fst ifst, # <<<<<<<<<<<<<<
*/
__pyx_k__46 = fst::kDelta;
- /* "pywrapfst.pyx":3706
+ /* "pywrapfst.pyx":3715
* _Fst ifst2,
* int32 npath=1,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__47 = fst::kDelta;
- /* "pywrapfst.pyx":3709
+ /* "pywrapfst.pyx":3718
* time_t seed=0,
* select=b"uniform",
* int32 max_length=INT32_MAX) except *: # <<<<<<<<<<<<<<
*/
__pyx_k__48 = INT32_MAX;
- /* "pywrapfst.pyx":3706
+ /* "pywrapfst.pyx":3715
* _Fst ifst2,
* int32 npath=1,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__47 = fst::kDelta;
- /* "pywrapfst.pyx":3709
+ /* "pywrapfst.pyx":3718
* time_t seed=0,
* select=b"uniform",
* int32 max_length=INT32_MAX) except *: # <<<<<<<<<<<<<<
*/
__pyx_k__48 = INT32_MAX;
- /* "pywrapfst.pyx":3761
+ /* "pywrapfst.pyx":3770
* time_t seed=0,
* select=b"uniform",
* int32 max_length=INT32_MAX, # <<<<<<<<<<<<<<
*/
__pyx_k__50 = INT32_MAX;
- /* "pywrapfst.pyx":3757
+ /* "pywrapfst.pyx":3766
*
*
* cpdef _MutableFst randgen(_Fst ifst, # <<<<<<<<<<<<<<
*/
__pyx_k__50 = INT32_MAX;
- /* "pywrapfst.pyx":3894
+ /* "pywrapfst.pyx":3903
* cpdef _MutableFst rmepsilon(_Fst ifst,
* bool connect=True,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
- * qt=b"auto",
+ * queue_type=b"auto",
*/
__pyx_k__51 = fst::kDelta;
- /* "pywrapfst.pyx":3895
+ /* "pywrapfst.pyx":3904
* bool connect=True,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * qt=b"auto",
+ * queue_type=b"auto",
* bool reverse=False,
*/
__pyx_k__52 = fst::kNoStateId;
- /* "pywrapfst.pyx":3894
+ /* "pywrapfst.pyx":3903
* cpdef _MutableFst rmepsilon(_Fst ifst,
* bool connect=True,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
- * qt=b"auto",
+ * queue_type=b"auto",
*/
__pyx_k__51 = fst::kDelta;
- /* "pywrapfst.pyx":3895
+ /* "pywrapfst.pyx":3904
* bool connect=True,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * qt=b"auto",
+ * queue_type=b"auto",
* bool reverse=False,
*/
__pyx_k__52 = fst::kNoStateId;
- /* "pywrapfst.pyx":3935
+ /* "pywrapfst.pyx":3944
*
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,
- * float delta=fst.kDelta, int64 nstate=fst.kNoStateId, qt=b"auto", # <<<<<<<<<<<<<<
+ * float delta=fst.kDelta, int64 nstate=fst.kNoStateId, queue_type=b"auto", # <<<<<<<<<<<<<<
* bool reverse=False) except *:
- * cdef vector[fst.WeightClass] *distance = new vector[fst.WeightClass]()
+ * cdef unique_ptr[vector[fst.WeightClass]] distance
*/
__pyx_k__53 = fst::kDelta;
__pyx_k__54 = fst::kNoStateId;
- /* "pywrapfst.pyx":3953
+ /* "pywrapfst.pyx":3964
*
* def shortestdistance(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
- * qt=b"auto",
+ * queue_type=b"auto",
*/
__pyx_k__55 = fst::kDelta;
- /* "pywrapfst.pyx":3954
+ /* "pywrapfst.pyx":3965
* def shortestdistance(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * qt=b"auto",
+ * queue_type=b"auto",
* bool reverse=False):
*/
__pyx_k__56 = fst::kNoStateId;
- /* "pywrapfst.pyx":3952
+ /* "pywrapfst.pyx":3963
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_49shortestdistance, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3952, __pyx_L1_error)
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_49shortestdistance, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3963, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_2) < 0) __PYX_ERR(0, 3952, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_2) < 0) __PYX_ERR(0, 3963, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3997
+ /* "pywrapfst.pyx":4009
*
* cpdef _MutableFst shortestpath(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__57 = fst::kDelta;
- /* "pywrapfst.pyx":3999
+ /* "pywrapfst.pyx":4011
* float delta=fst.kDelta,
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * qt=b"auto",
+ * queue_type=b"auto",
* bool unique=False,
*/
__pyx_k__58 = fst::kNoStateId;
- /* "pywrapfst.pyx":3997
+ /* "pywrapfst.pyx":4009
*
* cpdef _MutableFst shortestpath(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__57 = fst::kDelta;
- /* "pywrapfst.pyx":3999
+ /* "pywrapfst.pyx":4011
* float delta=fst.kDelta,
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * qt=b"auto",
+ * queue_type=b"auto",
* bool unique=False,
*/
__pyx_k__58 = fst::kNoStateId;
- /* "pywrapfst.pyx":4151
+ /* "pywrapfst.pyx":4163
*
* def __cinit__(self,
* string fst_type=b"vector", # <<<<<<<<<<<<<<
* string arc_type=b"standard",
* SymbolTable isymbols=None,
*/
- __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_vector); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4151, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_vector); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4163, __pyx_L1_error)
__pyx_k__59 = __pyx_t_6;
- /* "pywrapfst.pyx":4152
+ /* "pywrapfst.pyx":4164
* def __cinit__(self,
* string fst_type=b"vector",
* string arc_type=b"standard", # <<<<<<<<<<<<<<
* SymbolTable isymbols=None,
* SymbolTable osymbols=None,
*/
- __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_standard); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4152, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_standard); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4164, __pyx_L1_error)
__pyx_k__60 = __pyx_t_6;
- /* "pywrapfst.pyx":4252
+ /* "pywrapfst.pyx":4264
*
* @classmethod
* def open(cls, *filenames): # <<<<<<<<<<<<<<
* """
* FarReader.open(*filenames)
*/
- __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4252, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4251
+ /* "pywrapfst.pyx":4263
* return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self))
*
* @classmethod # <<<<<<<<<<<<<<
* def open(cls, *filenames):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4251, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarReader->tp_dict, __pyx_n_s_open, __pyx_t_1) < 0) __PYX_ERR(0, 4252, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarReader->tp_dict, __pyx_n_s_open, __pyx_t_1) < 0) __PYX_ERR(0, 4264, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_FarReader);
- /* "pywrapfst.pyx":4427
+ /* "pywrapfst.pyx":4439
*
* @classmethod
* def create(cls, filename, arc_type=b"standard", far_type=b"default"): # <<<<<<<<<<<<<<
* """
* FarWriter.
*/
- __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4427, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4439, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":4426
+ /* "pywrapfst.pyx":4438
* 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_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4426, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4438, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarWriter->tp_dict, __pyx_n_s_create, __pyx_t_2) < 0) __PYX_ERR(0, 4427, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarWriter->tp_dict, __pyx_n_s_create, __pyx_t_2) < 0) __PYX_ERR(0, 4439, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_FarWriter);
- /* "pywrapfst.pyx":4519
+ /* "pywrapfst.pyx":4531
*
*
* _fst_error_fatal_old = fst.FLAGS_fst_error_fatal # <<<<<<<<<<<<<<
* fst.FLAGS_fst_error_fatal = False
*
*/
- __pyx_t_2 = __Pyx_PyBool_FromLong(FLAGS_fst_error_fatal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4519, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyBool_FromLong(FLAGS_fst_error_fatal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4531, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_fst_error_fatal_old, __pyx_t_2) < 0) __PYX_ERR(0, 4519, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_fst_error_fatal_old, __pyx_t_2) < 0) __PYX_ERR(0, 4531, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":4520
+ /* "pywrapfst.pyx":4532
*
* _fst_error_fatal_old = fst.FLAGS_fst_error_fatal
* fst.FLAGS_fst_error_fatal = False # <<<<<<<<<<<<<<
*/
FLAGS_fst_error_fatal = 0;
- /* "pywrapfst.pyx":4523
+ /* "pywrapfst.pyx":4535
*
*
* @atexit.register # <<<<<<<<<<<<<<
* def _reset_fst_error_fatal():
* fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_atexit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4523, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_atexit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4523, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":4524
+ /* "pywrapfst.pyx":4536
*
* @atexit.register
* def _reset_fst_error_fatal(): # <<<<<<<<<<<<<<
* fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_57_reset_fst_error_fatal, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4524, __pyx_L1_error)
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_57_reset_fst_error_fatal, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4536, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4523, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4535, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4523, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4535, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4523, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4535, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4523, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4523, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_reset_fst_error_fatal, __pyx_t_2) < 0) __PYX_ERR(0, 4524, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_reset_fst_error_fatal, __pyx_t_2) < 0) __PYX_ERR(0, 4536, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "pywrapfst.pyx":1
}
}
-/* CIntToPy */
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__fst_3a__3a_script_3a__3a_ArcSortType(enum fst::script::ArcSortType value) {
- const enum fst::script::ArcSortType neg_one = (enum fst::script::ArcSortType) -1, const_zero = (enum fst::script::ArcSortType) 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(enum fst::script::ArcSortType) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(enum fst::script::ArcSortType) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(enum fst::script::ArcSortType) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
-#endif
- }
- } else {
- if (sizeof(enum fst::script::ArcSortType) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(enum fst::script::ArcSortType) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
-#endif
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(enum fst::script::ArcSortType),
- little, !is_unsigned);
- }
-}
-
-/* CIntToPy */
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__fst_3a__3a_script_3a__3a_MapType(enum fst::script::MapType value) {
- const enum fst::script::MapType neg_one = (enum fst::script::MapType) -1, const_zero = (enum fst::script::MapType) 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(enum fst::script::MapType) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(enum fst::script::MapType) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(enum fst::script::MapType) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
-#endif
- }
- } else {
- if (sizeof(enum fst::script::MapType) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(enum fst::script::MapType) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
-#endif
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(enum fst::script::MapType),
- little, !is_unsigned);
- }
-}
-
/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
const int neg_one = (int) -1, const_zero = (int) 0;