#include "typeinfo"
#include <utility>
#include <vector>
-#include <stdint.h>
#include <string.h>
#include <string>
+#include <stdint.h>
#include <iostream>
#include <fstream>
#include <sstream>
struct __pyx_obj_9pywrapfst_FarReader;
struct __pyx_obj_9pywrapfst_FarWriter;
-/* "fst.pxd":484
+/* "fst.pxd":495
*
*
* ctypedef pair[int64, const FstClass *] LabelFstClassPair # <<<<<<<<<<<<<<
*/
typedef std::pair<__pyx_t_10basictypes_int64,fst::script::FstClass const *> __pyx_t_3fst_LabelFstClassPair;
-/* "fst.pxd":486
+/* "fst.pxd":497
* ctypedef pair[int64, const FstClass *] LabelFstClassPair
*
* ctypedef pair[int64, int64] LabelPair # <<<<<<<<<<<<<<
struct __pyx_opt_args_9pywrapfst_randgen;
struct __pyx_opt_args_9pywrapfst_replace;
struct __pyx_opt_args_9pywrapfst_reverse;
-struct __pyx_opt_args_9pywrapfst_rmepsilon;
struct __pyx_opt_args_9pywrapfst__shortestdistance;
struct __pyx_opt_args_9pywrapfst_shortestpath;
-/* "pywrapfst.pxd":40
+/* "pywrapfst.pxd":47
*
*
* cdef string tostring(data, encoding=?) except * # <<<<<<<<<<<<<<
PyObject *encoding;
};
-/* "pywrapfst.pxd":42
+/* "pywrapfst.pxd":49
* cdef string tostring(data, encoding=?) except *
*
* cdef string weighttostring(data, encoding=?) except * # <<<<<<<<<<<<<<
PyObject *encoding;
};
-/* "pywrapfst.pxd":98
+/* "pywrapfst.pxd":105
* # SymbolTable.
*
* ctypedef fst.SymbolTable * SymbolTable_ptr # <<<<<<<<<<<<<<
*/
typedef fst::SymbolTable *__pyx_t_9pywrapfst_SymbolTable_ptr;
-/* "pywrapfst.pxd":138
+/* "pywrapfst.pxd":145
* cdef class _MutableSymbolTable(_SymbolTable):
*
* cpdef int64 add_symbol(self, symbol, int64 key=?) # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int64 key;
};
-/* "pywrapfst.pxd":214
+/* "pywrapfst.pxd":221
*
*
* ctypedef fst.FstClass * FstClass_ptr # <<<<<<<<<<<<<<
*/
typedef fst::script::FstClass *__pyx_t_9pywrapfst_FstClass_ptr;
-/* "pywrapfst.pxd":215
+/* "pywrapfst.pxd":222
*
* ctypedef fst.FstClass * FstClass_ptr
* ctypedef fst.MutableFstClass * MutableFstClass_ptr # <<<<<<<<<<<<<<
*/
typedef fst::script::MutableFstClass *__pyx_t_9pywrapfst_MutableFstClass_ptr;
-/* "pywrapfst.pxd":216
+/* "pywrapfst.pxd":223
* 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":229
+/* "pywrapfst.pxd":236
* cpdef _Fst copy(self)
*
* cpdef void draw(self, filename, _SymbolTable isymbols=?, # <<<<<<<<<<<<<<
bool show_weight_one;
};
-/* "pywrapfst.pxd":257
+/* "pywrapfst.pxd":264
* cpdef StateIterator states(self)
*
* cpdef string text(self, _SymbolTable isymbols=?, _SymbolTable osymbols=?, # <<<<<<<<<<<<<<
PyObject *missing_sym;
};
-/* "pywrapfst.pxd":280
+/* "pywrapfst.pxd":287
* cpdef int64 add_state(self) except *
*
* cdef void _arcsort(self, sort_type=?) except * # <<<<<<<<<<<<<<
PyObject *sort_type;
};
-/* "pywrapfst.pxd":282
+/* "pywrapfst.pxd":289
* cdef void _arcsort(self, sort_type=?) except *
*
* cdef void _closure(self, bool closure_plus=?) except * # <<<<<<<<<<<<<<
bool closure_plus;
};
-/* "pywrapfst.pxd":290
+/* "pywrapfst.pxd":297
* cdef void _decode(self, EncodeMapper) except *
*
* cdef void _delete_arcs(self, int64 state, size_t n=?) except * # <<<<<<<<<<<<<<
size_t n;
};
-/* "pywrapfst.pxd":292
+/* "pywrapfst.pxd":299
* cdef void _delete_arcs(self, int64 state, size_t n=?) except *
*
* cdef void _delete_states(self, states=?) except * # <<<<<<<<<<<<<<
PyObject *states;
};
-/* "pywrapfst.pxd":298
+/* "pywrapfst.pxd":305
* cdef void _invert(self) except *
*
* cdef void _minimize(self, float delta=?, bool allow_nondet=?) except * # <<<<<<<<<<<<<<
bool allow_nondet;
};
-/* "pywrapfst.pxd":304
+/* "pywrapfst.pxd":311
* cpdef int64 num_states(self)
*
* cdef void _project(self, bool project_output=?) except * # <<<<<<<<<<<<<<
bool project_output;
};
-/* "pywrapfst.pxd":306
+/* "pywrapfst.pxd":313
* cdef void _project(self, bool project_output=?) except *
*
* cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except * # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":308
+/* "pywrapfst.pxd":315
* 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":311
+/* "pywrapfst.pxd":318
* bool to_final=?) except *
*
* cdef void _relabel_pairs(self, ipairs=?, opairs=?) except * # <<<<<<<<<<<<<<
PyObject *opairs;
};
-/* "pywrapfst.pxd":313
+/* "pywrapfst.pxd":320
* cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *
*
* cdef void _relabel_tables(self, _SymbolTable old_isymbols=?, # <<<<<<<<<<<<<<
bool attach_new_osymbols;
};
-/* "pywrapfst.pxd":323
+/* "pywrapfst.pxd":330
* cdef void _reserve_states(self, int64 n) except *
*
* cdef void _reweight(self, potentials, bool to_final=?) except * # <<<<<<<<<<<<<<
*
- * cdef void _rmepsilon(self, bool connect=?, float delta=?, int64 nstate=?,
+ * cdef void _rmepsilon(self, queue_type=?, bool connect=?, weight=?,
*/
struct __pyx_opt_args_9pywrapfst_11_MutableFst__reweight {
int __pyx_n;
bool to_final;
};
-/* "pywrapfst.pxd":325
+/* "pywrapfst.pxd":332
* cdef void _reweight(self, potentials, bool to_final=?) except *
*
- * cdef void _rmepsilon(self, bool connect=?, float delta=?, int64 nstate=?, # <<<<<<<<<<<<<<
- * weight=?) except *
+ * cdef void _rmepsilon(self, queue_type=?, bool connect=?, weight=?, # <<<<<<<<<<<<<<
+ * int64 nstate=?, float delta=?) except *
*
*/
struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon {
int __pyx_n;
+ PyObject *queue_type;
bool connect;
- float delta;
- __pyx_t_10basictypes_int64 nstate;
PyObject *weight;
+ __pyx_t_10basictypes_int64 nstate;
+ float delta;
};
-/* "pywrapfst.pxd":328
- * weight=?) except *
+/* "pywrapfst.pxd":335
+ * int64 nstate=?, float delta=?) except *
*
* cdef void _set_final(self, int64 state, weight=?) except * # <<<<<<<<<<<<<<
*
PyObject *weight;
};
-/* "pywrapfst.pxd":352
+/* "pywrapfst.pxd":359
* cdef _Fst _init_XFst(FstClass_ptr tfst)
*
* cdef _MutableFst _create_Fst(arc_type=?) # <<<<<<<<<<<<<<
PyObject *arc_type;
};
-/* "pywrapfst.pxd":354
+/* "pywrapfst.pxd":361
* cdef _MutableFst _create_Fst(arc_type=?)
*
* cdef _Fst _read_Fst(filename, fst_type=?) # <<<<<<<<<<<<<<
PyObject *fst_type;
};
-/* "pywrapfst.pxd":356
+/* "pywrapfst.pxd":363
* cdef _Fst _read_Fst(filename, fst_type=?)
*
* cdef _Fst _deserialize_Fst(fst_string, fst_type=?) # <<<<<<<<<<<<<<
PyObject *fst_type;
};
-/* "pywrapfst.pxd":435
+/* "pywrapfst.pxd":442
*
*
* cdef _Fst _map(_Fst ifst, float delta=?, map_type=?, weight=?) # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":437
+/* "pywrapfst.pxd":444
* cdef _Fst _map(_Fst ifst, float delta=?, map_type=?, weight=?)
*
* cpdef _Fst arcmap(_Fst ifst, float delta=?, map_type=?, weight=?) # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":439
+/* "pywrapfst.pxd":446
* cpdef _Fst arcmap(_Fst ifst, float delta=?, map_type=?, weight=?)
*
* cpdef _MutableFst compose(_Fst ifst1, _Fst ifst2, compose_filter=?, # <<<<<<<<<<<<<<
bool connect;
};
-/* "pywrapfst.pxd":442
+/* "pywrapfst.pxd":449
* bool connect=?)
*
* cpdef _Fst convert(_Fst ifst, fst_type=?) # <<<<<<<<<<<<<<
PyObject *fst_type;
};
-/* "pywrapfst.pxd":444
+/* "pywrapfst.pxd":451
* cpdef _Fst convert(_Fst ifst, fst_type=?)
*
* cpdef _MutableFst determinize(_Fst ifst, float delta=?, det_type=?, # <<<<<<<<<<<<<<
bool increment_subsequential_label;
};
-/* "pywrapfst.pxd":448
+/* "pywrapfst.pxd":455
* weight=?, bool increment_subsequential_label=?)
*
* cpdef _MutableFst difference(_Fst ifst1, _Fst ifst2, compose_filter=?, # <<<<<<<<<<<<<<
bool connect;
};
-/* "pywrapfst.pxd":451
+/* "pywrapfst.pxd":458
* bool connect=?)
*
* cpdef _MutableFst disambiguate(_Fst ifst, float delta=?, int64 nstate=?, # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":454
+/* "pywrapfst.pxd":461
* int64 subsequential_label=?, weight=?)
*
* cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=?) # <<<<<<<<<<<<<<
bool eps_norm_output;
};
-/* "pywrapfst.pxd":456
+/* "pywrapfst.pxd":463
* cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=?)
*
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=?) # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":458
+/* "pywrapfst.pxd":465
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=?)
*
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=?) except * # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":460
+/* "pywrapfst.pxd":467
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=?) except *
*
* cpdef _MutableFst intersect(_Fst ifst1, _Fst ifst2, compose_filter=?, # <<<<<<<<<<<<<<
bool connect;
};
-/* "pywrapfst.pxd":463
+/* "pywrapfst.pxd":470
* bool connect=?)
*
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=?) # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":465
+/* "pywrapfst.pxd":472
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=?)
*
* cpdef _MutableFst prune(_Fst ifst, float delta=?, int64 nstate=?, # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":468
+/* "pywrapfst.pxd":475
* weight=?)
*
* cpdef _MutableFst push(_Fst ifst, float delta=?, bool push_weights=?, # <<<<<<<<<<<<<<
bool to_final;
};
-/* "pywrapfst.pxd":472
+/* "pywrapfst.pxd":479
* bool remove_total_weight=?, bool to_final=?)
*
* cpdef bool randequivalent(_Fst ifst1, _Fst ifst2, int32 npath=?, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int32 max_length;
};
-/* "pywrapfst.pxd":476
+/* "pywrapfst.pxd":483
* int32 max_length=?) except *
*
* cpdef _MutableFst randgen(_Fst ifst, int32 npath=?, time_t seed=?, # <<<<<<<<<<<<<<
bool weighted;
};
-/* "pywrapfst.pxd":483
+/* "pywrapfst.pxd":490
* bool epsilon_on_replace) except *
*
* cpdef _MutableFst replace(pairs, call_arc_labeling=?, return_arc_labeling=?, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int64 return_label;
};
-/* "pywrapfst.pxd":486
+/* "pywrapfst.pxd":493
* bool epsilon_on_replace=?, int64 return_label=?)
*
* cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=?) # <<<<<<<<<<<<<<
*
- * cpdef _MutableFst rmepsilon(_Fst ifst, bool connect=?, float delta=?,
+ * cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, float delta=?,
*/
struct __pyx_opt_args_9pywrapfst_reverse {
int __pyx_n;
bool require_superinitial;
};
-/* "pywrapfst.pxd":488
+/* "pywrapfst.pxd":495
* cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=?)
*
- * cpdef _MutableFst rmepsilon(_Fst ifst, bool connect=?, float delta=?, # <<<<<<<<<<<<<<
- * int64 nstate=?, queue_type=?, bool reverse=?,
- * weight=?)
- */
-struct __pyx_opt_args_9pywrapfst_rmepsilon {
- int __pyx_n;
- bool connect;
- float delta;
- __pyx_t_10basictypes_int64 nstate;
- PyObject *queue_type;
- bool reverse;
- PyObject *weight;
-};
-
-/* "pywrapfst.pxd":492
- * weight=?)
- *
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, float delta=?, # <<<<<<<<<<<<<<
* int64 nstate=?, queue_type=?,
* bool reverse=?) except *
bool reverse;
};
-/* "pywrapfst.pxd":496
+/* "pywrapfst.pxd":499
* bool reverse=?) except *
*
* cpdef _MutableFst shortestpath(_Fst ifst, float delta=?, int32 nshortest=?, # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":68
+/* "pywrapfst.pxd":75
*
*
* cdef class Weight(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":101
+/* "pywrapfst.pxd":108
*
*
* cdef class _SymbolTable(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":126
+/* "pywrapfst.pxd":133
*
*
* cdef class _EncodeMapperSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":131
+/* "pywrapfst.pxd":138
*
*
* cdef class _FstSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":136
+/* "pywrapfst.pxd":143
*
*
* cdef class _MutableSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":145
+/* "pywrapfst.pxd":152
*
*
* cdef class _MutableFstSymbolTable(_MutableSymbolTable): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":150
+/* "pywrapfst.pxd":157
*
*
* cdef class SymbolTable(_MutableSymbolTable): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":171
+/* "pywrapfst.pxd":178
*
*
* cdef class SymbolTableIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":190
+/* "pywrapfst.pxd":197
*
*
* cdef class EncodeMapper(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":219
+/* "pywrapfst.pxd":226
*
*
* cdef class _Fst(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":270
+/* "pywrapfst.pxd":277
*
*
* cdef class _MutableFst(_Fst): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":362
+/* "pywrapfst.pxd":369
*
*
* cdef class Arc(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":372
+/* "pywrapfst.pxd":379
*
*
* cdef class ArcIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":394
+/* "pywrapfst.pxd":401
*
*
* cdef class MutableArcIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":418
+/* "pywrapfst.pxd":425
*
*
* cdef class StateIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":508
+/* "pywrapfst.pxd":511
*
*
* cdef class Compiler(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":529
+/* "pywrapfst.pxd":532
* # FarReader.
*
* cdef class FarReader(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":554
+/* "pywrapfst.pxd":557
* # FarWriter.
*
* cdef class FarWriter(object): # <<<<<<<<<<<<<<
-/* "pywrapfst.pyx":343
+/* "pywrapfst.pyx":348
*
*
* cdef class Weight(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Weight *__pyx_vtabptr_9pywrapfst_Weight;
-/* "pywrapfst.pyx":674
+/* "pywrapfst.pyx":679
*
*
* cdef class _SymbolTable(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__SymbolTable *__pyx_vtabptr_9pywrapfst__SymbolTable;
-/* "pywrapfst.pyx":851
+/* "pywrapfst.pyx":843
*
*
* cdef class _EncodeMapperSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTable *__pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTable;
-/* "pywrapfst.pyx":871
+/* "pywrapfst.pyx":863
*
*
* cdef class _FstSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__FstSymbolTable *__pyx_vtabptr_9pywrapfst__FstSymbolTable;
-/* "pywrapfst.pyx":890
+/* "pywrapfst.pyx":882
*
*
* cdef class _MutableSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
-/* "pywrapfst.pyx":941
+/* "pywrapfst.pyx":934
*
*
* cdef class _MutableFstSymbolTable(_MutableSymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTable *__pyx_vtabptr_9pywrapfst__MutableFstSymbolTable;
-/* "pywrapfst.pyx":952
+/* "pywrapfst.pyx":945
*
*
* cdef class SymbolTable(_MutableSymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_SymbolTable *__pyx_vtabptr_9pywrapfst_SymbolTable;
-/* "pywrapfst.pyx":1135
+/* "pywrapfst.pyx":1128
*
*
* cdef class SymbolTableIterator(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *__pyx_vtabptr_9pywrapfst_SymbolTableIterator;
-/* "pywrapfst.pyx":1217
+/* "pywrapfst.pyx":1210
*
*
* cdef class EncodeMapper(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *__pyx_vtabptr_9pywrapfst_EncodeMapper;
-/* "pywrapfst.pyx":1373
+/* "pywrapfst.pyx":1366
*
*
* cdef class _Fst(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__Fst *__pyx_vtabptr_9pywrapfst__Fst;
-/* "pywrapfst.pyx":1778
+/* "pywrapfst.pyx":1771
*
*
* cdef class _MutableFst(_Fst): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__MutableFst *__pyx_vtabptr_9pywrapfst__MutableFst;
-/* "pywrapfst.pyx":2905
+/* "pywrapfst.pyx":2910
*
*
* cdef class Arc(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Arc *__pyx_vtabptr_9pywrapfst_Arc;
-/* "pywrapfst.pyx":2973
+/* "pywrapfst.pyx":2978
*
*
* cdef class ArcIterator(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_ArcIterator *__pyx_vtabptr_9pywrapfst_ArcIterator;
-/* "pywrapfst.pyx":3084
+/* "pywrapfst.pyx":3089
*
*
* cdef class MutableArcIterator(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *__pyx_vtabptr_9pywrapfst_MutableArcIterator;
-/* "pywrapfst.pyx":3198
+/* "pywrapfst.pyx":3203
*
*
* cdef class StateIterator(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_StateIterator *__pyx_vtabptr_9pywrapfst_StateIterator;
-/* "pywrapfst.pyx":4155
+/* "pywrapfst.pyx":4093
*
*
* cdef class Compiler(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Compiler *__pyx_vtabptr_9pywrapfst_Compiler;
-/* "pywrapfst.pyx":4282
+/* "pywrapfst.pyx":4220
*
*
* cdef class FarReader(object): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_FarReader *__pyx_vtabptr_9pywrapfst_FarReader;
-/* "pywrapfst.pyx":4440
+/* "pywrapfst.pyx":4378
*
*
* cdef class FarWriter(object): # <<<<<<<<<<<<<<
/* KeywordStringCheck.proto */
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
-/* PyIntBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
-#else
-#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
- PyObject_RichCompare(op1, op2, Py_EQ)
- #endif
-
/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif
-/* IncludeStringH.proto */
-#include <string.h>
-
-/* BytesEquals.proto */
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
-
/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL)
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *);
-/* ListAppend.proto */
-#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
-static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
- PyListObject* L = (PyListObject*) list;
- Py_ssize_t len = Py_SIZE(list);
- if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
- Py_INCREF(x);
- PyList_SET_ITEM(list, len, x);
- Py_SIZE(list) = len+1;
- return 0;
- }
- return PyList_Append(list, x);
-}
-#else
-#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
-#endif
-
/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
+/* PyObjectSetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
+#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
+static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_setattro))
+ return tp->tp_setattro(obj, attr_name, value);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_setattr))
+ return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
+#endif
+ return PyObject_SetAttr(obj, attr_name, value);
+}
+#else
+#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
+#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
+#endif
+
+/* VoidPtrExport.proto */
+static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig);
+
/* FunctionExport.proto */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
/* Module declarations from 'libcpp.vector' */
-/* Module declarations from 'libc.stdint' */
-
-/* Module declarations from 'basictypes' */
-
/* Module declarations from 'libc.string' */
/* Module declarations from 'libcpp.string' */
+/* Module declarations from 'libc.stdint' */
+
+/* Module declarations from 'basictypes' */
+
/* Module declarations from 'ios' */
/* Module declarations from 'fst' */
static PyTypeObject *__pyx_ptype_9pywrapfst_Compiler = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst_FarReader = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst_FarWriter = 0;
+static __pyx_t_10basictypes_int64 __pyx_v_9pywrapfst_kNoSymbol;
static std::string __pyx_f_9pywrapfst_tostring(PyObject *, struct __pyx_opt_args_9pywrapfst_tostring *__pyx_optional_args); /*proto*/
static std::string __pyx_f_9pywrapfst_weighttostring(PyObject *, struct __pyx_opt_args_9pywrapfst_weighttostring *__pyx_optional_args); /*proto*/
static enum fst::ComposeFilter __pyx_f_9pywrapfst__get_compose_filter(std::string const &); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_randgen *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_replace *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_reverse(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_reverse *__pyx_optional_args); /*proto*/
-static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_rmepsilon(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_rmepsilon *__pyx_optional_args); /*proto*/
static std::vector<fst::script::WeightClass> *__pyx_f_9pywrapfst__shortestdistance(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_shortestpath *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_statemap(struct __pyx_obj_9pywrapfst__Fst *, PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_NotImplementedError;
-static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_StopIteration;
+static PyObject *__pyx_builtin_KeyError;
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__5[] = "";
+static const char __pyx_k__6[] = "";
static const char __pyx_k_id[] = "id";
-static const char __pyx_k_it[] = "it";
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_osymbols[] = "osymbols";
static const char __pyx_k_portrait[] = "portrait";
static const char __pyx_k_position[] = "position";
+static const char __pyx_k_pyx_capi[] = "__pyx_capi__";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_read_fst[] = "read_fst";
static const char __pyx_k_register[] = "register";
static const char __pyx_k_weighted[] = "weighted";
static const char __pyx_k_ARC_FLAGS[] = "ARC_FLAGS";
static const char __pyx_k_Fst___new[] = "Fst.__new__";
+static const char __pyx_k_NO_SYMBOL[] = "NO_SYMBOL";
static const char __pyx_k_add_state[] = "add_state";
static const char __pyx_k_add_table[] = "add_table";
+static const char __pyx_k_kNoSymbol[] = "kNoSymbol";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_nextstate[] = "nextstate";
static const char __pyx_k_nshortest[] = "nshortest";
static const char __pyx_k_Fst_arc_type_standard_Construct[] = "\n Fst(arc_type=\"standard\")\n\n Constructs an empty FST.\n\n Args:\n arc_type: A string indicating the arc type.\n\n Raises:\n FstError: Unknown arc type.\n\n Raises:\n FstOpError: operation failed.\n ";
static const char __pyx_k_const_Fst_SymbolTable_r_at_0x_x[] = "<const Fst SymbolTable {!r} at 0x{:x}>";
static const char __pyx_k_usr_local_google_home_kbg_scrat[] = "/usr/local/google/home/kbg/scratch/pynini/src/pywrapfst.pyx";
-static const char __pyx_k_Equivalence_test_encountered_err[] = "Equivalence test encountered error";
static const char __pyx_k_Incompatible_or_invalid_arc_type[] = "Incompatible or invalid arc type";
static const char __pyx_k_Incompatible_or_invalid_weight_t[] = "Incompatible or invalid weight type";
static const char __pyx_k_Python_interface_to_the_FST_scri[] = "Python interface to the FST scripting API.\n\nOperations which construct new FSTs are implemented as traditional functions, as\nare two-argument boolean functions like `equal` and `equivalent`. Destructive\noperations---those that mutate an FST, in place---are instance methods, as is\n`write`. Operator overloading is not used. The following example, based on\nMohri et al. 2002, shows the construction of an ASR system given a pronunciation\nlexicon L, grammar G, a transducer from context-dependent phones to\ncontext-independent phones C, and an HMM set H:\n\n L = fst.Fst.read(\"L.fst\")\n G = fst.Fst.read(\"G.fst\")\n C = fst.Fst.read(\"C.fst\")\n H = fst.Fst.read(\"H.fst\")\n LG = fst.determinize(fst.compose(L, G))\n CLG = fst.determinize(fst.compose(C, LG))\n HCLG = fst.determinize(fst.compose(H, CLG))\n HCLG.minimize() # NB: works in-place.\n\nPython variables here use snake_case and constants are in all caps, minus the\nnormal `k` prefix.\n";
-static const char __pyx_k_Random_equivalence_test_encounte[] = "Random equivalence test encountered error";
static const char __pyx_k_Unknown_random_arc_selection_typ[] = "Unknown random arc selection type: {!r}";
static PyObject *__pyx_n_s_ACCEPTOR;
static PyObject *__pyx_n_s_ACCESSIBLE;
static PyObject *__pyx_n_s_EXPANDED;
static PyObject *__pyx_n_s_EXTRINSIC_PROPERTIES;
static PyObject *__pyx_kp_s_EncodeMapper_at_0x_x;
-static PyObject *__pyx_kp_s_Equivalence_test_encountered_err;
static PyObject *__pyx_n_s_FST_PROPERTIES;
static PyObject *__pyx_kp_s_FarReader_at_0x_x;
static PyObject *__pyx_kp_s_FarWriter_at_0x_x;
static PyObject *__pyx_n_s_NO_LABEL;
static PyObject *__pyx_n_s_NO_O_EPSILONS;
static PyObject *__pyx_n_s_NO_STATE_ID;
+static PyObject *__pyx_n_s_NO_SYMBOL;
static PyObject *__pyx_n_s_NULL_PROPERTIES;
static PyObject *__pyx_n_s_NoWeight;
static PyObject *__pyx_kp_s_No_new_SymbolTables_specified;
static PyObject *__pyx_n_s_POS_TRINARY_PROPERTIES;
static PyObject *__pyx_n_s_Popen;
static PyObject *__pyx_n_s_RM_SUPERFINAL_PROPERTIES;
-static PyObject *__pyx_kp_s_Random_equivalence_test_encounte;
static PyObject *__pyx_kp_s_Read_failed_r;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_SET_ARC_PROPERTIES;
static PyObject *__pyx_kp_s_Weight_type_not_found;
static PyObject *__pyx_kp_s_Write_failed_r;
static PyObject *__pyx_n_s_Zero;
-static PyObject *__pyx_kp_b__5;
+static PyObject *__pyx_kp_b__6;
static PyObject *__pyx_n_s_acceptor;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_state;
static PyObject *__pyx_n_s_input_table;
static PyObject *__pyx_n_s_ipairs;
static PyObject *__pyx_n_s_isymbols;
-static PyObject *__pyx_n_s_it;
+static PyObject *__pyx_n_s_kNoSymbol;
static PyObject *__pyx_n_s_keep_isymbols;
static PyObject *__pyx_n_s_keep_osymbols;
static PyObject *__pyx_n_s_keep_state_numbering;
static PyObject *__pyx_n_s_push_weights;
static PyObject *__pyx_kp_b_pywrapfst;
static PyObject *__pyx_n_s_pywrapfst_2;
+static PyObject *__pyx_n_s_pyx_capi;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_queue_type;
static PyObject *__pyx_pf_9pywrapfst_6Weight_10Zero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_12One(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_14NoWeight(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
-static PyObject *__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); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_6Weight_16__richcmp__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w2, int __pyx_v_op); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_18to_string(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_20type(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_plus(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_42reserve_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_44reserve_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_n); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reweight(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, bool __pyx_v_to_final); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_connect, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, __pyx_t_10basictypes_int64 __pyx_v_nstate, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_50set_final(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_52set_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_54set_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
static PyObject *__pyx_pf_9pywrapfst_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_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 PyObject *__pyx_pf_9pywrapfst_46shortestdistance(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_48shortestpath(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_50statemap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, PyObject *__pyx_v_map_type); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_52synchronize(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 */
static PyObject *__pyx_pf_9pywrapfst_8Compiler_4write(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_expression); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_10error(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_12far_type(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static int __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); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_56_reset_fst_error_fatal(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_54_reset_fst_error_fatal(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_tp_new_9pywrapfst_Weight(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__SymbolTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__EncodeMapperSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_FarReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_FarWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_neg_1;
-static float __pyx_k__15;
+static __pyx_t_10basictypes_int64 __pyx_k__5;
static float __pyx_k__16;
static float __pyx_k__17;
-static __pyx_t_10basictypes_int64 __pyx_k__18;
-static float __pyx_k__19;
-static __pyx_t_10basictypes_int64 __pyx_k__20;
-static float __pyx_k__21;
+static float __pyx_k__18;
+static __pyx_t_10basictypes_int64 __pyx_k__19;
+static float __pyx_k__20;
+static __pyx_t_10basictypes_int64 __pyx_k__21;
static float __pyx_k__22;
-static float __pyx_k__26;
+static float __pyx_k__23;
static __pyx_t_10basictypes_int64 __pyx_k__27;
static float __pyx_k__28;
static __pyx_t_10basictypes_int64 __pyx_k__29;
-static float __pyx_k__38;
+static float __pyx_k__30;
static float __pyx_k__39;
static float __pyx_k__40;
-static __pyx_t_10basictypes_int64 __pyx_k__41;
-static float __pyx_k__42;
-static __pyx_t_10basictypes_int64 __pyx_k__43;
-static float __pyx_k__44;
+static float __pyx_k__41;
+static __pyx_t_10basictypes_int64 __pyx_k__42;
+static float __pyx_k__43;
+static __pyx_t_10basictypes_int64 __pyx_k__44;
static float __pyx_k__45;
+static float __pyx_k__46;
static float __pyx_k__47;
static float __pyx_k__48;
static __pyx_t_10basictypes_int64 __pyx_k__49;
static float __pyx_k__50;
static float __pyx_k__51;
static __pyx_t_10basictypes_int32 __pyx_k__52;
-static __pyx_t_10basictypes_int32 __pyx_k__54;
-static float __pyx_k__55;
-static __pyx_t_10basictypes_int64 __pyx_k__56;
-static float __pyx_k__57;
-static __pyx_t_10basictypes_int64 __pyx_k__58;
-static float __pyx_k__59;
-static __pyx_t_10basictypes_int64 __pyx_k__60;
-static float __pyx_k__61;
-static __pyx_t_10basictypes_int64 __pyx_k__62;
-static std::string __pyx_k__63;
-static std::string __pyx_k__64;
+static __pyx_t_10basictypes_int32 __pyx_k__53;
+static float __pyx_k__54;
+static __pyx_t_10basictypes_int64 __pyx_k__55;
+static float __pyx_k__56;
+static __pyx_t_10basictypes_int64 __pyx_k__57;
+static float __pyx_k__58;
+static __pyx_t_10basictypes_int64 __pyx_k__59;
+static std::string __pyx_k__60;
+static std::string __pyx_k__61;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
-static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
-static PyObject *__pyx_tuple__23;
+static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
-static PyObject *__pyx_tuple__30;
+static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
-static PyObject *__pyx_tuple__46;
-static PyObject *__pyx_tuple__53;
+static PyObject *__pyx_tuple__38;
+static PyObject *__pyx_tuple__62;
+static PyObject *__pyx_tuple__63;
+static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
-static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
-static PyObject *__pyx_tuple__68;
-static PyObject *__pyx_tuple__70;
-static PyObject *__pyx_tuple__72;
-static PyObject *__pyx_tuple__74;
+static PyObject *__pyx_tuple__69;
+static PyObject *__pyx_tuple__71;
+static PyObject *__pyx_tuple__73;
+static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
-static PyObject *__pyx_tuple__84;
-static PyObject *__pyx_tuple__85;
-static PyObject *__pyx_codeobj__69;
-static PyObject *__pyx_codeobj__71;
-static PyObject *__pyx_codeobj__73;
-static PyObject *__pyx_codeobj__75;
+static PyObject *__pyx_codeobj__66;
+static PyObject *__pyx_codeobj__68;
+static PyObject *__pyx_codeobj__70;
+static PyObject *__pyx_codeobj__72;
+static PyObject *__pyx_codeobj__74;
static PyObject *__pyx_codeobj__77;
static PyObject *__pyx_codeobj__80;
static PyObject *__pyx_codeobj__83;
-static PyObject *__pyx_codeobj__86;
-static PyObject *__pyx_codeobj__87;
+static PyObject *__pyx_codeobj__84;
-/* "pywrapfst.pyx":154
+/* "pywrapfst.pyx":159
*
*
* cdef string tostring(data, encoding="utf8") except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":175
+ /* "pywrapfst.pyx":180
* """
* # A Python bytestring can be implicitly cast to a C++ string.
* if isinstance(data, bytes): # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":176
+ /* "pywrapfst.pyx":181
* # A Python bytestring can be implicitly cast to a C++ string.
* if isinstance(data, bytes):
* return data # <<<<<<<<<<<<<<
* elif isinstance(data, unicode):
* return data.encode(encoding)
*/
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
- /* "pywrapfst.pyx":175
+ /* "pywrapfst.pyx":180
* """
* # A Python bytestring can be implicitly cast to a C++ string.
* if isinstance(data, bytes): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":177
+ /* "pywrapfst.pyx":182
* if isinstance(data, bytes):
* return data
* elif isinstance(data, unicode): # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":178
+ /* "pywrapfst.pyx":183
* return data
* elif isinstance(data, unicode):
* return data.encode(encoding) # <<<<<<<<<<<<<<
* raise FstArgError("Cannot encode as string: {!r}".format(data))
*
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_encoding};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __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, 183, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_encoding};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __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, 183, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
{
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __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_encoding);
__Pyx_GIVEREF(__pyx_v_encoding);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_encoding);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
goto __pyx_L0;
- /* "pywrapfst.pyx":177
+ /* "pywrapfst.pyx":182
* if isinstance(data, bytes):
* return data
* elif isinstance(data, unicode): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":179
+ /* "pywrapfst.pyx":184
* elif isinstance(data, unicode):
* return data.encode(encoding)
* raise FstArgError("Cannot encode as string: {!r}".format(data)) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 179, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_encode_as_string_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_encode_as_string_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
}
if (!__pyx_t_8) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 179, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 179, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 179, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else
#endif
{
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 179, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 184, __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_data);
__Pyx_GIVEREF(__pyx_v_data);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_data);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 179, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
}
}
if (!__pyx_t_6) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_7};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __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, 184, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_7};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __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, 184, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
__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, 179, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 184, __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_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
__pyx_t_7 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __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, 179, __pyx_L1_error)
+ __PYX_ERR(0, 184, __pyx_L1_error)
- /* "pywrapfst.pyx":154
+ /* "pywrapfst.pyx":159
*
*
* cdef string tostring(data, encoding="utf8") except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":182
+/* "pywrapfst.pyx":187
*
*
* cdef string weighttostring(data, encoding="utf8") except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":206
+ /* "pywrapfst.pyx":211
* """
* # A Python bytestring can be implicitly cast to a C++ string.
* if isinstance(data, bytes): # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":207
+ /* "pywrapfst.pyx":212
* # A Python bytestring can be implicitly cast to a C++ string.
* if isinstance(data, bytes):
* return data # <<<<<<<<<<<<<<
* elif isinstance(data, unicode):
* return data.encode(encoding)
*/
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
- /* "pywrapfst.pyx":206
+ /* "pywrapfst.pyx":211
* """
* # A Python bytestring can be implicitly cast to a C++ string.
* if isinstance(data, bytes): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":208
+ /* "pywrapfst.pyx":213
* if isinstance(data, bytes):
* return data
* elif isinstance(data, unicode): # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":209
+ /* "pywrapfst.pyx":214
* return data
* elif isinstance(data, unicode):
* return data.encode(encoding) # <<<<<<<<<<<<<<
* elif isinstance(data, numbers.Number):
* return str(data).encode(encoding)
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_encoding};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __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, 214, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_encoding};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __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, 214, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
{
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 209, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 214, __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_encoding);
__Pyx_GIVEREF(__pyx_v_encoding);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_encoding);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
goto __pyx_L0;
- /* "pywrapfst.pyx":208
+ /* "pywrapfst.pyx":213
* if isinstance(data, bytes):
* return data
* elif isinstance(data, unicode): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":210
+ /* "pywrapfst.pyx":215
* elif isinstance(data, unicode):
* return data.encode(encoding)
* elif isinstance(data, numbers.Number): # <<<<<<<<<<<<<<
* return str(data).encode(encoding)
* raise FstArgError("Cannot encode as string: {!r}".format(data))
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Number); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Number); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_1 = PyObject_IsInstance(__pyx_v_data, __pyx_t_5); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __pyx_t_1 = PyObject_IsInstance(__pyx_v_data, __pyx_t_5); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 215, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":211
+ /* "pywrapfst.pyx":216
* return data.encode(encoding)
* elif isinstance(data, numbers.Number):
* return str(data).encode(encoding) # <<<<<<<<<<<<<<
* raise FstArgError("Cannot encode as string: {!r}".format(data))
*
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_data);
__Pyx_GIVEREF(__pyx_v_data);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_data);
- __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 211, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = NULL;
}
}
if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_encoding); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_encoding); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_encoding};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __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_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_encoding};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(__pyx_v_encoding);
__Pyx_GIVEREF(__pyx_v_encoding);
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_encoding);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_3;
goto __pyx_L0;
- /* "pywrapfst.pyx":210
+ /* "pywrapfst.pyx":215
* elif isinstance(data, unicode):
* return data.encode(encoding)
* elif isinstance(data, numbers.Number): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":212
+ /* "pywrapfst.pyx":217
* elif isinstance(data, numbers.Number):
* return str(data).encode(encoding)
* raise FstArgError("Cannot encode as string: {!r}".format(data)) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_encode_as_string_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_encode_as_string_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __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_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __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_data};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __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, 217, __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_data};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __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, 217, __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, 212, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 217, __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_data);
__Pyx_GIVEREF(__pyx_v_data);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_data);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
}
}
if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
__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_7, __pyx_t_6};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
__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, 212, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 217, __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_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
__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, 212, __pyx_L1_error)
+ __PYX_ERR(0, 217, __pyx_L1_error)
- /* "pywrapfst.pyx":182
+ /* "pywrapfst.pyx":187
*
*
* cdef string weighttostring(data, encoding="utf8") except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":215
+/* "pywrapfst.pyx":220
*
*
* cdef fst.ComposeFilter _get_compose_filter( # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("_get_compose_filter", 0);
- /* "pywrapfst.pyx":236
+ /* "pywrapfst.pyx":241
* """
* cdef fst.ComposeFilter compose_filter_enum
* if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)): # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(fst::script::GetComposeFilter(__pyx_v_compose_filter, (&__pyx_v_compose_filter_enum)) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":237
+ /* "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, 237, __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, 237, __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);
- /* "pywrapfst.pyx":238
+ /* "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, 238, __pyx_L1_error)
+ __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, 237, __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, 237, __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, 237, __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, 237, __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, 237, __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, 237, __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, 237, __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, 237, __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, 237, __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, 237, __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, 237, __pyx_L1_error)
+ __PYX_ERR(0, 242, __pyx_L1_error)
- /* "pywrapfst.pyx":236
+ /* "pywrapfst.pyx":241
* """
* cdef fst.ComposeFilter compose_filter_enum
* if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":239
+ /* "pywrapfst.pyx":244
* raise FstArgError("Unknown compose filter type: {!r}".format(
* compose_filter))
* return compose_filter_enum # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_compose_filter_enum;
goto __pyx_L0;
- /* "pywrapfst.pyx":215
+ /* "pywrapfst.pyx":220
*
*
* cdef fst.ComposeFilter _get_compose_filter( # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":242
+/* "pywrapfst.pyx":247
*
*
* cdef fst.DeterminizeType _get_determinize_type(const string &det_type) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("_get_determinize_type", 0);
- /* "pywrapfst.pyx":258
+ /* "pywrapfst.pyx":263
* """
* cdef fst.DeterminizeType det_type_enum
* if not fst.GetDeterminizeType(det_type, addr(det_type_enum)): # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(fst::script::GetDeterminizeType(__pyx_v_det_type, (&__pyx_v_det_type_enum)) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":259
+ /* "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, 259, __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, 259, __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_det_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __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, 259, __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, 259, __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, 259, __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, 259, __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, 259, __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, 259, __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, 259, __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, 259, __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, 259, __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, 259, __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, 259, __pyx_L1_error)
+ __PYX_ERR(0, 264, __pyx_L1_error)
- /* "pywrapfst.pyx":258
+ /* "pywrapfst.pyx":263
* """
* cdef fst.DeterminizeType det_type_enum
* if not fst.GetDeterminizeType(det_type, addr(det_type_enum)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":260
+ /* "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_det_type_enum;
goto __pyx_L0;
- /* "pywrapfst.pyx":242
+ /* "pywrapfst.pyx":247
*
*
* cdef fst.DeterminizeType _get_determinize_type(const string &det_type) except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":263
+/* "pywrapfst.pyx":268
*
*
* cdef fst.QueueType _get_queue_type(const string &queue_type) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("_get_queue_type", 0);
- /* "pywrapfst.pyx":282
+ /* "pywrapfst.pyx":287
* """
* cdef fst.QueueType queue_type_enum
* if not fst.GetQueueType(queue_type, addr(queue_type_enum)): # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(fst::script::GetQueueType(__pyx_v_queue_type, (&__pyx_v_queue_type_enum)) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":283
+ /* "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, 283, __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, 283, __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_queue_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __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, 283, __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, 283, __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, 283, __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, 283, __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, 283, __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, 283, __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, 283, __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, 283, __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, 283, __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, 283, __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, 283, __pyx_L1_error)
+ __PYX_ERR(0, 288, __pyx_L1_error)
- /* "pywrapfst.pyx":282
+ /* "pywrapfst.pyx":287
* """
* cdef fst.QueueType queue_type_enum
* if not fst.GetQueueType(queue_type, addr(queue_type_enum)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":284
+ /* "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_enum;
goto __pyx_L0;
- /* "pywrapfst.pyx":263
+ /* "pywrapfst.pyx":268
*
*
* cdef fst.QueueType _get_queue_type(const string &queue_type) except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":287
+/* "pywrapfst.pyx":292
*
*
* cdef fst.RandArcSelection _get_rand_arc_selection( # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("_get_rand_arc_selection", 0);
- /* "pywrapfst.pyx":307
+ /* "pywrapfst.pyx":312
* """
* cdef fst.RandArcSelection select_enum
* if not fst.GetRandArcSelection(select, addr(select_enum)): # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(fst::script::GetRandArcSelection(__pyx_v_select, (&__pyx_v_select_enum)) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":308
+ /* "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, 308, __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, 308, __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_select); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __pyx_L1_error)
+ __PYX_ERR(0, 313, __pyx_L1_error)
- /* "pywrapfst.pyx":307
+ /* "pywrapfst.pyx":312
* """
* cdef fst.RandArcSelection select_enum
* if not fst.GetRandArcSelection(select, addr(select_enum)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":309
+ /* "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_select_enum;
goto __pyx_L0;
- /* "pywrapfst.pyx":287
+ /* "pywrapfst.pyx":292
*
*
* cdef fst.RandArcSelection _get_rand_arc_selection( # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":312
+/* "pywrapfst.pyx":317
*
*
* cdef fst.ReplaceLabelType _get_replace_label_type( # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("_get_replace_label_type", 0);
- /* "pywrapfst.pyx":333
+ /* "pywrapfst.pyx":338
* """
* cdef fst.ReplaceLabelType replace_label_type_enum
* if not fst.GetReplaceLabelType(replace_label_type, epsilon_on_replace, # <<<<<<<<<<<<<<
__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":335
+ /* "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, 335, __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, 335, __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);
- /* "pywrapfst.pyx":336
+ /* "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, 336, __pyx_L1_error)
+ __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, 335, __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, 335, __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, 335, __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, 335, __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, 335, __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, 335, __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, 335, __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, 335, __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, 335, __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, 335, __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, 335, __pyx_L1_error)
+ __PYX_ERR(0, 340, __pyx_L1_error)
- /* "pywrapfst.pyx":333
+ /* "pywrapfst.pyx":338
* """
* cdef fst.ReplaceLabelType replace_label_type_enum
* if not fst.GetReplaceLabelType(replace_label_type, epsilon_on_replace, # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":337
+ /* "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_enum;
goto __pyx_L0;
- /* "pywrapfst.pyx":312
+ /* "pywrapfst.pyx":317
*
*
* cdef fst.ReplaceLabelType _get_replace_label_type( # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":363
+/* "pywrapfst.pyx":368
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":364
+ /* "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, 364, __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, 364, __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, 364, __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, 364, __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, 364, __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":365
+ /* "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, 365, __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, 365, __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, 364, __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, 364, __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, 364, __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, 364, __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":363
+ /* "pywrapfst.pyx":368
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":367
+/* "pywrapfst.pyx":372
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "pywrapfst.pyx":368
+ /* "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, 368, __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, 368, __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":367
+ /* "pywrapfst.pyx":372
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":373
+/* "pywrapfst.pyx":378
* # ValueError when that is not appropriate.
*
* def __float__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__float__", 0);
- /* "pywrapfst.pyx":374
+ /* "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, 374, __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, 374, __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, 374, __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":373
+ /* "pywrapfst.pyx":378
* # ValueError when that is not appropriate.
*
* def __float__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":376
+/* "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, 376, __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, 376, __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, 376, __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":377
+ /* "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, 377, __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, 377, __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":378
+ /* "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, 378, __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":377
+ /* "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":379
+ /* "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, 379, __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, 379, __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":376
+ /* "pywrapfst.pyx":381
* return float(self.to_string())
*
* def __init__(self, weight_type, weight): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":381
+/* "pywrapfst.pyx":386
* self._check_weight()
*
* cdef void _check_weight(self) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("_check_weight", 0);
- /* "pywrapfst.pyx":382
+ /* "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, 382, __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":383
+ /* "pywrapfst.pyx":388
* cdef void _check_weight(self) except *:
* if self.type() == b"none":
* raise FstArgError("Weight type not found") # <<<<<<<<<<<<<<
* if self.to_string() == b"BadNumber":
* raise FstBadWeightError("Invalid weight")
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __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, 383, __pyx_L1_error)
+ __PYX_ERR(0, 388, __pyx_L1_error)
- /* "pywrapfst.pyx":382
+ /* "pywrapfst.pyx":387
*
* cdef void _check_weight(self) except *:
* if self.type() == b"none": # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":384
+ /* "pywrapfst.pyx":389
* if self.type() == b"none":
* raise FstArgError("Weight type not found")
* 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, 384, __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":385
+ /* "pywrapfst.pyx":390
* raise FstArgError("Weight type not found")
* if self.to_string() == b"BadNumber":
* raise FstBadWeightError("Invalid weight") # <<<<<<<<<<<<<<
*
* cpdef Weight copy(self):
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __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);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __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, 385, __pyx_L1_error)
+ __PYX_ERR(0, 390, __pyx_L1_error)
- /* "pywrapfst.pyx":384
+ /* "pywrapfst.pyx":389
* if self.type() == b"none":
* raise FstArgError("Weight type not found")
* if self.to_string() == b"BadNumber": # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":381
+ /* "pywrapfst.pyx":386
* self._check_weight()
*
* cdef void _check_weight(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":387
+/* "pywrapfst.pyx":392
* raise FstBadWeightError("Invalid weight")
*
* 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, 387, __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, 387, __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, 387, __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, 387, __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":393
+ /* "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, 393, __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, 393, __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":394
+ /* "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, 394, __pyx_L1_error)
+ __PYX_ERR(0, 399, __pyx_L1_error)
}
- /* "pywrapfst.pyx":395
+ /* "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, 395, __pyx_L1_error)
+ __PYX_ERR(0, 400, __pyx_L1_error)
}
- /* "pywrapfst.pyx":394
+ /* "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":396
+ /* "pywrapfst.pyx":401
* result._weight.reset(new
* fst.WeightClass(<fst.WeightClass> deref(self._weight)))
* return result # <<<<<<<<<<<<<<
*
- * # To get around the inability to declare cdef class methods, we define
+ * # To get around the inability to declare cdef class methods, we define the
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":387
+ /* "pywrapfst.pyx":392
* raise FstBadWeightError("Invalid weight")
*
* 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, 387, __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":402
+/* "pywrapfst.pyx":407
*
* @classmethod
* def Zero(cls, weight_type): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("Zero", 0);
- /* "pywrapfst.pyx":408
+ /* "pywrapfst.pyx":413
* Constructs semiring zero.
* """
* 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, 408, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__Weight_Zero(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":402
+ /* "pywrapfst.pyx":407
*
* @classmethod
* def Zero(cls, weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":411
+/* "pywrapfst.pyx":416
*
* @classmethod
* def One(cls, weight_type): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("One", 0);
- /* "pywrapfst.pyx":417
+ /* "pywrapfst.pyx":422
* Constructs semiring One.
* """
* 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, 417, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__Weight_One(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":411
+ /* "pywrapfst.pyx":416
*
* @classmethod
* def One(cls, weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":420
+/* "pywrapfst.pyx":425
*
* @classmethod
* def NoWeight(cls, weight_type): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("NoWeight", 0);
- /* "pywrapfst.pyx":426
+ /* "pywrapfst.pyx":431
* Constructs a non-member weight in the semiring.
* """
* return _Weight_NoWeight(weight_type) # <<<<<<<<<<<<<<
*
- * def __richcmp__(Weight x, Weight y, int op):
+ * def __richcmp__(Weight w1, Weight w2, 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, 426, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__Weight_NoWeight(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":420
+ /* "pywrapfst.pyx":425
*
* @classmethod
* def NoWeight(cls, weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":428
+/* "pywrapfst.pyx":433
* return _Weight_NoWeight(weight_type)
*
- * def __richcmp__(Weight x, Weight y, int op): # <<<<<<<<<<<<<<
- * # This is useful for unit tests.
+ * def __richcmp__(Weight w1, Weight w2, int op): # <<<<<<<<<<<<<<
+ * # TODO(kbg): Replace this with __eq__ once Cython 0.27 is widely available.
* if op == 2: # `==`
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_6Weight_17__richcmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op); /*proto*/
-static PyObject *__pyx_pw_9pywrapfst_6Weight_17__richcmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op) {
+static PyObject *__pyx_pw_9pywrapfst_6Weight_17__richcmp__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2, int __pyx_v_op); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_6Weight_17__richcmp__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2, int __pyx_v_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, 428, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_9pywrapfst_Weight, 1, "y", 0))) __PYX_ERR(0, 428, __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));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w1), __pyx_ptype_9pywrapfst_Weight, 1, "w1", 0))) __PYX_ERR(0, 433, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_ptype_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 433, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_6Weight_16__richcmp__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_w1), ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_w2), ((int)__pyx_v_op));
/* function exit code */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__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) {
+static PyObject *__pyx_pf_9pywrapfst_6Weight_16__richcmp__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w2, int __pyx_v_op) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
+ PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__richcmp__", 0);
- /* "pywrapfst.pyx":430
- * def __richcmp__(Weight x, Weight y, int op):
- * # This is useful for unit tests.
+ /* "pywrapfst.pyx":435
+ * def __richcmp__(Weight w1, Weight w2, int op):
+ * # TODO(kbg): Replace this with __eq__ once Cython 0.27 is widely available.
* if op == 2: # `==` # <<<<<<<<<<<<<<
- * return (x.type() == y.type() and x.to_string() == y.to_string())
+ * return fst.Eq(deref(w1._weight), deref(w2._weight))
* elif op == 3: # `!=`
*/
switch (__pyx_v_op) {
case 2:
- /* "pywrapfst.pyx":431
- * # This is useful for unit tests.
+ /* "pywrapfst.pyx":436
+ * # TODO(kbg): Replace this with __eq__ once Cython 0.27 is widely available.
* if op == 2: # `==`
- * return (x.type() == y.type() and x.to_string() == y.to_string()) # <<<<<<<<<<<<<<
+ * return fst.Eq(deref(w1._weight), deref(w2._weight)) # <<<<<<<<<<<<<<
* elif op == 3: # `!=`
- * return not (x == y)
+ * return fst.Ne(deref(w1._weight), deref(w2._weight))
*/
__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, 431, __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, 431, __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, 431, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L3_bool_binop_done;
- }
- if (unlikely(((PyObject *)__pyx_v_x) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "to_string");
- __PYX_ERR(0, 431, __pyx_L1_error)
+ if (unlikely(((PyObject *)__pyx_v_w1) == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
+ __PYX_ERR(0, 436, __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, 431, __pyx_L1_error)
+ if (unlikely(((PyObject *)__pyx_v_w2) == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
+ __PYX_ERR(0, 436, __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, 431, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __pyx_t_3;
- __pyx_t_3 = 0;
- __pyx_L3_bool_binop_done:;
+ __pyx_t_1 = __Pyx_PyBool_FromLong(operator==((*__pyx_v_w1->_weight), (*__pyx_v_w2->_weight))); 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;
goto __pyx_L0;
- /* "pywrapfst.pyx":430
- * def __richcmp__(Weight x, Weight y, int op):
- * # This is useful for unit tests.
+ /* "pywrapfst.pyx":435
+ * def __richcmp__(Weight w1, Weight w2, int op):
+ * # TODO(kbg): Replace this with __eq__ once Cython 0.27 is widely available.
* if op == 2: # `==` # <<<<<<<<<<<<<<
- * return (x.type() == y.type() and x.to_string() == y.to_string())
+ * return fst.Eq(deref(w1._weight), deref(w2._weight))
* elif op == 3: # `!=`
*/
break;
- /* "pywrapfst.pyx":432
+ /* "pywrapfst.pyx":437
* if op == 2: # `==`
- * return (x.type() == y.type() and x.to_string() == y.to_string())
+ * return fst.Eq(deref(w1._weight), deref(w2._weight))
* elif op == 3: # `!=` # <<<<<<<<<<<<<<
- * return not (x == y)
+ * return fst.Ne(deref(w1._weight), deref(w2._weight))
* else:
*/
case 3:
- /* "pywrapfst.pyx":433
- * return (x.type() == y.type() and x.to_string() == y.to_string())
+ /* "pywrapfst.pyx":438
+ * return fst.Eq(deref(w1._weight), deref(w2._weight))
* elif op == 3: # `!=`
- * return not (x == y) # <<<<<<<<<<<<<<
+ * return fst.Ne(deref(w1._weight), deref(w2._weight)) # <<<<<<<<<<<<<<
* else:
* 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, 433, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 433, __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, 433, __pyx_L1_error)
+ if (unlikely(((PyObject *)__pyx_v_w1) == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
+ __PYX_ERR(0, 438, __pyx_L1_error)
+ }
+ if (unlikely(((PyObject *)__pyx_v_w2) == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
+ __PYX_ERR(0, 438, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_PyBool_FromLong(operator!=((*__pyx_v_w1->_weight), (*__pyx_v_w2->_weight))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":432
+ /* "pywrapfst.pyx":437
* if op == 2: # `==`
- * return (x.type() == y.type() and x.to_string() == y.to_string())
+ * return fst.Eq(deref(w1._weight), deref(w2._weight))
* elif op == 3: # `!=` # <<<<<<<<<<<<<<
- * return not (x == y)
+ * return fst.Ne(deref(w1._weight), deref(w2._weight))
* else:
*/
break;
default:
- /* "pywrapfst.pyx":435
- * return not (x == y)
+ /* "pywrapfst.pyx":440
+ * return fst.Ne(deref(w1._weight), deref(w2._weight))
* 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, 435, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_operator_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_op); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __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, 435, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_5);
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
}
}
- if (!__pyx_t_5) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 440, __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_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, 435, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ 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, 440, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
#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, 435, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ 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, 440, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __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, 435, __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, 435, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __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_NotImplementedError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 435, __pyx_L1_error)
+ __PYX_ERR(0, 440, __pyx_L1_error)
break;
}
- /* "pywrapfst.pyx":428
+ /* "pywrapfst.pyx":433
* return _Weight_NoWeight(weight_type)
*
- * def __richcmp__(Weight x, Weight y, int op): # <<<<<<<<<<<<<<
- * # This is useful for unit tests.
+ * def __richcmp__(Weight w1, Weight w2, int op): # <<<<<<<<<<<<<<
+ * # TODO(kbg): Replace this with __eq__ once Cython 0.27 is widely available.
* if op == 2: # `==`
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("pywrapfst.Weight.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":437
+/* "pywrapfst.pyx":442
* 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, 437, __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, 442, __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, 437, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __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, 437, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __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, 437, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 442, __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":438
+ /* "pywrapfst.pyx":443
*
* 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, 438, __pyx_L1_error)
+ __PYX_ERR(0, 443, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_weight.get()->ToString();
goto __pyx_L0;
- /* "pywrapfst.pyx":437
+ /* "pywrapfst.pyx":442
* 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, 437, __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, 442, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":440
+/* "pywrapfst.pyx":445
* 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, 440, __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, 445, __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, 440, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __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, 440, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __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, 440, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 445, __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":445
+ /* "pywrapfst.pyx":450
* Returns a string indicating the weight type.
* """
* 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, 445, __pyx_L1_error)
+ __PYX_ERR(0, 450, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_weight.get()->Type();
goto __pyx_L0;
- /* "pywrapfst.pyx":440
+ /* "pywrapfst.pyx":445
* 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, 440, __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, 445, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":448
+/* "pywrapfst.pyx":453
*
*
* cdef Weight _plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_plus", 0);
- /* "pywrapfst.pyx":449
+ /* "pywrapfst.pyx":454
*
* 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, 449, __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, 454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 449, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 454, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":450
+ /* "pywrapfst.pyx":455
* 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, 450, __pyx_L1_error)
+ __PYX_ERR(0, 455, __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, 450, __pyx_L1_error)
+ __PYX_ERR(0, 455, __pyx_L1_error)
}
- /* "pywrapfst.pyx":451
+ /* "pywrapfst.pyx":456
* 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, 451, __pyx_L1_error)
+ __PYX_ERR(0, 456, __pyx_L1_error)
}
- /* "pywrapfst.pyx":450
+ /* "pywrapfst.pyx":455
* 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":452
+ /* "pywrapfst.pyx":457
* 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":448
+ /* "pywrapfst.pyx":453
*
*
* cdef Weight _plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":455
+/* "pywrapfst.pyx":460
*
*
* 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, 455, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, 1); __PYX_ERR(0, 460, __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, 455, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "plus") < 0)) __PYX_ERR(0, 460, __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, 455, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 460, __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, 455, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 455, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 460, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 460, __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":475
+ /* "pywrapfst.pyx":480
* FstBadWeightError: invalid weight.
* """
* 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, 475, __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, 480, __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":476
+ /* "pywrapfst.pyx":481
* """
* 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, 476, __pyx_L1_error)
+ __PYX_ERR(0, 481, __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, 476, __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, 481, __pyx_L1_error)
- /* "pywrapfst.pyx":477
+ /* "pywrapfst.pyx":482
* cdef Weight result = _plus(lhs, rhs)
* result._check_weight()
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":455
+ /* "pywrapfst.pyx":460
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":480
+/* "pywrapfst.pyx":485
*
*
* cdef Weight _times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_times", 0);
- /* "pywrapfst.pyx":481
+ /* "pywrapfst.pyx":486
*
* 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, 481, __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, 486, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 481, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 486, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":482
+ /* "pywrapfst.pyx":487
* 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, 482, __pyx_L1_error)
+ __PYX_ERR(0, 487, __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, 482, __pyx_L1_error)
+ __PYX_ERR(0, 487, __pyx_L1_error)
}
- /* "pywrapfst.pyx":483
+ /* "pywrapfst.pyx":488
* 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, 483, __pyx_L1_error)
+ __PYX_ERR(0, 488, __pyx_L1_error)
}
- /* "pywrapfst.pyx":482
+ /* "pywrapfst.pyx":487
* 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":484
+ /* "pywrapfst.pyx":489
* 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":480
+ /* "pywrapfst.pyx":485
*
*
* cdef Weight _times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":487
+/* "pywrapfst.pyx":492
*
*
* 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, 487, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, 1); __PYX_ERR(0, 492, __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, 487, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "times") < 0)) __PYX_ERR(0, 492, __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, 487, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 492, __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, 487, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 487, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 492, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 492, __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":507
+ /* "pywrapfst.pyx":512
* FstBadWeightError: Invalid weight.
* """
* 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, 507, __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, 512, __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":508
+ /* "pywrapfst.pyx":513
* """
* 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, 508, __pyx_L1_error)
+ __PYX_ERR(0, 513, __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, 508, __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, 513, __pyx_L1_error)
- /* "pywrapfst.pyx":509
+ /* "pywrapfst.pyx":514
* cdef Weight result = _times(lhs, rhs)
* result._check_weight()
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":487
+ /* "pywrapfst.pyx":492
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":512
+/* "pywrapfst.pyx":517
*
*
* cdef Weight _divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_divide", 0);
- /* "pywrapfst.pyx":513
+ /* "pywrapfst.pyx":518
*
* 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, 513, __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, 518, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 513, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 518, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":514
+ /* "pywrapfst.pyx":519
* 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, 514, __pyx_L1_error)
+ __PYX_ERR(0, 519, __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, 514, __pyx_L1_error)
+ __PYX_ERR(0, 519, __pyx_L1_error)
}
- /* "pywrapfst.pyx":515
+ /* "pywrapfst.pyx":520
* 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, 515, __pyx_L1_error)
+ __PYX_ERR(0, 520, __pyx_L1_error)
}
- /* "pywrapfst.pyx":514
+ /* "pywrapfst.pyx":519
* 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":516
+ /* "pywrapfst.pyx":521
* 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":512
+ /* "pywrapfst.pyx":517
*
*
* cdef Weight _divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":519
+/* "pywrapfst.pyx":524
*
*
* 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, 519, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, 1); __PYX_ERR(0, 524, __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, 519, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "divide") < 0)) __PYX_ERR(0, 524, __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, 519, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 524, __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, 519, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 519, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 524, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 524, __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":541
+ /* "pywrapfst.pyx":546
* FstBadWeightError: Invalid weight.
* """
* 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, 541, __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, 546, __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":542
+ /* "pywrapfst.pyx":547
* """
* 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, 542, __pyx_L1_error)
+ __PYX_ERR(0, 547, __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, 542, __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, 547, __pyx_L1_error)
- /* "pywrapfst.pyx":543
+ /* "pywrapfst.pyx":548
* cdef Weight result = _divide(lhs, rhs)
* result._check_weight()
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":519
+ /* "pywrapfst.pyx":524
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":546
+/* "pywrapfst.pyx":551
*
*
* cdef Weight _power(Weight w, size_t n): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_power", 0);
- /* "pywrapfst.pyx":547
+ /* "pywrapfst.pyx":552
*
* 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, 547, __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, 552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 547, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 552, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":548
+ /* "pywrapfst.pyx":553
* 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, 548, __pyx_L1_error)
+ __PYX_ERR(0, 553, __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, 548, __pyx_L1_error)
+ __PYX_ERR(0, 553, __pyx_L1_error)
}
__pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::Power((*__pyx_v_w->_weight), __pyx_v_n)));
- /* "pywrapfst.pyx":549
+ /* "pywrapfst.pyx":554
* 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":546
+ /* "pywrapfst.pyx":551
*
*
* cdef Weight _power(Weight w, size_t n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":552
+/* "pywrapfst.pyx":557
*
*
* 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, 552, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, 1); __PYX_ERR(0, 557, __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, 552, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "power") < 0)) __PYX_ERR(0, 557, __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, 552, __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, 557, __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, 552, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 557, __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, 552, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_9pywrapfst_Weight, 1, "w", 0))) __PYX_ERR(0, 557, __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":569
+ /* "pywrapfst.pyx":574
* FstBadWeightError: Invalid weight.
* """
* 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, 569, __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, 574, __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":570
+ /* "pywrapfst.pyx":575
* """
* 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, 570, __pyx_L1_error)
+ __PYX_ERR(0, 575, __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, 570, __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, 575, __pyx_L1_error)
- /* "pywrapfst.pyx":571
+ /* "pywrapfst.pyx":576
* cdef Weight result = _power(w, n)
* result._check_weight()
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":552
+ /* "pywrapfst.pyx":557
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":574
+/* "pywrapfst.pyx":579
*
*
* 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":592
+ /* "pywrapfst.pyx":597
* """
* cdef fst.WeightClass result
* if weight is None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":593
+ /* "pywrapfst.pyx":598
* 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":592
+ /* "pywrapfst.pyx":597
* """
* cdef fst.WeightClass result
* if weight is None: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":594
+ /* "pywrapfst.pyx":599
* 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":595
+ /* "pywrapfst.pyx":600
* 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, 595, __pyx_L1_error)
+ __PYX_ERR(0, 600, __pyx_L1_error)
}
__pyx_v_result = (*((fst::script::WeightClass *)((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));
- /* "pywrapfst.pyx":594
+ /* "pywrapfst.pyx":599
* if weight is None:
* result = fst.WeightClass.Zero(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":597
+ /* "pywrapfst.pyx":602
* 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, 597, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 602, __pyx_L1_error)
__pyx_v_result = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);
- /* "pywrapfst.pyx":598
+ /* "pywrapfst.pyx":603
* 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":599
+ /* "pywrapfst.pyx":604
* 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, 599, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __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, 599, __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, 599, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 604, __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, 604, __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, 599, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __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, 599, __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, 604, __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, 599, __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, 604, __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, 599, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 604, __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, 599, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __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, 599, __pyx_L1_error)
+ __PYX_ERR(0, 604, __pyx_L1_error)
- /* "pywrapfst.pyx":598
+ /* "pywrapfst.pyx":603
* else:
* result = fst.WeightClass(weight_type, weighttostring(weight))
* if result.ToString() == b"BadNumber": # <<<<<<<<<<<<<<
}
__pyx_L3:;
- /* "pywrapfst.pyx":600
+ /* "pywrapfst.pyx":605
* if result.ToString() == b"BadNumber":
* raise FstBadWeightError(weighttostring(weight))
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":574
+ /* "pywrapfst.pyx":579
*
*
* cdef fst.WeightClass _get_WeightClass_or_Zero(const string &weight_type, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":603
+/* "pywrapfst.pyx":608
*
*
* 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":621
+ /* "pywrapfst.pyx":626
* """
* cdef fst.WeightClass result
* if weight is None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":622
+ /* "pywrapfst.pyx":627
* 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":621
+ /* "pywrapfst.pyx":626
* """
* cdef fst.WeightClass result
* if weight is None: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":623
+ /* "pywrapfst.pyx":628
* 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":624
+ /* "pywrapfst.pyx":629
* 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, 624, __pyx_L1_error)
+ __PYX_ERR(0, 629, __pyx_L1_error)
}
__pyx_v_result = (*((fst::script::WeightClass *)((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));
- /* "pywrapfst.pyx":623
+ /* "pywrapfst.pyx":628
* if weight is None:
* result = fst.WeightClass.One(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":626
+ /* "pywrapfst.pyx":631
* 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, 626, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 631, __pyx_L1_error)
__pyx_v_result = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);
- /* "pywrapfst.pyx":627
+ /* "pywrapfst.pyx":632
* 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":628
+ /* "pywrapfst.pyx":633
* 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, 628, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __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, 628, __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, 628, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_weighttostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 633, __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, 633, __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, 628, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __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, 628, __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, 633, __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, 628, __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, 633, __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, 628, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 633, __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, 628, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __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, 628, __pyx_L1_error)
+ __PYX_ERR(0, 633, __pyx_L1_error)
- /* "pywrapfst.pyx":627
+ /* "pywrapfst.pyx":632
* else:
* result = fst.WeightClass(weight_type, weighttostring(weight))
* if result.ToString() == b"BadNumber": # <<<<<<<<<<<<<<
}
__pyx_L3:;
- /* "pywrapfst.pyx":629
+ /* "pywrapfst.pyx":634
* if result.ToString() == b"BadNumber":
* raise FstBadWeightError(weighttostring(weight))
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":603
+ /* "pywrapfst.pyx":608
*
*
* cdef fst.WeightClass _get_WeightClass_or_One(const string &weight_type, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":632
+/* "pywrapfst.pyx":637
*
*
* cdef Weight _Weight_Zero(weight_type): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("_Weight_Zero", 0);
- /* "pywrapfst.pyx":633
+ /* "pywrapfst.pyx":638
*
* 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, 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, 638, __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, 638, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":634
+ /* "pywrapfst.pyx":639
* 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, 634, __pyx_L1_error)
+ __PYX_ERR(0, 639, __pyx_L1_error)
}
- /* "pywrapfst.pyx":635
+ /* "pywrapfst.pyx":640
* 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 FstArgError("Weight type not found")
*/
- __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, 640, __pyx_L1_error)
- /* "pywrapfst.pyx":634
+ /* "pywrapfst.pyx":639
* 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":636
+ /* "pywrapfst.pyx":641
* 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, 636, __pyx_L1_error)
+ __PYX_ERR(0, 641, __pyx_L1_error)
}
__pyx_t_3 = ((__pyx_v_result->_weight.get()->Type() == ((char *)"none")) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":637
+ /* "pywrapfst.pyx":642
* tostring(weight_type))))
* if result._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 642, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__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, 637, __pyx_L1_error)
+ __PYX_ERR(0, 642, __pyx_L1_error)
- /* "pywrapfst.pyx":636
+ /* "pywrapfst.pyx":641
* result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
* tostring(weight_type))))
* if result._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":638
+ /* "pywrapfst.pyx":643
* if result._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found")
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":632
+ /* "pywrapfst.pyx":637
*
*
* cdef Weight _Weight_Zero(weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":641
+/* "pywrapfst.pyx":646
*
*
* cdef Weight _Weight_One(weight_type): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("_Weight_One", 0);
- /* "pywrapfst.pyx":642
+ /* "pywrapfst.pyx":647
*
* 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, 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, 647, __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, 647, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":643
+ /* "pywrapfst.pyx":648
* 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, 643, __pyx_L1_error)
+ __PYX_ERR(0, 648, __pyx_L1_error)
}
- /* "pywrapfst.pyx":644
+ /* "pywrapfst.pyx":649
* 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 FstArgError("Weight type not found")
*/
- __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, 649, __pyx_L1_error)
- /* "pywrapfst.pyx":643
+ /* "pywrapfst.pyx":648
* 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":645
+ /* "pywrapfst.pyx":650
* 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, 645, __pyx_L1_error)
+ __PYX_ERR(0, 650, __pyx_L1_error)
}
__pyx_t_3 = ((__pyx_v_result->_weight.get()->Type() == ((char *)"none")) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":646
+ /* "pywrapfst.pyx":651
* fst.WeightClass.One(tostring(weight_type))))
* if result._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__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, 646, __pyx_L1_error)
+ __PYX_ERR(0, 651, __pyx_L1_error)
- /* "pywrapfst.pyx":645
+ /* "pywrapfst.pyx":650
* result._weight.reset(new fst.WeightClass(
* fst.WeightClass.One(tostring(weight_type))))
* if result._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":647
+ /* "pywrapfst.pyx":652
* if result._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found")
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":641
+ /* "pywrapfst.pyx":646
*
*
* cdef Weight _Weight_One(weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":650
+/* "pywrapfst.pyx":655
*
*
* cdef Weight _Weight_NoWeight(weight_type): # <<<<<<<<<<<<<<
std::string __pyx_t_2;
__Pyx_RefNannySetupContext("_Weight_NoWeight", 0);
- /* "pywrapfst.pyx":651
+ /* "pywrapfst.pyx":656
*
* 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, 651, __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, 656, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 651, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 656, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":652
+ /* "pywrapfst.pyx":657
* 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, 652, __pyx_L1_error)
+ __PYX_ERR(0, 657, __pyx_L1_error)
}
- /* "pywrapfst.pyx":653
+ /* "pywrapfst.pyx":658
* 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, 653, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L1_error)
- /* "pywrapfst.pyx":652
+ /* "pywrapfst.pyx":657
* 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":654
+ /* "pywrapfst.pyx":659
* result._weight.reset(new fst.WeightClass(
* fst.WeightClass.NoWeight(tostring(weight_type))))
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":650
+ /* "pywrapfst.pyx":655
*
*
* cdef Weight _Weight_NoWeight(weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":688
+/* "pywrapfst.pyx":693
* # Doing so will allow undefined behavior.
*
* def __init__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":689
+ /* "pywrapfst.pyx":694
*
* 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, 689, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":690
+ /* "pywrapfst.pyx":695
* 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, 690, __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, 695, __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, 690, __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, 695, __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, 690, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __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, 690, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __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, 690, __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, 695, __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, 690, __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, 695, __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, 690, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 695, __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, 690, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __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, 689, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __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, 689, __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, 694, __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, 689, __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, 694, __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, 689, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 694, __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, 689, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __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, 689, __pyx_L1_error)
+ __PYX_ERR(0, 694, __pyx_L1_error)
- /* "pywrapfst.pyx":688
+ /* "pywrapfst.pyx":693
* # Doing so will allow undefined behavior.
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":692
+/* "pywrapfst.pyx":697
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __iter__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":693
+ /* "pywrapfst.pyx":698
*
* 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, 693, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __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, 693, __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, 698, __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":692
+ /* "pywrapfst.pyx":697
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":695
+/* "pywrapfst.pyx":700
* 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, 695, __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, 700, __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, 695, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __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, 695, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __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, 695, __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, 700, __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":701
+ /* "pywrapfst.pyx":706
* Returns an integer indicating the next available key index in the table.
* """
* 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, 701, __pyx_L1_error)
+ __PYX_ERR(0, 706, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_table->AvailableKey();
goto __pyx_L0;
- /* "pywrapfst.pyx":695
+ /* "pywrapfst.pyx":700
* 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, 695, __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, 700, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":703
+/* "pywrapfst.pyx":708
* 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, 703, __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, 708, __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, 703, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __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, 703, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __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, 703, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 708, __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":709
+ /* "pywrapfst.pyx":714
* Returns a string indicating the label-agnostic MD5 checksum for the table.
* """
* 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, 709, __pyx_L1_error)
+ __PYX_ERR(0, 714, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_table->CheckSum();
goto __pyx_L0;
- /* "pywrapfst.pyx":703
+ /* "pywrapfst.pyx":708
* 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, 703, __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, 708, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":711
+/* "pywrapfst.pyx":716
* 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, 711, __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, 716, __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, 711, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __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, 711, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __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, 711, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_SymbolTable))))) __PYX_ERR(0, 716, __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":717
+ /* "pywrapfst.pyx":722
* 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, 717, __pyx_L1_error)
+ __PYX_ERR(0, 722, __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, 717, __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, 722, __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":711
+ /* "pywrapfst.pyx":716
* 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, 711, __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, 716, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":719
+/* "pywrapfst.pyx":724
* return _init_SymbolTable(self._table.Copy())
*
* def find(self, key): # <<<<<<<<<<<<<<
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_11find(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_10find[] = "\n find(self, key)\n\n Given a symbol or index, finds the other one.\n\n This method returns the index associated with a symbol key, or the symbol\n associated with a index key.\n\n Args:\n key: Either a string or an index.\n\n Returns:\n If key is a string, the associated index; if key is an integer, the\n associated symbol.\n\n Raises:\n KeyError: Key not found.\n ";
+static char __pyx_doc_9pywrapfst_12_SymbolTable_10find[] = "\n find(self, key)\n\n Given a symbol or index, finds the other one.\n\n This method returns the index associated with a symbol key, or the symbol\n associated with a index key.\n\n Args:\n key: Either a string or an index.\n\n Returns:\n If the key is a string, the associated index or NO_LABEL if not found; if\n the key is an integer, the associated symbol or an empty string if\n not found.\n ";
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_11find(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
}
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_10find(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key) {
- PyObject *__pyx_v_result = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
- int __pyx_t_8;
- PyObject *__pyx_t_9 = NULL;
- __pyx_t_10basictypes_int64 __pyx_t_10;
- PyObject *__pyx_t_11 = NULL;
- PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __pyx_t_10basictypes_int64 __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
__Pyx_RefNannySetupContext("find", 0);
- /* "pywrapfst.pyx":738
- * KeyError: Key not found.
+ /* "pywrapfst.pyx":741
+ * not found.
* """
* try: # <<<<<<<<<<<<<<
- * result = self._table.FindIndex(tostring(key))
- * if result == -1:
+ * return self._table.FindIndex(tostring(key))
+ * except FstArgError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
- /* "pywrapfst.pyx":739
+ /* "pywrapfst.pyx":742
* """
* try:
- * result = self._table.FindIndex(tostring(key)) # <<<<<<<<<<<<<<
- * if result == -1:
- * raise KeyError(key)
+ * return self._table.FindIndex(tostring(key)) # <<<<<<<<<<<<<<
+ * except FstArgError:
+ * return self._table.FindSymbol(key)
*/
+ __Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 739, __pyx_L3_error)
+ __PYX_ERR(0, 742, __pyx_L3_error)
}
- __pyx_t_4 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 739, __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, 739, __pyx_L3_error)
+ __pyx_t_4 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 742, __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, 742, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_v_result = __pyx_t_5;
+ __pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
+ goto __pyx_L7_try_return;
- /* "pywrapfst.pyx":740
- * 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, 740, __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, 740, __pyx_L3_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_6) {
-
- /* "pywrapfst.pyx":741
- * 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, 741, __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, 741, __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, 741, __pyx_L3_error)
-
- /* "pywrapfst.pyx":740
- * try:
- * result = self._table.FindIndex(tostring(key))
- * if result == -1: # <<<<<<<<<<<<<<
- * raise KeyError(key)
- * except FstArgError:
- */
- }
-
- /* "pywrapfst.pyx":738
- * KeyError: Key not found.
+ /* "pywrapfst.pyx":741
+ * not found.
* """
* try: # <<<<<<<<<<<<<<
- * result = self._table.FindIndex(tostring(key))
- * if result == -1:
+ * return self._table.FindIndex(tostring(key))
+ * except FstArgError:
*/
}
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L10_try_end;
__pyx_L3_error:;
__Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "pywrapfst.pyx":742
- * if result == -1:
- * raise KeyError(key)
+ /* "pywrapfst.pyx":743
+ * try:
+ * return self._table.FindIndex(tostring(key))
* except FstArgError: # <<<<<<<<<<<<<<
- * result = self._table.FindSymbol(key)
- * if result == b"":
+ * return self._table.FindSymbol(key)
+ *
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 742, __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_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (__pyx_t_6) {
__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, 742, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_7);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 743, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_9);
-
- /* "pywrapfst.pyx":743
- * raise KeyError(key)
- * except FstArgError:
- * result = self._table.FindSymbol(key) # <<<<<<<<<<<<<<
- * if result == b"":
- * raise KeyError(key)
- */
- if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 743, __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, 743, __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, 743, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_11);
- __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_8);
/* "pywrapfst.pyx":744
+ * return self._table.FindIndex(tostring(key))
* 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__5, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 744, __pyx_L5_except_error)
- if (__pyx_t_6) {
-
- /* "pywrapfst.pyx":745
- * result = self._table.FindSymbol(key)
- * if result == b"":
- * raise KeyError(key) # <<<<<<<<<<<<<<
- * return result
+ * return self._table.FindSymbol(key) # <<<<<<<<<<<<<<
*
+ * cpdef int64 get_nth_key(self, ssize_t pos) except *:
*/
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 745, __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, 745, __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, 745, __pyx_L5_except_error)
-
- /* "pywrapfst.pyx":744
- * except FstArgError:
- * result = self._table.FindSymbol(key)
- * if result == b"": # <<<<<<<<<<<<<<
- * raise KeyError(key)
- * return result
- */
+ __Pyx_XDECREF(__pyx_r);
+ if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
+ __PYX_ERR(0, 744, __pyx_L5_except_error)
}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 744, __pyx_L5_except_error)
+ __pyx_t_10 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->_table->Find(__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 744, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_r = __pyx_t_10;
+ __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- goto __pyx_L4_exception_handled;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ goto __pyx_L6_except_return;
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
- /* "pywrapfst.pyx":738
- * KeyError: Key not found.
+ /* "pywrapfst.pyx":741
+ * not found.
* """
* try: # <<<<<<<<<<<<<<
- * result = self._table.FindIndex(tostring(key))
- * if result == -1:
+ * return self._table.FindIndex(tostring(key))
+ * except FstArgError:
*/
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
- __pyx_L4_exception_handled:;
+ __pyx_L7_try_return:;
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L0;
+ __pyx_L6_except_return:;
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
- __pyx_L10_try_end:;
+ goto __pyx_L0;
}
- /* "pywrapfst.pyx":746
- * if result == b"":
- * raise KeyError(key)
- * return result # <<<<<<<<<<<<<<
- *
- * cpdef int64 get_nth_key(self, ssize_t pos) except *:
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_result);
- __pyx_r = __pyx_v_result;
- goto __pyx_L0;
-
- /* "pywrapfst.pyx":719
+ /* "pywrapfst.pyx":724
* return _init_SymbolTable(self._table.Copy())
*
* def find(self, key): # <<<<<<<<<<<<<<
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_XDECREF(__pyx_t_12);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("pywrapfst._SymbolTable.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
- __Pyx_XDECREF(__pyx_v_result);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":748
- * return result
+/* "pywrapfst.pyx":746
+ * return self._table.FindSymbol(key)
*
* cpdef int64 get_nth_key(self, ssize_t pos) except *: # <<<<<<<<<<<<<<
* """
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_13get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos); /*proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_12_SymbolTable_get_nth_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, Py_ssize_t __pyx_v_pos, int __pyx_skip_dispatch) {
- __pyx_t_10basictypes_int64 __pyx_v_result;
__pyx_t_10basictypes_int64 __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
__pyx_t_10basictypes_int64 __pyx_t_7;
- int __pyx_t_8;
__Pyx_RefNannySetupContext("get_nth_key", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nth_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __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, 746, __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_13get_nth_key)) {
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __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, 748, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __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, 748, __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, 746, __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, 748, __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, 746, __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, 748, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 746, __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, 748, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __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, 748, __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, 746, __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":763
- * KeyError: index not found.
+ /* "pywrapfst.pyx":758
+ * The integer index of the n-th key, or NO_LABEL if not found.
* """
- * cdef int64 result = self._table.GetNthKey(pos) # <<<<<<<<<<<<<<
- * if result == -1:
- * raise KeyError(pos)
+ * return self._table.GetNthKey(pos) # <<<<<<<<<<<<<<
+ *
+ * cpdef string labeled_checksum(self):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 763, __pyx_L1_error)
- }
- __pyx_v_result = __pyx_v_self->_table->GetNthKey(__pyx_v_pos);
-
- /* "pywrapfst.pyx":764
- * """
- * cdef int64 result = self._table.GetNthKey(pos)
- * if result == -1: # <<<<<<<<<<<<<<
- * raise KeyError(pos)
- * return result
- */
- __pyx_t_8 = ((__pyx_v_result == -1L) != 0);
- if (__pyx_t_8) {
-
- /* "pywrapfst.pyx":765
- * 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, 765, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __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, 765, __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, 765, __pyx_L1_error)
-
- /* "pywrapfst.pyx":764
- * """
- * cdef int64 result = self._table.GetNthKey(pos)
- * if result == -1: # <<<<<<<<<<<<<<
- * raise KeyError(pos)
- * return result
- */
+ __PYX_ERR(0, 758, __pyx_L1_error)
}
-
- /* "pywrapfst.pyx":766
- * if result == -1:
- * raise KeyError(pos)
- * return result # <<<<<<<<<<<<<<
- *
- * cpdef string labeled_checksum(self):
- */
- __pyx_r = __pyx_v_result;
+ __pyx_r = __pyx_v_self->_table->GetNthKey(__pyx_v_pos);
goto __pyx_L0;
- /* "pywrapfst.pyx":748
- * return result
+ /* "pywrapfst.pyx":746
+ * return self._table.FindSymbol(key)
*
* cpdef int64 get_nth_key(self, ssize_t pos) except *: # <<<<<<<<<<<<<<
* """
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_13get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_12get_nth_key[] = "\n get_nth_key(self, pos)\n\n Retrieves the integer index of the n-th key in the table.\n\n Args:\n pos: The n-th key to retrieve.\n\n Returns:\n The integer index of the n-th key.\n\n Raises:\n KeyError: index not found.\n ";
+static char __pyx_doc_9pywrapfst_12_SymbolTable_12get_nth_key[] = "\n get_nth_key(self, pos)\n\n Retrieves the integer index of the n-th key in the table.\n\n Args:\n pos: The n-th key to retrieve.\n\n Returns:\n The integer index of the n-th key, or NO_LABEL if not found.\n ";
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_13get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos) {
Py_ssize_t __pyx_v_pos;
PyObject *__pyx_r = 0;
__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, 748, __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, 746, __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, 748, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __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, 746, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":768
- * return result
+/* "pywrapfst.pyx":760
+ * return self._table.GetNthKey(pos)
*
* 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, 768, __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, 760, __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_15labeled_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, 768, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __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, 768, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __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, 768, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 760, __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":766
* Returns a string indicating the label-dependent MD5 checksum for the table.
* """
* 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, 766, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_table->LabeledCheckSum();
goto __pyx_L0;
- /* "pywrapfst.pyx":768
- * return result
+ /* "pywrapfst.pyx":760
+ * return self._table.GetNthKey(pos)
*
* 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, 768, __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, 760, __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":768
* return self._table.LabeledCheckSum()
*
* 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, 776, __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, 768, __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_17member)) {
__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, 776, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __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, 776, __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, 768, __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, 776, __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, 768, __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, 776, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 768, __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, 776, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __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, 776, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 768, __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":792
+ /* "pywrapfst.pyx":784
* 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":793
+ /* "pywrapfst.pyx":785
* """
* 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, 793, __pyx_L3_error)
+ __PYX_ERR(0, 785, __pyx_L3_error)
}
- __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 793, __pyx_L3_error)
+ __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 785, __pyx_L3_error)
__pyx_r = __pyx_v_self->_table->Member(__pyx_t_10);
goto __pyx_L7_try_return;
- /* "pywrapfst.pyx":792
+ /* "pywrapfst.pyx":784
* 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":794
+ /* "pywrapfst.pyx":786
* 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, 794, __pyx_L5_except_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __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, 794, __pyx_L5_except_error)
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 786, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":795
+ /* "pywrapfst.pyx":787
* 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, 795, __pyx_L5_except_error)
+ __PYX_ERR(0, 787, __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, 795, __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, 787, __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":792
+ /* "pywrapfst.pyx":784
* Whether or not the key is present (as a string or a index) in the table.
* """
* try: # <<<<<<<<<<<<<<
goto __pyx_L0;
}
- /* "pywrapfst.pyx":776
+ /* "pywrapfst.pyx":768
* return self._table.LabeledCheckSum()
*
* 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, 776, __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, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":797
+/* "pywrapfst.pyx":789
* return self._table.MemberIndex(key)
*
* def __contains__(self, key): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__contains__", 0);
- /* "pywrapfst.pyx":798
+ /* "pywrapfst.pyx":790
*
* 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, 798, __pyx_L1_error)
+ __PYX_ERR(0, 790, __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":797
+ /* "pywrapfst.pyx":789
* return self._table.MemberIndex(key)
*
* def __contains__(self, key): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":800
+/* "pywrapfst.pyx":792
* return self.member(key)
*
* 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, 800, __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, 792, __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, 800, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 792, __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, 800, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 792, __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, 800, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 792, __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":806
+ /* "pywrapfst.pyx":798
* Returns the symbol table's name.
* """
* 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, 806, __pyx_L1_error)
+ __PYX_ERR(0, 798, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_table->Name();
goto __pyx_L0;
- /* "pywrapfst.pyx":800
+ /* "pywrapfst.pyx":792
* return self.member(key)
*
* 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, 800, __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, 792, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":808
+/* "pywrapfst.pyx":800
* 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, 808, __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, 800, __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, 808, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __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, 808, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __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, 808, __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, 800, __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":814
+ /* "pywrapfst.pyx":806
* Returns the number of symbols in the symbol table.
* """
* 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, 814, __pyx_L1_error)
+ __PYX_ERR(0, 806, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_table->NumSymbols();
goto __pyx_L0;
- /* "pywrapfst.pyx":808
+ /* "pywrapfst.pyx":800
* 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, 808, __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, 800, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":816
+/* "pywrapfst.pyx":808
* 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, 816, __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, 808, __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, 816, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __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, 816, __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, 808, __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, 816, __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, 808, __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, 816, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 808, __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, 816, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __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":830
+ /* "pywrapfst.pyx":822
* 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, 830, __pyx_L1_error)
+ __PYX_ERR(0, 822, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 822, __pyx_L1_error)
__pyx_t_7 = ((!(__pyx_v_self->_table->Write(__pyx_t_6) != 0)) != 0);
if (__pyx_t_7) {
- /* "pywrapfst.pyx":831
+ /* "pywrapfst.pyx":823
* """
* 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, 831, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __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, 831, __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, 823, __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, 831, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 823, __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, 831, __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, 823, __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, 831, __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, 823, __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, 831, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 823, __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, 831, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 823, __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, 831, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __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, 831, __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, 823, __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, 831, __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, 823, __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, 831, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 823, __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, 831, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __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, 831, __pyx_L1_error)
+ __PYX_ERR(0, 823, __pyx_L1_error)
- /* "pywrapfst.pyx":830
+ /* "pywrapfst.pyx":822
* FstIOError: Write failed.
* """
* if not self._table.Write(tostring(filename)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":816
+ /* "pywrapfst.pyx":808
* 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, 816, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
+ __pyx_f_9pywrapfst_12_SymbolTable_write(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":833
+/* "pywrapfst.pyx":825
* 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, 833, __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, 825, __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, 833, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __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, 833, __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, 825, __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, 833, __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, 825, __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, 833, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 825, __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, 833, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __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":847
+ /* "pywrapfst.pyx":839
* 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, 847, __pyx_L1_error)
+ __PYX_ERR(0, 839, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 847, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L1_error)
__pyx_t_7 = ((!(__pyx_v_self->_table->WriteText(__pyx_t_6) != 0)) != 0);
if (__pyx_t_7) {
- /* "pywrapfst.pyx":848
+ /* "pywrapfst.pyx":840
* """
* 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, 848, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 840, __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, 848, __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, 840, __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, 848, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __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, 848, __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, 840, __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, 848, __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, 840, __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, 848, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 840, __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, 848, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __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, 848, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __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, 848, __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, 840, __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, 848, __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, 840, __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, 848, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 840, __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, 848, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __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, 848, __pyx_L1_error)
+ __PYX_ERR(0, 840, __pyx_L1_error)
- /* "pywrapfst.pyx":847
+ /* "pywrapfst.pyx":839
* FstIOError: Write failed.
* """
* if not self._table.WriteText(tostring(filename)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":833
+ /* "pywrapfst.pyx":825
* 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, 833, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
+ __pyx_f_9pywrapfst_12_SymbolTable_write_text(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 825, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":866
+/* "pywrapfst.pyx":858
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":867
+ /* "pywrapfst.pyx":859
*
* 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, 867, __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, 859, __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, 867, __pyx_L1_error)
+ __PYX_ERR(0, 859, __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, 867, __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, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":868
+ /* "pywrapfst.pyx":860
* 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, 868, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 860, __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, 868, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 860, __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, 867, __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, 859, __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, 867, __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, 859, __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, 867, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 859, __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, 867, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __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":866
+ /* "pywrapfst.pyx":858
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":885
+/* "pywrapfst.pyx":877
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":886
+ /* "pywrapfst.pyx":878
*
* 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, 886, __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, 878, __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, 886, __pyx_L1_error)
+ __PYX_ERR(0, 878, __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, 886, __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, 878, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":887
+ /* "pywrapfst.pyx":879
* 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, 887, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __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, 887, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __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, 886, __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, 878, __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, 886, __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, 878, __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, 886, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 878, __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, 886, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __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":885
+ /* "pywrapfst.pyx":877
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":901
+/* "pywrapfst.pyx":893
* """
*
- * cpdef int64 add_symbol(self, symbol, int64 key=-1): # <<<<<<<<<<<<<<
+ * cpdef int64 add_symbol(self, symbol, int64 key=kNoSymbol): # <<<<<<<<<<<<<<
* """
- * add_symbol(self, symbol, key=-1)
+ * add_symbol(self, symbol, key=NO_SYMBOL)
*/
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args) {
- __pyx_t_10basictypes_int64 __pyx_v_key = ((__pyx_t_10basictypes_int64)-1L);
- PyObject *__pyx_v_symbol_string = 0;
+ __pyx_t_10basictypes_int64 __pyx_v_key = __pyx_k__5;
+ std::string __pyx_v_symbol_string;
__pyx_t_10basictypes_int64 __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
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, 901, __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, 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_1add_symbol)) {
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 901, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 893, __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, 901, __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, 893, __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, 901, __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, 893, __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, 901, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 893, __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, 901, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __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, 901, __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, 893, __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":917
+ /* "pywrapfst.pyx":910
* The integer key of the new symbol.
* """
- * cdef symbol_string = tostring(symbol) # <<<<<<<<<<<<<<
- * if key != -1:
+ * cdef string symbol_string = tostring(symbol) # <<<<<<<<<<<<<<
+ * if key != kNoSymbol:
* 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, 917, __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, 917, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_symbol_string = __pyx_t_1;
- __pyx_t_1 = 0;
+ __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_symbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 910, __pyx_L1_error)
+ __pyx_v_symbol_string = __pyx_t_9;
- /* "pywrapfst.pyx":918
+ /* "pywrapfst.pyx":911
* """
- * cdef symbol_string = tostring(symbol)
- * if key != -1: # <<<<<<<<<<<<<<
+ * cdef string symbol_string = tostring(symbol)
+ * if key != kNoSymbol: # <<<<<<<<<<<<<<
* return self._table.AddSymbol(symbol_string, key)
* else:
*/
- __pyx_t_10 = ((__pyx_v_key != -1L) != 0);
+ __pyx_t_10 = ((__pyx_v_key != __pyx_v_9pywrapfst_kNoSymbol) != 0);
if (__pyx_t_10) {
- /* "pywrapfst.pyx":919
- * cdef symbol_string = tostring(symbol)
- * if key != -1:
+ /* "pywrapfst.pyx":912
+ * cdef string symbol_string = tostring(symbol)
+ * if key != kNoSymbol:
* return self._table.AddSymbol(symbol_string, key) # <<<<<<<<<<<<<<
* else:
* return self._table.AddSymbol(symbol_string)
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 919, __pyx_L1_error)
+ __PYX_ERR(0, 912, __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, 919, __pyx_L1_error)
- __pyx_r = __pyx_v_self->__pyx_base._table->AddSymbol(__pyx_t_9, __pyx_v_key);
+ __pyx_r = __pyx_v_self->__pyx_base._table->AddSymbol(__pyx_v_symbol_string, __pyx_v_key);
goto __pyx_L0;
- /* "pywrapfst.pyx":918
+ /* "pywrapfst.pyx":911
* """
- * cdef symbol_string = tostring(symbol)
- * if key != -1: # <<<<<<<<<<<<<<
+ * cdef string symbol_string = tostring(symbol)
+ * if key != kNoSymbol: # <<<<<<<<<<<<<<
* return self._table.AddSymbol(symbol_string, key)
* else:
*/
}
- /* "pywrapfst.pyx":921
+ /* "pywrapfst.pyx":914
* 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, 921, __pyx_L1_error)
+ __PYX_ERR(0, 914, __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, 921, __pyx_L1_error)
- __pyx_r = __pyx_v_self->__pyx_base._table->AddSymbol(__pyx_t_9);
+ __pyx_r = __pyx_v_self->__pyx_base._table->AddSymbol(__pyx_v_symbol_string);
goto __pyx_L0;
}
- /* "pywrapfst.pyx":901
+ /* "pywrapfst.pyx":893
* """
*
- * cpdef int64 add_symbol(self, symbol, int64 key=-1): # <<<<<<<<<<<<<<
+ * cpdef int64 add_symbol(self, symbol, int64 key=kNoSymbol): # <<<<<<<<<<<<<<
* """
- * add_symbol(self, symbol, key=-1)
+ * add_symbol(self, symbol, key=NO_SYMBOL)
*/
/* function exit code */
__Pyx_WriteUnraisable("pywrapfst._MutableSymbolTable.add_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF(__pyx_v_symbol_string);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_19_MutableSymbolTable_add_symbol[] = "\n add_symbol(self, symbol, key=-1)\n\n Adds a symbol to the table and returns the index.\n\n This method adds a symbol to the table. The caller can optionally\n specify a non-negative integer index for the key.\n\n Args:\n symbol: A symbol string.\n key: An index for the symbol (-1 is reserved for \"no symbol requested\").\n\n Returns:\n The integer key of the new symbol.\n ";
+static char __pyx_doc_9pywrapfst_19_MutableSymbolTable_add_symbol[] = "\n add_symbol(self, symbol, key=NO_SYMBOL)\n\n Adds a symbol to the table and returns the index.\n\n This method adds a symbol to the table. The caller can optionally\n specify a non-negative integer index for the key.\n\n Args:\n symbol: A symbol string.\n key: An index for the symbol; if not specified, the next index will be\n used.\n\n Returns:\n The integer key of the new symbol.\n ";
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_symbol = 0;
__pyx_t_10basictypes_int64 __pyx_v_key;
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symbol") < 0)) __PYX_ERR(0, 901, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symbol") < 0)) __PYX_ERR(0, 893, __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, 901, __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, 893, __pyx_L3_error)
} else {
- __pyx_v_key = ((__pyx_t_10basictypes_int64)-1L);
+ __pyx_v_key = __pyx_k__5;
}
}
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, 901, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add_symbol", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 893, __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, 901, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 893, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":923
+/* "pywrapfst.pyx":916
* 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, 923, __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, 916, __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, 923, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_syms)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __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, 923, __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, 916, __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, 923, __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, 916, __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, 923, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __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, 923, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __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":935
+ /* "pywrapfst.pyx":928
* 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, 935, __pyx_L1_error)
+ __PYX_ERR(0, 928, __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, 935, __pyx_L1_error)
+ __PYX_ERR(0, 928, __pyx_L1_error)
}
__pyx_v_self->__pyx_base._table->AddTable((*__pyx_v_syms->_table));
- /* "pywrapfst.pyx":923
+ /* "pywrapfst.pyx":916
* 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, 923, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 916, __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, 923, __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, 916, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":937
+/* "pywrapfst.pyx":930
* 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, 937, __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, 930, __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, 937, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_new_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __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, 937, __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, 930, __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, 937, __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, 930, __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, 937, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 930, __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, 937, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __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":938
+ /* "pywrapfst.pyx":931
*
* 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, 938, __pyx_L1_error)
+ __PYX_ERR(0, 931, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_new_name, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 938, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_new_name, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 931, __pyx_L1_error)
__pyx_v_self->__pyx_base._table->SetName(__pyx_t_6);
- /* "pywrapfst.pyx":937
+ /* "pywrapfst.pyx":930
* 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, 937, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __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, 930, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":948
+/* "pywrapfst.pyx":941
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":949
+ /* "pywrapfst.pyx":942
*
* 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, 949, __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, 942, __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, 949, __pyx_L1_error)
+ __PYX_ERR(0, 942, __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, 949, __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, 942, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 949, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 942, __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, 949, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 942, __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, 949, __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, 942, __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, 949, __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, 942, __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, 949, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 942, __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, 949, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __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":948
+ /* "pywrapfst.pyx":941
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":969
+/* "pywrapfst.pyx":962
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":970
+ /* "pywrapfst.pyx":963
*
* 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, 970, __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, 963, __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, 970, __pyx_L1_error)
+ __PYX_ERR(0, 963, __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, 970, __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, 963, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 970, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 963, __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, 970, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 963, __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, 970, __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, 963, __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, 970, __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, 963, __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, 970, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 963, __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, 970, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __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":969
+ /* "pywrapfst.pyx":962
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":972
+/* "pywrapfst.pyx":965
* 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, 972, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 965, __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, 972, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 965, __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":973
+ /* "pywrapfst.pyx":966
*
* 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, 973, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_name, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 966, __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, 973, __pyx_L1_error)
+ __PYX_ERR(0, 966, __pyx_L1_error)
}
__pyx_v_self->__pyx_base.__pyx_base._table = new fst::SymbolTable(__pyx_t_1);
- /* "pywrapfst.pyx":974
+ /* "pywrapfst.pyx":967
* 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, 974, __pyx_L1_error)
+ __PYX_ERR(0, 967, __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, 974, __pyx_L1_error)
+ __PYX_ERR(0, 967, __pyx_L1_error)
}
__pyx_v_self->_smart_table.reset(__pyx_v_self->__pyx_base.__pyx_base._table);
- /* "pywrapfst.pyx":972
+ /* "pywrapfst.pyx":965
* return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))
*
* def __init__(self, name=b"<unspecified>"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":977
+/* "pywrapfst.pyx":970
*
* @classmethod
* def read(cls, filename): # <<<<<<<<<<<<<<
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("read", 0);
- /* "pywrapfst.pyx":993
+ /* "pywrapfst.pyx":986
* 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, 993, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 986, __pyx_L1_error)
__pyx_v_tsyms = fst::SymbolTable::Read(__pyx_t_1);
- /* "pywrapfst.pyx":994
+ /* "pywrapfst.pyx":987
* """
* 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":995
+ /* "pywrapfst.pyx":988
* 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, 995, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 988, __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, 995, __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, 988, __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, 995, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 988, __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, 995, __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, 988, __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, 995, __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, 988, __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, 995, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 988, __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, 995, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 988, __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, 995, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 988, __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, 995, __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, 988, __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, 995, __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, 988, __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, 995, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 988, __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, 995, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 988, __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, 995, __pyx_L1_error)
+ __PYX_ERR(0, 988, __pyx_L1_error)
- /* "pywrapfst.pyx":994
+ /* "pywrapfst.pyx":987
* """
* cdef fst.SymbolTable *tsyms = fst.SymbolTable.Read(tostring(filename))
* if tsyms == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":996
+ /* "pywrapfst.pyx":989
* 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, 996, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_tsyms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 989, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":977
+ /* "pywrapfst.pyx":970
*
* @classmethod
* def read(cls, filename): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":999
+/* "pywrapfst.pyx":992
*
* @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, 999, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_text") < 0)) __PYX_ERR(0, 992, __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, 999, __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, 992, __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, 999, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_text", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 992, __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":1018
+ /* "pywrapfst.pyx":1011
* """
* 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":1019
+ /* "pywrapfst.pyx":1012
* 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, 1019, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1012, __pyx_L1_error)
- /* "pywrapfst.pyx":1020
+ /* "pywrapfst.pyx":1013
* 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":1021
+ /* "pywrapfst.pyx":1014
* 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":1022
+ /* "pywrapfst.pyx":1015
* 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, 1022, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1015, __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, 1022, __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, 1015, __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, 1022, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1015, __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, 1022, __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, 1015, __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, 1022, __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, 1015, __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, 1022, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1015, __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, 1022, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1015, __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, 1022, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __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, 1022, __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, 1015, __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, 1022, __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, 1015, __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, 1022, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1015, __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, 1022, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __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, 1022, __pyx_L1_error)
+ __PYX_ERR(0, 1015, __pyx_L1_error)
- /* "pywrapfst.pyx":1021
+ /* "pywrapfst.pyx":1014
* cdef fst.SymbolTable *tsyms = fst.SymbolTable.ReadText(tostring(filename),
* deref(opts))
* if tsyms == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1023
+ /* "pywrapfst.pyx":1016
* 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, 1023, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_tsyms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":999
+ /* "pywrapfst.pyx":992
*
* @classmethod
* def read_text(cls, filename, bool allow_negative_labels=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1026
+/* "pywrapfst.pyx":1019
*
* @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, 1026, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, 1); __PYX_ERR(0, 1019, __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, 1026, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_fst") < 0)) __PYX_ERR(0, 1019, __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, 1026, __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, 1019, __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, 1026, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1019, __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":1048
+ /* "pywrapfst.pyx":1041
* 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, 1048, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_filename); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1041, __pyx_L1_error)
__pyx_v_tsyms = fst::FstReadSymbols(__pyx_t_1, __pyx_v_input_table);
- /* "pywrapfst.pyx":1049
+ /* "pywrapfst.pyx":1042
* """
* 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":1050
+ /* "pywrapfst.pyx":1043
* 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, 1050, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1043, __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, 1050, __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, 1043, __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, 1050, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1043, __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, 1050, __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, 1043, __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, 1050, __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, 1043, __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, 1050, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1043, __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, 1050, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1043, __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, 1050, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1043, __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, 1050, __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, 1043, __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, 1050, __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, 1043, __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, 1050, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1043, __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, 1050, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1043, __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, 1050, __pyx_L1_error)
+ __PYX_ERR(0, 1043, __pyx_L1_error)
- /* "pywrapfst.pyx":1049
+ /* "pywrapfst.pyx":1042
* """
* cdef fst.SymbolTable *tsyms = fst.FstReadSymbols(filename, input_table)
* if tsyms == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1051
+ /* "pywrapfst.pyx":1044
* 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, 1051, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_tsyms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1026
+ /* "pywrapfst.pyx":1019
*
* @classmethod
* def read_fst(cls, filename, bool input_table): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1054
+/* "pywrapfst.pyx":1047
*
*
* cdef _EncodeMapperSymbolTable _init_EncodeMapperSymbolTable( # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_init_EncodeMapperSymbolTable", 0);
- /* "pywrapfst.pyx":1057
+ /* "pywrapfst.pyx":1050
* 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, 1057, __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, 1050, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTable)))) __PYX_ERR(0, 1057, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTable)))) __PYX_ERR(0, 1050, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1058
+ /* "pywrapfst.pyx":1051
* 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, 1058, __pyx_L1_error)
+ __PYX_ERR(0, 1051, __pyx_L1_error)
}
__pyx_v_result->__pyx_base._table = __pyx_v_table;
- /* "pywrapfst.pyx":1059
+ /* "pywrapfst.pyx":1052
* _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, 1059, __pyx_L1_error)
+ __PYX_ERR(0, 1052, __pyx_L1_error)
}
__pyx_v_result->_encoder = __pyx_v_encoder;
- /* "pywrapfst.pyx":1060
+ /* "pywrapfst.pyx":1053
* result._table = table
* result._encoder = encoder
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1054
+ /* "pywrapfst.pyx":1047
*
*
* cdef _EncodeMapperSymbolTable _init_EncodeMapperSymbolTable( # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1063
+/* "pywrapfst.pyx":1056
*
*
* cdef _FstSymbolTable _init_FstSymbolTable(fst.SymbolTable *table, # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_init_FstSymbolTable", 0);
- /* "pywrapfst.pyx":1065
+ /* "pywrapfst.pyx":1058
* 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, 1065, __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, 1058, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__FstSymbolTable)))) __PYX_ERR(0, 1065, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__FstSymbolTable)))) __PYX_ERR(0, 1058, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1066
+ /* "pywrapfst.pyx":1059
* 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, 1066, __pyx_L1_error)
+ __PYX_ERR(0, 1059, __pyx_L1_error)
}
__pyx_v_result->__pyx_base._table = __pyx_v_table;
- /* "pywrapfst.pyx":1067
+ /* "pywrapfst.pyx":1060
* 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, 1067, __pyx_L1_error)
+ __PYX_ERR(0, 1060, __pyx_L1_error)
}
__pyx_v_result->_fst = __pyx_v_ifst;
- /* "pywrapfst.pyx":1068
+ /* "pywrapfst.pyx":1061
* result._table = table
* result._fst = ifst
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1063
+ /* "pywrapfst.pyx":1056
*
*
* cdef _FstSymbolTable _init_FstSymbolTable(fst.SymbolTable *table, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1071
+/* "pywrapfst.pyx":1064
*
*
* cdef _MutableFstSymbolTable _init_MutableFstSymbolTable(fst.SymbolTable *table, # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_init_MutableFstSymbolTable", 0);
- /* "pywrapfst.pyx":1074
+ /* "pywrapfst.pyx":1067
* 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, 1074, __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, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__MutableFstSymbolTable)))) __PYX_ERR(0, 1074, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__MutableFstSymbolTable)))) __PYX_ERR(0, 1067, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1075
+ /* "pywrapfst.pyx":1068
* 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, 1075, __pyx_L1_error)
+ __PYX_ERR(0, 1068, __pyx_L1_error)
}
__pyx_v_result->__pyx_base.__pyx_base._table = __pyx_v_table;
- /* "pywrapfst.pyx":1076
+ /* "pywrapfst.pyx":1069
* _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, 1076, __pyx_L1_error)
+ __PYX_ERR(0, 1069, __pyx_L1_error)
}
__pyx_v_result->_mfst = __pyx_v_ifst;
- /* "pywrapfst.pyx":1077
+ /* "pywrapfst.pyx":1070
* result._table = table
* result._mfst = ifst
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1071
+ /* "pywrapfst.pyx":1064
*
*
* cdef _MutableFstSymbolTable _init_MutableFstSymbolTable(fst.SymbolTable *table, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1080
+/* "pywrapfst.pyx":1073
*
*
* cdef SymbolTable _init_SymbolTable(fst.SymbolTable *table): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_init_SymbolTable", 0);
- /* "pywrapfst.pyx":1081
+ /* "pywrapfst.pyx":1074
*
* 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, 1081, __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, 1074, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_SymbolTable)))) __PYX_ERR(0, 1081, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_SymbolTable)))) __PYX_ERR(0, 1074, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1082
+ /* "pywrapfst.pyx":1075
* 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, 1082, __pyx_L1_error)
+ __PYX_ERR(0, 1075, __pyx_L1_error)
}
__pyx_v_result->__pyx_base.__pyx_base._table = __pyx_v_table;
- /* "pywrapfst.pyx":1083
+ /* "pywrapfst.pyx":1076
* cdef SymbolTable result = SymbolTable.__new__(SymbolTable)
* result._table = table
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1080
+ /* "pywrapfst.pyx":1073
*
*
* cdef SymbolTable _init_SymbolTable(fst.SymbolTable *table): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1089
+/* "pywrapfst.pyx":1082
*
*
* cpdef SymbolTable compact_symbol_table(_SymbolTable syms): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("compact_symbol_table", 0);
- /* "pywrapfst.pyx":1101
+ /* "pywrapfst.pyx":1094
* 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, 1101, __pyx_L1_error)
+ __PYX_ERR(0, 1094, __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, 1101, __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, 1094, __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":1089
+ /* "pywrapfst.pyx":1082
*
*
* 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, 1089, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1082, __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, 1089, __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, 1082, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1104
+/* "pywrapfst.pyx":1097
*
*
* cpdef SymbolTable merge_symbol_table(_SymbolTable lhs, _SymbolTable rhs): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("merge_symbol_table", 0);
- /* "pywrapfst.pyx":1128
+ /* "pywrapfst.pyx":1121
* 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, 1128, __pyx_L1_error)
+ __PYX_ERR(0, 1121, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1129
+ /* "pywrapfst.pyx":1122
* """
* 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, 1129, __pyx_L1_error)
+ __PYX_ERR(0, 1122, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1128
+ /* "pywrapfst.pyx":1121
* 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, 1128, __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, 1121, __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":1104
+ /* "pywrapfst.pyx":1097
*
*
* 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, 1104, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, 1); __PYX_ERR(0, 1097, __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, 1104, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "merge_symbol_table") < 0)) __PYX_ERR(0, 1097, __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, 1104, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1097, __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, 1104, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst__SymbolTable, 1, "rhs", 0))) __PYX_ERR(0, 1104, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst__SymbolTable, 1, "lhs", 0))) __PYX_ERR(0, 1097, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst__SymbolTable, 1, "rhs", 0))) __PYX_ERR(0, 1097, __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, 1104, __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, 1097, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1143
+/* "pywrapfst.pyx":1136
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1144
+ /* "pywrapfst.pyx":1137
*
* 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, 1144, __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, 1137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __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, 1144, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __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, 1144, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1137, __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, 1144, __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, 1137, __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, 1144, __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, 1137, __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, 1144, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1137, __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, 1144, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1137, __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":1143
+ /* "pywrapfst.pyx":1136
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1146
+/* "pywrapfst.pyx":1139
* 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, 1146, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1139, __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, 1146, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1139, __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, 1146, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1139, __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":1147
+ /* "pywrapfst.pyx":1140
*
* 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, 1147, __pyx_L1_error)
+ __PYX_ERR(0, 1140, __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, 1147, __pyx_L1_error)
+ __PYX_ERR(0, 1140, __pyx_L1_error)
}
__pyx_v_self->_siter.reset(new fst::SymbolTableIterator((*__pyx_v_syms->_table)));
- /* "pywrapfst.pyx":1146
+ /* "pywrapfst.pyx":1139
* return "<SymbolTableIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _SymbolTable syms): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1150
+/* "pywrapfst.pyx":1143
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":1151
+ /* "pywrapfst.pyx":1144
* # 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":1150
+ /* "pywrapfst.pyx":1143
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1154
+/* "pywrapfst.pyx":1147
*
* # 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":1155
+ /* "pywrapfst.pyx":1148
* # 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, 1155, __pyx_L1_error)
+ __PYX_ERR(0, 1148, __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":1156
+ /* "pywrapfst.pyx":1149
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* cdef string symbol = self.symbol()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 1156, __pyx_L1_error)
+ __PYX_ERR(0, 1149, __pyx_L1_error)
- /* "pywrapfst.pyx":1155
+ /* "pywrapfst.pyx":1148
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1157
+ /* "pywrapfst.pyx":1150
* 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, 1157, __pyx_L1_error)
+ __PYX_ERR(0, 1150, __pyx_L1_error)
}
__pyx_v_value = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0);
- /* "pywrapfst.pyx":1158
+ /* "pywrapfst.pyx":1151
* 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, 1158, __pyx_L1_error)
+ __PYX_ERR(0, 1151, __pyx_L1_error)
}
__pyx_v_symbol = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *)__pyx_v_self->__pyx_vtab)->symbol(__pyx_v_self, 0);
- /* "pywrapfst.pyx":1159
+ /* "pywrapfst.pyx":1152
* 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, 1159, __pyx_L1_error)
+ __PYX_ERR(0, 1152, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":1160
+ /* "pywrapfst.pyx":1153
* 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, 1160, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __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, 1160, __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, 1153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1160, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __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":1154
+ /* "pywrapfst.pyx":1147
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1162
+/* "pywrapfst.pyx":1155
* 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, 1162, __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, 1155, __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, 1162, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __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, 1162, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __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, 1162, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1155, __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":1171
+ /* "pywrapfst.pyx":1164
* 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, 1171, __pyx_L1_error)
+ __PYX_ERR(0, 1164, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":1162
+ /* "pywrapfst.pyx":1155
* 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, 1162, __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, 1155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1173
+/* "pywrapfst.pyx":1166
* 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, 1173, __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, 1166, __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, 1173, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __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, 1173, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __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":1179
+ /* "pywrapfst.pyx":1172
* Advances the iterator.
* """
* 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, 1179, __pyx_L1_error)
+ __PYX_ERR(0, 1172, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Next();
- /* "pywrapfst.pyx":1173
+ /* "pywrapfst.pyx":1166
* 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, 1173, __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, 1166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1181
+/* "pywrapfst.pyx":1174
* 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, 1181, __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, 1174, __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, 1181, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __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, 1181, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __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":1187
+ /* "pywrapfst.pyx":1180
* Resets the iterator to the initial position.
* """
* self._siter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
- __PYX_ERR(0, 1187, __pyx_L1_error)
+ __PYX_ERR(0, 1180, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Reset();
- /* "pywrapfst.pyx":1181
+ /* "pywrapfst.pyx":1174
* 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, 1181, __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, 1174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1189
+/* "pywrapfst.pyx":1182
* 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, 1189, __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, 1182, __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, 1189, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __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, 1189, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __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, 1189, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1182, __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":1200
+ /* "pywrapfst.pyx":1193
* 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, 1200, __pyx_L1_error)
+ __PYX_ERR(0, 1193, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Symbol();
goto __pyx_L0;
- /* "pywrapfst.pyx":1189
+ /* "pywrapfst.pyx":1182
* 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, 1189, __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, 1182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1202
+/* "pywrapfst.pyx":1195
* 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, 1202, __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, 1195, __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, 1202, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __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, 1202, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __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, 1202, __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, 1195, __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":1204
* 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, 1204, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Value();
goto __pyx_L0;
- /* "pywrapfst.pyx":1202
+ /* "pywrapfst.pyx":1195
* 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, 1202, __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, 1195, __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":1233
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1241
+ /* "pywrapfst.pyx":1234
*
* 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, 1234, __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, 1234, __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, 1234, __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, 1234, __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, 1234, __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, 1234, __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, 1234, __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, 1234, __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":1233
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1243
+/* "pywrapfst.pyx":1236
* 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, 1236, __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, 1238, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1245
+ /* "pywrapfst.pyx":1238
* 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, 1239, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1246
+ /* "pywrapfst.pyx":1239
* 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, 1236, __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":1236
* 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":1240
* 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":1241
* 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, 1241, __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, 1241, __pyx_L1_error)
- /* "pywrapfst.pyx":1249
+ /* "pywrapfst.pyx":1242
* 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":1243
* 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, 1243, __pyx_L1_error)
}
__pyx_t_2 = ((!__pyx_v_self->_encoder) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":1251
+ /* "pywrapfst.pyx":1244
* 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, 1244, __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, 1244, __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, 1244, __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, 1244, __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, 1244, __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, 1244, __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, 1244, __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, 1244, __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, 1244, __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, 1244, __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, 1244, __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, 1244, __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, 1244, __pyx_L1_error)
- /* "pywrapfst.pyx":1250
+ /* "pywrapfst.pyx":1243
* self._encoder.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
* fst.ENCODE))
* if not self._encoder: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1243
+ /* "pywrapfst.pyx":1236
* return "<EncodeMapper at 0x{:x}>".format(id(self))
*
* def __init__(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1253
+/* "pywrapfst.pyx":1246
* 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, 1246, __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, 1246, __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, 1246, __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, 1246, __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":1259
+ /* "pywrapfst.pyx":1252
* Returns a string indicating the arc type.
* """
* 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, 1259, __pyx_L1_error)
+ __PYX_ERR(0, 1252, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_encoder.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1253
+ /* "pywrapfst.pyx":1246
* 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, 1246, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1263
+/* "pywrapfst.pyx":1256
* # 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, 1263, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 1256, __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, 1263, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1256, __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, 1263, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1256, __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":1279
+ /* "pywrapfst.pyx":1272
* 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, 1279, __pyx_L1_error)
+ __PYX_ERR(0, 1272, __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, 1279, __pyx_L1_error)
+ __PYX_ERR(0, 1272, __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, 1279, __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, 1272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1263
+ /* "pywrapfst.pyx":1256
* # Python's equivalent to operator().
*
* def __call__(self, Arc arc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1281
+/* "pywrapfst.pyx":1274
* 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, 1281, __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, 1274, __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, 1281, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __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, 1281, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __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, 1281, __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, 1274, __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":1287
+ /* "pywrapfst.pyx":1280
* Returns the encoder's flags.
* """
* 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, 1287, __pyx_L1_error)
+ __PYX_ERR(0, 1280, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_encoder.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":1281
+ /* "pywrapfst.pyx":1274
* 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, 1281, __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, 1274, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1289
+/* "pywrapfst.pyx":1282
* 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, 1289, __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, 1282, __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, 1289, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1282, __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, 1289, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1282, __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, 1289, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTable))))) __PYX_ERR(0, 1282, __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":1296
+ /* "pywrapfst.pyx":1289
* """
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
* self._encoder.get().InputSymbols()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1296, __pyx_L1_error)
+ __PYX_ERR(0, 1289, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1295
+ /* "pywrapfst.pyx":1288
* Returns the encoder's input symbol table, or None if none is present.
* """
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr]( # <<<<<<<<<<<<<<
*/
__pyx_v_syms = const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_encoder.get()->InputSymbols());
- /* "pywrapfst.pyx":1297
+ /* "pywrapfst.pyx":1290
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
* self._encoder.get().InputSymbols())
* if syms == NULL: # <<<<<<<<<<<<<<
__pyx_t_5 = ((__pyx_v_syms == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1298
+ /* "pywrapfst.pyx":1291
* self._encoder.get().InputSymbols())
* if syms == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1297
+ /* "pywrapfst.pyx":1290
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
* self._encoder.get().InputSymbols())
* if syms == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1299
+ /* "pywrapfst.pyx":1292
* if syms == NULL:
* return
* return _init_EncodeMapperSymbolTable(syms, self._encoder) # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1299, __pyx_L1_error)
+ __PYX_ERR(0, 1292, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable(__pyx_v_syms, __pyx_v_self->_encoder)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable(__pyx_v_syms, __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":1289
+ /* "pywrapfst.pyx":1282
* 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, 1289, __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, 1282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1301
+/* "pywrapfst.pyx":1294
* return _init_EncodeMapperSymbolTable(syms, 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, 1301, __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, 1294, __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, 1301, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1294, __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, 1301, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1294, __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, 1301, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTable))))) __PYX_ERR(0, 1294, __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":1308
+ /* "pywrapfst.pyx":1301
* """
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
* self._encoder.get().OutputSymbols()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1308, __pyx_L1_error)
+ __PYX_ERR(0, 1301, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1307
+ /* "pywrapfst.pyx":1300
* Returns the encoder's output symbol table, or None if none is present.
* """
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr]( # <<<<<<<<<<<<<<
*/
__pyx_v_syms = const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_encoder.get()->OutputSymbols());
- /* "pywrapfst.pyx":1309
+ /* "pywrapfst.pyx":1302
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
* self._encoder.get().OutputSymbols())
* if syms == NULL: # <<<<<<<<<<<<<<
__pyx_t_5 = ((__pyx_v_syms == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1310
+ /* "pywrapfst.pyx":1303
* self._encoder.get().OutputSymbols())
* if syms == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1309
+ /* "pywrapfst.pyx":1302
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
* self._encoder.get().OutputSymbols())
* if syms == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1311
+ /* "pywrapfst.pyx":1304
* if syms == NULL:
* return
* return _init_EncodeMapperSymbolTable(syms, self._encoder) # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
- __PYX_ERR(0, 1311, __pyx_L1_error)
+ __PYX_ERR(0, 1304, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable(__pyx_v_syms, __pyx_v_self->_encoder)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1311, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable(__pyx_v_syms, __pyx_v_self->_encoder)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __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":1301
+ /* "pywrapfst.pyx":1294
* return _init_EncodeMapperSymbolTable(syms, 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, 1301, __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, 1294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1313
+/* "pywrapfst.pyx":1306
* return _init_EncodeMapperSymbolTable(syms, 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, 1313, __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, 1306, __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, 1313, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __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, 1313, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __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, 1313, __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, 1306, __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, 1313, __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, 1306, __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, 1313, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1306, __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, 1313, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __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, 1313, __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, 1306, __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":1327
+ /* "pywrapfst.pyx":1320
* 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, 1327, __pyx_L1_error)
+ __PYX_ERR(0, 1320, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_encoder.get()->Properties(__pyx_v_mask);
goto __pyx_L0;
- /* "pywrapfst.pyx":1313
+ /* "pywrapfst.pyx":1306
* return _init_EncodeMapperSymbolTable(syms, 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, 1313, __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, 1306, __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, 1313, __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, 1306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1329
+/* "pywrapfst.pyx":1322
* 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, 1329, __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, 1322, __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, 1329, __pyx_L1_error)
+ __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_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, 1329, __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, 1322, __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, 1329, __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, 1322, __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, 1329, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1322, __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, 1329, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":1340
+ /* "pywrapfst.pyx":1333
* 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, 1340, __pyx_L1_error)
+ __PYX_ERR(0, 1333, __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, 1340, __pyx_L1_error)
+ __PYX_ERR(0, 1333, __pyx_L1_error)
}
__pyx_v_self->_encoder.get()->SetInputSymbols(__pyx_v_syms->_table);
- /* "pywrapfst.pyx":1329
+ /* "pywrapfst.pyx":1322
* 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, 1329, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1322, __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, 1329, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
+ __pyx_f_9pywrapfst_12EncodeMapper_set_input_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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1342
+/* "pywrapfst.pyx":1335
* 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, 1342, __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, 1335, __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, 1342, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_syms)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1335, __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, 1342, __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, 1335, __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, 1342, __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, 1335, __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, 1342, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1335, __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, 1342, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1335, __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":1353
+ /* "pywrapfst.pyx":1346
* 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, 1353, __pyx_L1_error)
+ __PYX_ERR(0, 1346, __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, 1353, __pyx_L1_error)
+ __PYX_ERR(0, 1346, __pyx_L1_error)
}
__pyx_v_self->_encoder.get()->SetOutputSymbols(__pyx_v_syms->_table);
- /* "pywrapfst.pyx":1342
+ /* "pywrapfst.pyx":1335
* 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, 1342, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1335, __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, 1342, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
+ __pyx_f_9pywrapfst_12EncodeMapper_set_output_symbols(__pyx_v_self, __pyx_v_syms, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1335, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1355
+/* "pywrapfst.pyx":1348
* 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, 1355, __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, 1348, __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, 1355, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1348, __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, 1355, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1348, __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, 1355, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1348, __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":1361
+ /* "pywrapfst.pyx":1354
* Returns a string indicating the weight type.
* """
* 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, 1361, __pyx_L1_error)
+ __PYX_ERR(0, 1354, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_encoder.get()->WeightType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1355
+ /* "pywrapfst.pyx":1348
* 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, 1355, __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, 1348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1385
+/* "pywrapfst.pyx":1378
*
* # 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":1399
+ /* "pywrapfst.pyx":1392
* """
* # 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, 1399, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __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, 1399, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Popen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1392, __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, 1399, __pyx_L1_error)
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __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, 1399, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1392, __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, 1399, __pyx_L1_error)
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __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, 1399, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1392, __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, 1399, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1392, __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, 1399, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdin, __pyx_t_5) < 0) __PYX_ERR(0, 1392, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "pywrapfst.pyx":1400
+ /* "pywrapfst.pyx":1393
* # 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, 1400, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1393, __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, 1400, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1393, __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, 1399, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdout, __pyx_t_4) < 0) __PYX_ERR(0, 1392, __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, 1400, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1393, __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, 1400, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PIPE); 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;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stderr, __pyx_t_5) < 0) __PYX_ERR(0, 1399, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stderr, __pyx_t_5) < 0) __PYX_ERR(0, 1392, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "pywrapfst.pyx":1399
+ /* "pywrapfst.pyx":1392
* """
* # 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, 1399, __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, 1392, __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":1402
+ /* "pywrapfst.pyx":1395
* 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, 1402, __pyx_L1_error)
+ __PYX_ERR(0, 1395, __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, 1402, __pyx_L1_error)
+ __PYX_ERR(0, 1395, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1403
+ /* "pywrapfst.pyx":1396
* 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, 1403, __pyx_L1_error)
+ __PYX_ERR(0, 1396, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1404
+ /* "pywrapfst.pyx":1397
* 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, 1404, __pyx_L1_error)
+ __PYX_ERR(0, 1397, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1406
+ /* "pywrapfst.pyx":1399
* 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__5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1406, __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, 1406, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b__6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1399, __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, 1399, __pyx_L1_error)
- /* "pywrapfst.pyx":1407
+ /* "pywrapfst.pyx":1400
* 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, 1407, __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, 1400, __pyx_L1_error)
- /* "pywrapfst.pyx":1402
+ /* "pywrapfst.pyx":1395
* 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":1408
+ /* "pywrapfst.pyx":1401
* 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, 1408, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_communicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __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, 1408, __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, 1401, __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, 1408, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1401, __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, 1408, __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, 1401, __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, 1408, __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, 1401, __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, 1408, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __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, 1408, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1401, __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, 1408, __pyx_L1_error)
+ __PYX_ERR(0, 1401, __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, 1408, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1408, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __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, 1408, __pyx_L1_error)
+ __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1401, __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, 1408, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1401, __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, 1408, __pyx_L1_error)
+ __PYX_ERR(0, 1401, __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":1409
+ /* "pywrapfst.pyx":1402
* 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, 1409, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1402, __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, 1409, __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, 1402, __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, 1409, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1402, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_10) {
- /* "pywrapfst.pyx":1410
+ /* "pywrapfst.pyx":1403
* (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, 1410, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1403, __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, 1410, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __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, 1410, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1403, __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, 1410, __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, 1403, __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, 1410, __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, 1403, __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, 1410, __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, 1403, __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, 1410, __pyx_L1_error)
+ __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1403, __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, 1410, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1403, __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, 1410, __pyx_L1_error)
+ __PYX_ERR(0, 1403, __pyx_L1_error)
- /* "pywrapfst.pyx":1409
+ /* "pywrapfst.pyx":1402
* addr(sstrm), b"_repr_svg")
* (sout, serr) = proc.communicate(sstrm.str())
* if proc.returncode != 0: # Just to be explicit. # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1411
+ /* "pywrapfst.pyx":1404
* 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, 1411, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sout, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __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":1385
+ /* "pywrapfst.pyx":1378
*
* # IPython notebook magic to produce an SVG of the FST.
* def _repr_svg_(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1413
+/* "pywrapfst.pyx":1406
* return sout.decode("utf8")
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1414
+ /* "pywrapfst.pyx":1407
*
* 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, 1414, __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, 1407, __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, 1414, __pyx_L1_error)
+ __PYX_ERR(0, 1407, __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, 1414, __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, 1407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1414, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1407, __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, 1414, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1407, __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, 1414, __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, 1407, __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, 1414, __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, 1407, __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, 1414, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1407, __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, 1414, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __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":1413
+ /* "pywrapfst.pyx":1406
* return sout.decode("utf8")
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1416
+/* "pywrapfst.pyx":1409
* 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":1417
+ /* "pywrapfst.pyx":1410
*
* 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, 1417, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":1418
+ /* "pywrapfst.pyx":1411
* 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, 1418, __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, 1411, __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, 1418, __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, 1411, __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, 1418, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1411, __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, 1418, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1411, __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, 1418, __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, 1411, __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, 1418, __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, 1411, __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, 1418, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1411, __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, 1418, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1411, __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, 1417, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __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, 1417, __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, 1410, __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, 1417, __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, 1410, __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, 1417, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1410, __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, 1417, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __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, 1417, __pyx_L1_error)
+ __PYX_ERR(0, 1410, __pyx_L1_error)
- /* "pywrapfst.pyx":1416
+ /* "pywrapfst.pyx":1409
* return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self))
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1422
+/* "pywrapfst.pyx":1415
* # Other magic methods.
*
* def __str__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "pywrapfst.pyx":1423
+ /* "pywrapfst.pyx":1416
*
* 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, 1423, __pyx_L1_error)
+ __PYX_ERR(0, 1416, __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, 1423, __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, 1416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1423, __pyx_L1_error)
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __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, 1423, __pyx_L1_error)
+ __PYX_ERR(0, 1416, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1424
+ /* "pywrapfst.pyx":1417
* 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, 1423, __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, 1416, __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, 1423, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_acceptor, __pyx_t_3) < 0) __PYX_ERR(0, 1416, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "pywrapfst.pyx":1425
+ /* "pywrapfst.pyx":1418
* 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, 1425, __pyx_L1_error)
+ __PYX_ERR(0, 1418, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1426
+ /* "pywrapfst.pyx":1419
* 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, 1425, __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, 1418, __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, 1423, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_show_weight_one, __pyx_t_3) < 0) __PYX_ERR(0, 1416, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "pywrapfst.pyx":1423
+ /* "pywrapfst.pyx":1416
*
* 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, 1423, __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, 1416, __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":1422
+ /* "pywrapfst.pyx":1415
* # Other magic methods.
*
* def __str__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1428
+/* "pywrapfst.pyx":1421
* 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, 1428, __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, 1421, __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, 1428, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __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, 1428, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __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, 1428, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1421, __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":1434
+ /* "pywrapfst.pyx":1427
* Returns a string indicating the arc type.
* """
* 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, 1434, __pyx_L1_error)
+ __PYX_ERR(0, 1427, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1428
+ /* "pywrapfst.pyx":1421
* 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, 1428, __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, 1421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1436
+/* "pywrapfst.pyx":1429
* 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, 1436, __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, 1429, __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, 1436, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __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, 1436, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __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, 1436, __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, 1429, __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, 1436, __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, 1429, __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, 1436, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1429, __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, 1436, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __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, 1436, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_ArcIterator))))) __PYX_ERR(0, 1429, __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":1450
+ /* "pywrapfst.pyx":1443
* 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, 1450, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1450, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1443, __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, 1450, __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, 1443, __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":1436
+ /* "pywrapfst.pyx":1429
* 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, 1436, __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, 1429, __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, 1436, __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, 1429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1452
+/* "pywrapfst.pyx":1445
* 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, 1452, __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, 1445, __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, 1452, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1445, __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, 1452, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1445, __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, 1452, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 1445, __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":1458
+ /* "pywrapfst.pyx":1451
* 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, 1458, __pyx_L1_error)
+ __PYX_ERR(0, 1451, __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, 1458, __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, 1451, __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":1452
+ /* "pywrapfst.pyx":1445
* 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, 1452, __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, 1445, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1460
+/* "pywrapfst.pyx":1453
* 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":1462
+ /* "pywrapfst.pyx":1455
* 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":1463
+ /* "pywrapfst.pyx":1456
* filename,
* _SymbolTable isymbols=None,
* _SymbolTable osymbols=None, # <<<<<<<<<<<<<<
*/
struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":1464
+ /* "pywrapfst.pyx":1457
* _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":1465
+ /* "pywrapfst.pyx":1458
* _SymbolTable osymbols=None,
* SymbolTable ssymbols=None,
* bool acceptor=False, # <<<<<<<<<<<<<<
* double width=8.5,
*/
bool __pyx_v_acceptor = ((bool)0);
- PyObject *__pyx_v_title = ((PyObject *)__pyx_kp_b__5);
+ PyObject *__pyx_v_title = ((PyObject *)__pyx_kp_b__6);
double __pyx_v_width = ((double)8.5);
double __pyx_v_height = ((double)11.0);
- /* "pywrapfst.pyx":1469
+ /* "pywrapfst.pyx":1462
* double width=8.5,
* double height=11,
* bool portrait=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_portrait = ((bool)0);
- /* "pywrapfst.pyx":1470
+ /* "pywrapfst.pyx":1463
* 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":1476
+ /* "pywrapfst.pyx":1469
* int32 precision=5,
* float_format=b"g",
* bool show_weight_one=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1460
+ /* "pywrapfst.pyx":1453
* 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, 1460, __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, 1453, __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, 1460, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L1_error)
+ __pyx_t_4 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1460, __pyx_L1_error)
+ __pyx_t_5 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1453, __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, 1460, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_portrait); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1453, __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, 1460, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_vertical); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyFloat_FromDouble(__pyx_v_ranksep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1460, __pyx_L1_error)
+ __pyx_t_8 = PyFloat_FromDouble(__pyx_v_ranksep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = PyFloat_FromDouble(__pyx_v_nodesep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1460, __pyx_L1_error)
+ __pyx_t_9 = PyFloat_FromDouble(__pyx_v_nodesep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1453, __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, 1460, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_fontsize); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1453, __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, 1460, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyInt_From_int32_t(__pyx_v_precision); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1453, __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, 1460, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1453, __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, 1460, __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, 1453, __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, 1460, __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, 1453, __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, 1460, __pyx_L1_error)
+ __pyx_t_16 = PyTuple_New(16+__pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1453, __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, 1460, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __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":1510
+ /* "pywrapfst.pyx":1503
* See also: `text`.
* """
* cdef string filename_string = tostring(filename) # <<<<<<<<<<<<<<
* cdef unique_ptr[ofstream] ostrm
* ostrm.reset(new ofstream(filename_string))
*/
- __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1510, __pyx_L1_error)
+ __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1503, __pyx_L1_error)
__pyx_v_filename_string = __pyx_t_17;
- /* "pywrapfst.pyx":1512
+ /* "pywrapfst.pyx":1505
* cdef string filename_string = tostring(filename)
* cdef unique_ptr[ofstream] ostrm
* ostrm.reset(new ofstream(filename_string)) # <<<<<<<<<<<<<<
*/
__pyx_v_ostrm.reset(new std::ofstream(__pyx_v_filename_string));
- /* "pywrapfst.pyx":1513
+ /* "pywrapfst.pyx":1506
* cdef unique_ptr[ofstream] ostrm
* ostrm.reset(new ofstream(filename_string))
* cdef fst.SymbolTable *ssymbols_ptr = NULL # <<<<<<<<<<<<<<
*/
__pyx_v_ssymbols_ptr = NULL;
- /* "pywrapfst.pyx":1514
+ /* "pywrapfst.pyx":1507
* ostrm.reset(new ofstream(filename_string))
* cdef fst.SymbolTable *ssymbols_ptr = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_19 = (__pyx_t_18 != 0);
if (__pyx_t_19) {
- /* "pywrapfst.pyx":1515
+ /* "pywrapfst.pyx":1508
* 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, 1515, __pyx_L1_error)
+ __PYX_ERR(0, 1508, __pyx_L1_error)
}
__pyx_t_20 = __pyx_v_ssymbols->__pyx_base.__pyx_base._table;
__pyx_v_ssymbols_ptr = __pyx_t_20;
- /* "pywrapfst.pyx":1514
+ /* "pywrapfst.pyx":1507
* ostrm.reset(new ofstream(filename_string))
* cdef fst.SymbolTable *ssymbols_ptr = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1516
+ /* "pywrapfst.pyx":1509
* 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, 1516, __pyx_L1_error)
+ __PYX_ERR(0, 1509, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1517
+ /* "pywrapfst.pyx":1510
* 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, 1517, __pyx_L1_error)
+ __PYX_ERR(0, 1510, __pyx_L1_error)
}
__pyx_t_21 = __pyx_v_self->_fst.get()->InputSymbols();
} else {
- /* "pywrapfst.pyx":1518
+ /* "pywrapfst.pyx":1511
* 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, 1518, __pyx_L1_error)
+ __PYX_ERR(0, 1511, __pyx_L1_error)
}
__pyx_t_21 = __pyx_v_isymbols->_table;
}
- /* "pywrapfst.pyx":1519
+ /* "pywrapfst.pyx":1512
* 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, 1519, __pyx_L1_error)
+ __PYX_ERR(0, 1512, __pyx_L1_error)
}
__pyx_t_22 = __pyx_v_self->_fst.get()->OutputSymbols();
} else {
- /* "pywrapfst.pyx":1520
+ /* "pywrapfst.pyx":1513
* 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, 1520, __pyx_L1_error)
+ __PYX_ERR(0, 1513, __pyx_L1_error)
}
__pyx_t_22 = __pyx_v_osymbols->_table;
}
- /* "pywrapfst.pyx":1521
+ /* "pywrapfst.pyx":1514
* 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, 1521, __pyx_L1_error)
+ __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_title, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1514, __pyx_L1_error)
- /* "pywrapfst.pyx":1523
+ /* "pywrapfst.pyx":1516
* 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, 1523, __pyx_L1_error)
+ __pyx_t_23 = __pyx_f_9pywrapfst_tostring(__pyx_v_float_format, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1516, __pyx_L1_error)
- /* "pywrapfst.pyx":1516
+ /* "pywrapfst.pyx":1509
* 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":1460
+ /* "pywrapfst.pyx":1453
* 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":1462
+ /* "pywrapfst.pyx":1455
* cpdef void draw(self,
* filename,
* _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
*/
values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":1463
+ /* "pywrapfst.pyx":1456
* filename,
* _SymbolTable isymbols=None,
* _SymbolTable osymbols=None, # <<<<<<<<<<<<<<
*/
values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":1464
+ /* "pywrapfst.pyx":1457
* _SymbolTable isymbols=None,
* _SymbolTable osymbols=None,
* SymbolTable ssymbols=None, # <<<<<<<<<<<<<<
* title=b"",
*/
values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
- values[5] = ((PyObject *)__pyx_kp_b__5);
+ values[5] = ((PyObject *)__pyx_kp_b__6);
values[14] = ((PyObject *)__pyx_n_b_g);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 1460, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 1453, __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, 1465, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1458, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1465
+ /* "pywrapfst.pyx":1458
* _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, 1467, __pyx_L3_error)
+ __pyx_v_width = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_width == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1460, __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, 1468, __pyx_L3_error)
+ __pyx_v_height = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_height == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1461, __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, 1469, __pyx_L3_error)
+ __pyx_v_portrait = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_portrait == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1462, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1469
+ /* "pywrapfst.pyx":1462
* 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, 1470, __pyx_L3_error)
+ __pyx_v_vertical = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_vertical == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1463, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1470
+ /* "pywrapfst.pyx":1463
* 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, 1471, __pyx_L3_error)
+ __pyx_v_ranksep = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_ranksep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1464, __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, 1472, __pyx_L3_error)
+ __pyx_v_nodesep = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_nodesep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1465, __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, 1473, __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, 1466, __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, 1474, __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, 1467, __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, 1476, __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, 1469, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1476
+ /* "pywrapfst.pyx":1469
* 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, 1460, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1453, __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, 1462, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1463, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1464, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1455, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1456, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1457, __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":1460
+ /* "pywrapfst.pyx":1453
* 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, 1460, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1526
+/* "pywrapfst.pyx":1519
* 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, 1526, __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, 1519, __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, 1526, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1519, __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, 1519, __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, 1519, __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, 1519, __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, 1519, __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, 1519, __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, 1526, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 1519, __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":1541
+ /* "pywrapfst.pyx":1534
* 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, 1541, __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, 1534, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 1541, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 1534, __pyx_L1_error)
__pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1542
+ /* "pywrapfst.pyx":1535
* """
* 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, 1542, __pyx_L1_error)
+ __PYX_ERR(0, 1535, __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, 1542, __pyx_L1_error)
+ __PYX_ERR(0, 1535, __pyx_L1_error)
}
__pyx_v_weight->_weight.reset(new fst::script::WeightClass(__pyx_v_self->_fst.get()->Final(__pyx_v_state)));
- /* "pywrapfst.pyx":1543
+ /* "pywrapfst.pyx":1536
* 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":1526
+ /* "pywrapfst.pyx":1519
* 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, 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, 1519, __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, 1526, __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, 1519, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1545
+/* "pywrapfst.pyx":1538
* 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, 1545, __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, 1538, __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, 1545, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1538, __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, 1545, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1538, __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, 1545, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1538, __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":1551
+ /* "pywrapfst.pyx":1544
* Returns a string indicating the FST type.
* """
* 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, 1551, __pyx_L1_error)
+ __PYX_ERR(0, 1544, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->FstType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1545
+ /* "pywrapfst.pyx":1538
* 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, 1545, __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, 1538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1553
+/* "pywrapfst.pyx":1546
* 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, 1553, __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, 1546, __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, 1553, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1546, __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, 1553, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1546, __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, 1553, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__FstSymbolTable))))) __PYX_ERR(0, 1546, __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":1562
+ /* "pywrapfst.pyx":1555
* """
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
* 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, 1562, __pyx_L1_error)
+ __PYX_ERR(0, 1555, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1561
+ /* "pywrapfst.pyx":1554
* See also: `input_symbols`.
* """
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr]( # <<<<<<<<<<<<<<
*/
__pyx_v_syms = const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_fst.get()->InputSymbols());
- /* "pywrapfst.pyx":1563
+ /* "pywrapfst.pyx":1556
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
* self._fst.get().InputSymbols())
* if syms == NULL: # <<<<<<<<<<<<<<
__pyx_t_5 = ((__pyx_v_syms == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1564
+ /* "pywrapfst.pyx":1557
* self._fst.get().InputSymbols())
* if syms == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1563
+ /* "pywrapfst.pyx":1556
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
* self._fst.get().InputSymbols())
* if syms == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1565
+ /* "pywrapfst.pyx":1558
* if syms == NULL:
* return
* return _init_FstSymbolTable(syms, 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, 1565, __pyx_L1_error)
+ __PYX_ERR(0, 1558, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(__pyx_v_syms, __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1565, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(__pyx_v_syms, __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1558, __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":1553
+ /* "pywrapfst.pyx":1546
* 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, 1553, __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, 1546, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1567
+/* "pywrapfst.pyx":1560
* return _init_FstSymbolTable(syms, 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, 1567, __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, 1560, __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, 1567, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1560, __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, 1567, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1560, __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, 1567, __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, 1560, __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, 1567, __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, 1560, __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, 1567, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1560, __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, 1567, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1560, __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, 1567, __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, 1560, __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":1584
+ /* "pywrapfst.pyx":1577
* 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, 1584, __pyx_L1_error)
+ __PYX_ERR(0, 1577, __pyx_L1_error)
}
__pyx_v_result = __pyx_v_self->_fst.get()->NumArcs(__pyx_v_state);
- /* "pywrapfst.pyx":1585
+ /* "pywrapfst.pyx":1578
* """
* 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":1586
+ /* "pywrapfst.pyx":1579
* 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, 1586, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1579, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __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, 1586, __pyx_L1_error)
+ __PYX_ERR(0, 1579, __pyx_L1_error)
- /* "pywrapfst.pyx":1585
+ /* "pywrapfst.pyx":1578
* """
* cdef size_t result = self._fst.get().NumArcs(state)
* if result == SIZE_MAX: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1587
+ /* "pywrapfst.pyx":1580
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range")
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1567
+ /* "pywrapfst.pyx":1560
* return _init_FstSymbolTable(syms, 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, 1567, __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, 1560, __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, 1567, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1567, __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, 1560, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1560, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1589
+/* "pywrapfst.pyx":1582
* 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, 1589, __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, 1582, __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, 1589, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1582, __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, 1589, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1582, __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, 1589, __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, 1582, __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, 1589, __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, 1582, __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, 1589, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1582, __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, 1589, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1582, __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, 1589, __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, 1582, __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":1606
+ /* "pywrapfst.pyx":1599
* 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, 1606, __pyx_L1_error)
+ __PYX_ERR(0, 1599, __pyx_L1_error)
}
__pyx_v_result = __pyx_v_self->_fst.get()->NumInputEpsilons(__pyx_v_state);
- /* "pywrapfst.pyx":1607
+ /* "pywrapfst.pyx":1600
* """
* 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":1608
+ /* "pywrapfst.pyx":1601
* 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, 1608, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1608, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __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, 1608, __pyx_L1_error)
+ __PYX_ERR(0, 1601, __pyx_L1_error)
- /* "pywrapfst.pyx":1607
+ /* "pywrapfst.pyx":1600
* """
* cdef size_t result = self._fst.get().NumInputEpsilons(state)
* if result == SIZE_MAX: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1609
+ /* "pywrapfst.pyx":1602
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range")
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1589
+ /* "pywrapfst.pyx":1582
* 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, 1589, __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, 1582, __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, 1589, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __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, 1582, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1582, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1611
+/* "pywrapfst.pyx":1604
* 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, 1611, __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, 1604, __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, 1611, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1604, __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, 1611, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1604, __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, 1611, __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, 1604, __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, 1611, __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, 1604, __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, 1611, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1604, __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, 1611, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1604, __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, 1611, __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, 1604, __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":1628
+ /* "pywrapfst.pyx":1621
* 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, 1628, __pyx_L1_error)
+ __PYX_ERR(0, 1621, __pyx_L1_error)
}
__pyx_v_result = __pyx_v_self->_fst.get()->NumOutputEpsilons(__pyx_v_state);
- /* "pywrapfst.pyx":1629
+ /* "pywrapfst.pyx":1622
* """
* 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":1630
+ /* "pywrapfst.pyx":1623
* 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, 1630, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1630, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1623, __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, 1630, __pyx_L1_error)
+ __PYX_ERR(0, 1623, __pyx_L1_error)
- /* "pywrapfst.pyx":1629
+ /* "pywrapfst.pyx":1622
* """
* cdef size_t result = self._fst.get().NumOutputEpsilons(state)
* if result == SIZE_MAX: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1631
+ /* "pywrapfst.pyx":1624
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range")
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1611
+ /* "pywrapfst.pyx":1604
* 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, 1611, __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, 1604, __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, 1611, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1611, __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, 1604, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1633
+/* "pywrapfst.pyx":1626
* 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, 1633, __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, 1626, __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, 1633, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1626, __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, 1633, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1626, __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, 1633, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__FstSymbolTable))))) __PYX_ERR(0, 1626, __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":1642
+ /* "pywrapfst.pyx":1635
* """
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
* self._fst.get().OutputSymbols()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1642, __pyx_L1_error)
+ __PYX_ERR(0, 1635, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1641
+ /* "pywrapfst.pyx":1634
* See also: `input_symbols`.
* """
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr]( # <<<<<<<<<<<<<<
*/
__pyx_v_syms = const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_fst.get()->OutputSymbols());
- /* "pywrapfst.pyx":1643
+ /* "pywrapfst.pyx":1636
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
* self._fst.get().OutputSymbols())
* if syms == NULL: # <<<<<<<<<<<<<<
__pyx_t_5 = ((__pyx_v_syms == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1644
+ /* "pywrapfst.pyx":1637
* self._fst.get().OutputSymbols())
* if syms == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1643
+ /* "pywrapfst.pyx":1636
* cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
* self._fst.get().OutputSymbols())
* if syms == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1645
+ /* "pywrapfst.pyx":1638
* if syms == NULL:
* return
* return _init_FstSymbolTable(syms, 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, 1645, __pyx_L1_error)
+ __PYX_ERR(0, 1638, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(__pyx_v_syms, __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(__pyx_v_syms, __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1638, __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":1633
+ /* "pywrapfst.pyx":1626
* 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, 1633, __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, 1626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1647
+/* "pywrapfst.pyx":1640
* return _init_FstSymbolTable(syms, 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, 1647, __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, 1640, __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, 1647, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1640, __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, 1647, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_test); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1640, __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, 1647, __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, 1640, __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, 1647, __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, 1640, __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, 1647, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1640, __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, 1647, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1640, __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, 1647, __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, 1640, __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":1665
+ /* "pywrapfst.pyx":1658
* 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, 1665, __pyx_L1_error)
+ __PYX_ERR(0, 1658, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->Properties(__pyx_v_mask, __pyx_v_test);
goto __pyx_L0;
- /* "pywrapfst.pyx":1647
+ /* "pywrapfst.pyx":1640
* return _init_FstSymbolTable(syms, 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, 1647, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, 1); __PYX_ERR(0, 1640, __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, 1647, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "properties") < 0)) __PYX_ERR(0, 1640, __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, 1647, __pyx_L3_error)
- __pyx_v_test = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_test == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1647, __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, 1640, __pyx_L3_error)
+ __pyx_v_test = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_test == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1640, __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, 1647, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1640, __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, 1647, __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, 1640, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1667
+/* "pywrapfst.pyx":1660
* 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, 1667, __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, 1660, __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, 1667, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1660, __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, 1667, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1660, __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, 1667, __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, 1660, __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":1673
+ /* "pywrapfst.pyx":1666
* Returns the start state.
* """
* 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, 1673, __pyx_L1_error)
+ __PYX_ERR(0, 1666, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->Start();
goto __pyx_L0;
- /* "pywrapfst.pyx":1667
+ /* "pywrapfst.pyx":1660
* 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, 1667, __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, 1660, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1675
+/* "pywrapfst.pyx":1668
* 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, 1675, __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, 1668, __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, 1675, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __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, 1675, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __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, 1675, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_StateIterator))))) __PYX_ERR(0, 1668, __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":1686
+ /* "pywrapfst.pyx":1679
* 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, 1686, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1679, __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, 1686, __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, 1679, __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":1675
+ /* "pywrapfst.pyx":1668
* 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, 1675, __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, 1668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1688
+/* "pywrapfst.pyx":1681
* 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":1689
+ /* "pywrapfst.pyx":1682
*
* 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":1690
+ /* "pywrapfst.pyx":1683
* cpdef string text(self, _SymbolTable isymbols=None,
* _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
* bool acceptor=False, bool show_weight_one=False, missing_sym=b""): # <<<<<<<<<<<<<<
*/
bool __pyx_v_acceptor = ((bool)0);
bool __pyx_v_show_weight_one = ((bool)0);
- PyObject *__pyx_v_missing_sym = ((PyObject *)__pyx_kp_b__5);
+ PyObject *__pyx_v_missing_sym = ((PyObject *)__pyx_kp_b__6);
fst::SymbolTable *__pyx_v_ssymbols_ptr;
std::stringstream __pyx_v_sstrm;
std::string __pyx_r;
}
}
- /* "pywrapfst.pyx":1688
+ /* "pywrapfst.pyx":1681
* 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, 1688, __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, 1681, __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, 1688, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1681, __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, 1688, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __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, 1688, __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, 1681, __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, 1688, __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, 1681, __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, 1688, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(6+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1681, __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, 1688, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1681, __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, 1688, __pyx_L1_error)
+ __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1681, __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":1713
+ /* "pywrapfst.pyx":1706
* """
* # Prints FST to stringstream, then returns resulting string.
* cdef fst.SymbolTable *ssymbols_ptr = NULL # <<<<<<<<<<<<<<
*/
__pyx_v_ssymbols_ptr = NULL;
- /* "pywrapfst.pyx":1714
+ /* "pywrapfst.pyx":1707
* # 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":1715
+ /* "pywrapfst.pyx":1708
* cdef fst.SymbolTable *ssymbols_ptr = NULL
* if ssymbols is not None:
* ssymbols_ptr = ssymbols._table # <<<<<<<<<<<<<<
* cdef stringstream sstrm
- * fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>",
+ * fst.PrintFst(deref(self._fst), sstrm, b"<pywrapfst>",
*/
if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1715, __pyx_L1_error)
+ __PYX_ERR(0, 1708, __pyx_L1_error)
}
__pyx_t_12 = __pyx_v_ssymbols->_table;
__pyx_v_ssymbols_ptr = __pyx_t_12;
- /* "pywrapfst.pyx":1714
+ /* "pywrapfst.pyx":1707
* # Prints FST to stringstream, then returns resulting string.
* cdef fst.SymbolTable *ssymbols_ptr = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1717
+ /* "pywrapfst.pyx":1710
* ssymbols_ptr = ssymbols._table
* cdef stringstream sstrm
- * fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>", # <<<<<<<<<<<<<<
+ * fst.PrintFst(deref(self._fst), sstrm, b"<pywrapfst>", # <<<<<<<<<<<<<<
* self._fst.get().InputSymbols() if isymbols is None
* else isymbols._table,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 1717, __pyx_L1_error)
+ __PYX_ERR(0, 1710, __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, 1717, __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, 1710, __pyx_L1_error)
- /* "pywrapfst.pyx":1718
+ /* "pywrapfst.pyx":1711
* cdef stringstream sstrm
- * fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>",
+ * fst.PrintFst(deref(self._fst), sstrm, b"<pywrapfst>",
* 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, 1718, __pyx_L1_error)
+ __PYX_ERR(0, 1711, __pyx_L1_error)
}
__pyx_t_13 = __pyx_v_self->_fst.get()->InputSymbols();
} else {
- /* "pywrapfst.pyx":1719
- * fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>",
+ /* "pywrapfst.pyx":1712
+ * fst.PrintFst(deref(self._fst), sstrm, b"<pywrapfst>",
* self._fst.get().InputSymbols() if isymbols is None
* else isymbols._table, # <<<<<<<<<<<<<<
* self._fst.get().OutputSymbols() if osymbols is None
*/
if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
- __PYX_ERR(0, 1719, __pyx_L1_error)
+ __PYX_ERR(0, 1712, __pyx_L1_error)
}
__pyx_t_13 = __pyx_v_isymbols->_table;
}
- /* "pywrapfst.pyx":1720
+ /* "pywrapfst.pyx":1713
* 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, 1720, __pyx_L1_error)
+ __PYX_ERR(0, 1713, __pyx_L1_error)
}
__pyx_t_14 = __pyx_v_self->_fst.get()->OutputSymbols();
} else {
- /* "pywrapfst.pyx":1721
+ /* "pywrapfst.pyx":1714
* 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, 1721, __pyx_L1_error)
+ __PYX_ERR(0, 1714, __pyx_L1_error)
}
__pyx_t_14 = __pyx_v_osymbols->_table;
}
- /* "pywrapfst.pyx":1722
+ /* "pywrapfst.pyx":1715
* 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, 1722, __pyx_L1_error)
+ __pyx_t_15 = __pyx_f_9pywrapfst_tostring(__pyx_v_missing_sym, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1715, __pyx_L1_error)
- /* "pywrapfst.pyx":1717
+ /* "pywrapfst.pyx":1710
* ssymbols_ptr = ssymbols._table
* cdef stringstream sstrm
- * fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>", # <<<<<<<<<<<<<<
+ * fst.PrintFst(deref(self._fst), sstrm, b"<pywrapfst>", # <<<<<<<<<<<<<<
* self._fst.get().InputSymbols() if isymbols is None
* else isymbols._table,
*/
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":1723
+ /* "pywrapfst.pyx":1716
* 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":1688
+ /* "pywrapfst.pyx":1681
* 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":1689
+ /* "pywrapfst.pyx":1682
*
* cpdef string text(self, _SymbolTable isymbols=None,
* _SymbolTable osymbols=None, _SymbolTable ssymbols=None, # <<<<<<<<<<<<<<
*/
values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- values[5] = ((PyObject *)__pyx_kp_b__5);
+ values[5] = ((PyObject *)__pyx_kp_b__6);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text") < 0)) __PYX_ERR(0, 1688, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text") < 0)) __PYX_ERR(0, 1681, __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, 1690, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1683, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1690
+ /* "pywrapfst.pyx":1683
* 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, 1690, __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, 1683, __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, 1688, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("text", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1681, __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, 1688, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1689, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1689, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1681, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1682, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1682, __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":1688
+ /* "pywrapfst.pyx":1681
* 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, 1688, __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, 1681, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1725
+/* "pywrapfst.pyx":1718
* 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, 1725, __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, 1718, __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, 1725, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1718, __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, 1725, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1718, __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, 1725, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1718, __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":1734
+ /* "pywrapfst.pyx":1727
* 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, 1734, __pyx_L1_error)
+ __PYX_ERR(0, 1727, __pyx_L1_error)
}
__pyx_r = fst::script::Verify((*__pyx_v_self->_fst));
goto __pyx_L0;
- /* "pywrapfst.pyx":1725
+ /* "pywrapfst.pyx":1718
* 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, 1725, __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, 1718, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1736
+/* "pywrapfst.pyx":1729
* 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, 1736, __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, 1729, __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, 1736, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1729, __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, 1736, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1729, __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, 1736, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1729, __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":1745
+ /* "pywrapfst.pyx":1738
* 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, 1745, __pyx_L1_error)
+ __PYX_ERR(0, 1738, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->WeightType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1736
+ /* "pywrapfst.pyx":1729
* 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, 1736, __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, 1729, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1747
+/* "pywrapfst.pyx":1740
* 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, 1747, __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, 1740, __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, 1747, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1740, __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, 1747, __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, 1740, __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, 1747, __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, 1740, __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, 1747, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1740, __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, 1747, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1740, __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":1761
+ /* "pywrapfst.pyx":1754
* 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, 1761, __pyx_L1_error)
+ __PYX_ERR(0, 1754, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1761, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1754, __pyx_L1_error)
__pyx_t_7 = ((!(__pyx_v_self->_fst.get()->Write(__pyx_t_6) != 0)) != 0);
if (__pyx_t_7) {
- /* "pywrapfst.pyx":1762
+ /* "pywrapfst.pyx":1755
* """
* if not self._fst.get().Write(tostring(filename)):
* raise FstIOError("Write failed: {!r}".format(filename)) # <<<<<<<<<<<<<<
*
* cpdef string write_to_string(self):
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1762, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1755, __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, 1762, __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, 1755, __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, 1762, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1755, __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, 1762, __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, 1755, __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, 1762, __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, 1755, __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, 1762, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1755, __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, 1762, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1755, __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, 1762, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1755, __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, 1762, __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, 1755, __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, 1762, __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, 1755, __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, 1762, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1755, __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, 1762, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1755, __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, 1762, __pyx_L1_error)
+ __PYX_ERR(0, 1755, __pyx_L1_error)
- /* "pywrapfst.pyx":1761
+ /* "pywrapfst.pyx":1754
* FstIOError: Write failed.
* """
* if not self._fst.get().Write(tostring(filename)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1747
+ /* "pywrapfst.pyx":1740
* 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, 1747, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1747, __pyx_L1_error)
+ __pyx_f_9pywrapfst_4_Fst_write(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1740, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1764
+/* "pywrapfst.pyx":1757
* raise FstIOError("Write failed: {!r}".format(filename))
*
* cpdef string write_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_write_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1764, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1757, __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_45write_to_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, 1764, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1757, __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, 1764, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1757, __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, 1764, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1757, __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":1775
+ /* "pywrapfst.pyx":1768
* See also: `read_from_string`.
* """
* 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, 1775, __pyx_L1_error)
+ __PYX_ERR(0, 1768, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->WriteToString();
goto __pyx_L0;
- /* "pywrapfst.pyx":1764
+ /* "pywrapfst.pyx":1757
* raise FstIOError("Write failed: {!r}".format(filename))
*
* cpdef string write_to_string(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("write_to_string", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_write_to_string(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1764, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_write_to_string(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1788
+/* "pywrapfst.pyx":1781
* """
*
* cdef void _check_mutating_imethod(self) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("_check_mutating_imethod", 0);
- /* "pywrapfst.pyx":1793
+ /* "pywrapfst.pyx":1786
* 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, 1793, __pyx_L1_error)
+ __PYX_ERR(0, 1786, __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":1794
+ /* "pywrapfst.pyx":1787
* """
* 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, 1794, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1787, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1794, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1787, __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, 1794, __pyx_L1_error)
+ __PYX_ERR(0, 1787, __pyx_L1_error)
- /* "pywrapfst.pyx":1793
+ /* "pywrapfst.pyx":1786
* This function is not visible to Python users.
* """
* if self._fst.get().Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1788
+ /* "pywrapfst.pyx":1781
* """
*
* cdef void _check_mutating_imethod(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1796
+/* "pywrapfst.pyx":1789
* 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":1797
+ /* "pywrapfst.pyx":1790
*
* 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, 1797, __pyx_L1_error)
+ __PYX_ERR(0, 1790, __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":1798
+ /* "pywrapfst.pyx":1791
* 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, 1798, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1791, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1798, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1791, __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, 1798, __pyx_L1_error)
+ __PYX_ERR(0, 1791, __pyx_L1_error)
- /* "pywrapfst.pyx":1797
+ /* "pywrapfst.pyx":1790
*
* cdef void _add_arc(self, int64 state, Arc arc) except *:
* if not self._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1799
+ /* "pywrapfst.pyx":1792
* 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, 1799, __pyx_L1_error)
+ __PYX_ERR(0, 1792, __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, 1799, __pyx_L1_error)
+ __PYX_ERR(0, 1792, __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":1800
+ /* "pywrapfst.pyx":1793
* 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, 1800, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1793, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1800, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1793, __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, 1800, __pyx_L1_error)
+ __PYX_ERR(0, 1793, __pyx_L1_error)
- /* "pywrapfst.pyx":1799
+ /* "pywrapfst.pyx":1792
* 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":1801
+ /* "pywrapfst.pyx":1794
* 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, 1801, __pyx_L1_error)
+ __PYX_ERR(0, 1794, __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, 1801, __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, 1794, __pyx_L1_error)
- /* "pywrapfst.pyx":1796
+ /* "pywrapfst.pyx":1789
* raise FstOpError("Operation failed")
*
* cdef void _add_arc(self, int64 state, Arc arc) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1803
+/* "pywrapfst.pyx":1796
* 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, 1803, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, 1); __PYX_ERR(0, 1796, __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, 1803, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_arc") < 0)) __PYX_ERR(0, 1796, __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, 1803, __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, 1796, __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, 1803, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1796, __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, 1803, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1796, __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":1822
+ /* "pywrapfst.pyx":1815
* 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, 1822, __pyx_L1_error)
+ __PYX_ERR(0, 1815, __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, 1822, __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, 1815, __pyx_L1_error)
- /* "pywrapfst.pyx":1823
+ /* "pywrapfst.pyx":1816
* """
* self._add_arc(state, arc)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1803
+ /* "pywrapfst.pyx":1796
* self._check_mutating_imethod()
*
* def add_arc(self, int64 state, Arc arc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1825
+/* "pywrapfst.pyx":1818
* 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, 1825, __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, 1818, __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, 1825, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1818, __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, 1825, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1818, __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, 1825, __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, 1818, __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":1836
+ /* "pywrapfst.pyx":1829
* 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, 1836, __pyx_L1_error)
+ __PYX_ERR(0, 1829, __pyx_L1_error)
}
__pyx_v_result = __pyx_v_self->_mfst.get()->AddState();
- /* "pywrapfst.pyx":1837
+ /* "pywrapfst.pyx":1830
* """
* 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, 1837, __pyx_L1_error)
+ __PYX_ERR(0, 1830, __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, 1837, __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, 1830, __pyx_L1_error)
- /* "pywrapfst.pyx":1838
+ /* "pywrapfst.pyx":1831
* cdef int64 result = self._mfst.get().AddState()
* self._check_mutating_imethod()
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1825
+ /* "pywrapfst.pyx":1818
* 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, 1825, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1825, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_11_MutableFst_add_state(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1818, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1840
+/* "pywrapfst.pyx":1833
* return result
*
* cdef void _arcsort(self, sort_type=b"ilabel") except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1842
+ /* "pywrapfst.pyx":1835
* cdef void _arcsort(self, sort_type=b"ilabel") except *:
* cdef fst.ArcSortType sort_type_enum
* if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)): # <<<<<<<<<<<<<<
* raise FstArgError("Unknown sort type {!r}".format(sort_type))
* fst.ArcSort(self._mfst.get(), sort_type_enum)
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_sort_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1842, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_sort_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1835, __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":1843
+ /* "pywrapfst.pyx":1836
* cdef fst.ArcSortType sort_type_enum
* if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
* raise FstArgError("Unknown sort type {!r}".format(sort_type)) # <<<<<<<<<<<<<<
* fst.ArcSort(self._mfst.get(), sort_type_enum)
* self._check_mutating_imethod()
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1843, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1836, __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, 1843, __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, 1836, __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_sort_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1843, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_sort_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1836, __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_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, 1843, __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, 1836, __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_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, 1843, __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, 1836, __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, 1843, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1836, __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, 1843, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1836, __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, 1843, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1836, __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, 1843, __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, 1836, __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, 1843, __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, 1836, __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, 1843, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1836, __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, 1843, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1836, __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, 1843, __pyx_L1_error)
+ __PYX_ERR(0, 1836, __pyx_L1_error)
- /* "pywrapfst.pyx":1842
+ /* "pywrapfst.pyx":1835
* cdef void _arcsort(self, sort_type=b"ilabel") except *:
* cdef fst.ArcSortType sort_type_enum
* if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1844
+ /* "pywrapfst.pyx":1837
* if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
* raise FstArgError("Unknown sort type {!r}".format(sort_type))
* fst.ArcSort(self._mfst.get(), sort_type_enum) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 1844, __pyx_L1_error)
+ __PYX_ERR(0, 1837, __pyx_L1_error)
}
fst::script::ArcSort(__pyx_v_self->_mfst.get(), __pyx_v_sort_type_enum);
- /* "pywrapfst.pyx":1845
+ /* "pywrapfst.pyx":1838
* raise FstArgError("Unknown sort type {!r}".format(sort_type))
* fst.ArcSort(self._mfst.get(), sort_type_enum)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 1845, __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, 1845, __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":1840
+ /* "pywrapfst.pyx":1833
* return result
*
* cdef void _arcsort(self, sort_type=b"ilabel") except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1847
+/* "pywrapfst.pyx":1840
* self._check_mutating_imethod()
*
* def arcsort(self, sort_type=b"ilabel"): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 1847, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 1840, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("arcsort", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1847, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("arcsort", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1840, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort __pyx_t_1;
__Pyx_RefNannySetupContext("arcsort", 0);
- /* "pywrapfst.pyx":1868
+ /* "pywrapfst.pyx":1861
* See also: `topsort`.
* """
* self._arcsort(sort_type) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arcsort");
- __PYX_ERR(0, 1868, __pyx_L1_error)
+ __PYX_ERR(0, 1861, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 1;
__pyx_t_1.sort_type = __pyx_v_sort_type;
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_arcsort(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1868, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_arcsort(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1861, __pyx_L1_error)
- /* "pywrapfst.pyx":1869
+ /* "pywrapfst.pyx":1862
* """
* self._arcsort(sort_type)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1847
+ /* "pywrapfst.pyx":1840
* self._check_mutating_imethod()
*
* def arcsort(self, sort_type=b"ilabel"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1871
+/* "pywrapfst.pyx":1864
* return self
*
* cdef void _closure(self, bool closure_plus=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1872
+ /* "pywrapfst.pyx":1865
*
* 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, 1872, __pyx_L1_error)
+ __PYX_ERR(0, 1865, __pyx_L1_error)
}
fst::script::Closure(__pyx_v_self->_mfst.get(), fst::script::GetClosureType(__pyx_v_closure_plus));
- /* "pywrapfst.pyx":1873
+ /* "pywrapfst.pyx":1866
* 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, 1873, __pyx_L1_error)
+ __PYX_ERR(0, 1866, __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, 1873, __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, 1866, __pyx_L1_error)
- /* "pywrapfst.pyx":1871
+ /* "pywrapfst.pyx":1864
* return self
*
* cdef void _closure(self, bool closure_plus=False) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1875
+/* "pywrapfst.pyx":1868
* 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, 1875, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "closure") < 0)) __PYX_ERR(0, 1868, __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, 1875, __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, 1868, __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, 1875, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("closure", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1868, __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":1893
+ /* "pywrapfst.pyx":1886
* 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, 1893, __pyx_L1_error)
+ __PYX_ERR(0, 1886, __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, 1893, __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, 1886, __pyx_L1_error)
- /* "pywrapfst.pyx":1894
+ /* "pywrapfst.pyx":1887
* """
* self._closure(closure_plus)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1875
+ /* "pywrapfst.pyx":1868
* self._check_mutating_imethod()
*
* def closure(self, bool closure_plus=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1896
+/* "pywrapfst.pyx":1889
* return self
*
* cdef void _concat(self, _Fst ifst) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_concat", 0);
- /* "pywrapfst.pyx":1897
+ /* "pywrapfst.pyx":1890
*
* 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, 1897, __pyx_L1_error)
+ __PYX_ERR(0, 1890, __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, 1897, __pyx_L1_error)
+ __PYX_ERR(0, 1890, __pyx_L1_error)
}
fst::script::Concat(__pyx_v_self->_mfst.get(), (*__pyx_v_ifst->_fst));
- /* "pywrapfst.pyx":1898
+ /* "pywrapfst.pyx":1891
* 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, 1898, __pyx_L1_error)
+ __PYX_ERR(0, 1891, __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, 1898, __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, 1891, __pyx_L1_error)
- /* "pywrapfst.pyx":1896
+ /* "pywrapfst.pyx":1889
* return self
*
* cdef void _concat(self, _Fst ifst) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1900
+/* "pywrapfst.pyx":1893
* 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, 1900, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 1893, __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":1917
+ /* "pywrapfst.pyx":1910
* 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, 1917, __pyx_L1_error)
+ __PYX_ERR(0, 1910, __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, 1917, __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, 1910, __pyx_L1_error)
- /* "pywrapfst.pyx":1918
+ /* "pywrapfst.pyx":1911
* """
* self._concat(ifst)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1900
+ /* "pywrapfst.pyx":1893
* self._check_mutating_imethod()
*
* def concat(self, _Fst ifst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1920
+/* "pywrapfst.pyx":1913
* return self
*
* cdef void _connect(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_connect", 0);
- /* "pywrapfst.pyx":1921
+ /* "pywrapfst.pyx":1914
*
* 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, 1921, __pyx_L1_error)
+ __PYX_ERR(0, 1914, __pyx_L1_error)
}
fst::script::Connect(__pyx_v_self->_mfst.get());
- /* "pywrapfst.pyx":1922
+ /* "pywrapfst.pyx":1915
* 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, 1922, __pyx_L1_error)
+ __PYX_ERR(0, 1915, __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, 1922, __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, 1915, __pyx_L1_error)
- /* "pywrapfst.pyx":1920
+ /* "pywrapfst.pyx":1913
* return self
*
* cdef void _connect(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1924
+/* "pywrapfst.pyx":1917
* self._check_mutating_imethod()
*
* def connect(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("connect", 0);
- /* "pywrapfst.pyx":1936
+ /* "pywrapfst.pyx":1929
* 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, 1936, __pyx_L1_error)
+ __PYX_ERR(0, 1929, __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, 1936, __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, 1929, __pyx_L1_error)
- /* "pywrapfst.pyx":1937
+ /* "pywrapfst.pyx":1930
* """
* self._connect()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1924
+ /* "pywrapfst.pyx":1917
* self._check_mutating_imethod()
*
* def connect(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1939
+/* "pywrapfst.pyx":1932
* return self
*
* cdef void _decode(self, EncodeMapper encoder) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_decode", 0);
- /* "pywrapfst.pyx":1940
+ /* "pywrapfst.pyx":1933
*
* 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, 1940, __pyx_L1_error)
+ __PYX_ERR(0, 1933, __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, 1940, __pyx_L1_error)
+ __PYX_ERR(0, 1933, __pyx_L1_error)
}
fst::script::Decode(__pyx_v_self->_mfst.get(), (*__pyx_v_encoder->_encoder));
- /* "pywrapfst.pyx":1941
+ /* "pywrapfst.pyx":1934
* 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, 1941, __pyx_L1_error)
+ __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, 1941, __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)
- /* "pywrapfst.pyx":1939
+ /* "pywrapfst.pyx":1932
* return self
*
* cdef void _decode(self, EncodeMapper encoder) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1943
+/* "pywrapfst.pyx":1936
* 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, 1943, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 1936, __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":1959
+ /* "pywrapfst.pyx":1952
* 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, 1959, __pyx_L1_error)
+ __PYX_ERR(0, 1952, __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, 1959, __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, 1952, __pyx_L1_error)
- /* "pywrapfst.pyx":1960
+ /* "pywrapfst.pyx":1953
* """
* self._decode(encoder)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1943
+ /* "pywrapfst.pyx":1936
* self._check_mutating_imethod()
*
* def decode(self, EncodeMapper encoder): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1962
+/* "pywrapfst.pyx":1955
* return self
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1963
+ /* "pywrapfst.pyx":1956
*
* 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, 1963, __pyx_L1_error)
+ __PYX_ERR(0, 1956, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state, __pyx_v_n);
} else {
- /* "pywrapfst.pyx":1964
+ /* "pywrapfst.pyx":1957
* 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, 1964, __pyx_L1_error)
+ __PYX_ERR(0, 1957, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state);
}
- /* "pywrapfst.pyx":1963
+ /* "pywrapfst.pyx":1956
*
* 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":1965
+ /* "pywrapfst.pyx":1958
* 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, 1965, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1958, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1965, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1958, __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, 1965, __pyx_L1_error)
+ __PYX_ERR(0, 1958, __pyx_L1_error)
- /* "pywrapfst.pyx":1963
+ /* "pywrapfst.pyx":1956
*
* 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":1966
+ /* "pywrapfst.pyx":1959
* 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, 1966, __pyx_L1_error)
+ __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, 1966, __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)
- /* "pywrapfst.pyx":1962
+ /* "pywrapfst.pyx":1955
* return self
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1968
+/* "pywrapfst.pyx":1961
* 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, 1968, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_arcs") < 0)) __PYX_ERR(0, 1961, __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, 1968, __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, 1961, __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, 1968, __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, 1961, __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, 1968, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("delete_arcs", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1961, __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":1988
+ /* "pywrapfst.pyx":1981
* 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, 1988, __pyx_L1_error)
+ __PYX_ERR(0, 1981, __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, 1988, __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, 1981, __pyx_L1_error)
- /* "pywrapfst.pyx":1989
+ /* "pywrapfst.pyx":1982
* """
* self._delete_arcs(state, n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1968
+ /* "pywrapfst.pyx":1961
* self._check_mutating_imethod()
*
* def delete_arcs(self, int64 state, size_t n=0): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1991
+/* "pywrapfst.pyx":1984
* return self
*
* cdef void _delete_states(self, states=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1993
+ /* "pywrapfst.pyx":1986
* 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, 1993, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_states); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1986, __pyx_L1_error)
if (__pyx_t_1) {
- /* "pywrapfst.pyx":1994
+ /* "pywrapfst.pyx":1987
* # 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, 1994, __pyx_L1_error)
+ __PYX_ERR(0, 1987, __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, 1994, __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, 1987, __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":1995
+ /* "pywrapfst.pyx":1988
* 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, 1995, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1988, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1988, __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, 1995, __pyx_L1_error)
+ __PYX_ERR(0, 1988, __pyx_L1_error)
- /* "pywrapfst.pyx":1994
+ /* "pywrapfst.pyx":1987
* # Only the former signature has a possible indexing failure.
* if states:
* if not self._mfst.get().DeleteStates(<const vector[int64]> states): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1993
+ /* "pywrapfst.pyx":1986
* cdef void _delete_states(self, states=None) except *:
* # Only the former signature has a possible indexing failure.
* if states: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":1997
+ /* "pywrapfst.pyx":1990
* 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, 1997, __pyx_L1_error)
+ __PYX_ERR(0, 1990, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->DeleteStates();
}
__pyx_L3:;
- /* "pywrapfst.pyx":1998
+ /* "pywrapfst.pyx":1991
* 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, 1998, __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, 1998, __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":1991
+ /* "pywrapfst.pyx":1984
* return self
*
* cdef void _delete_states(self, states=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2000
+/* "pywrapfst.pyx":1993
* 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, 2000, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_states") < 0)) __PYX_ERR(0, 1993, __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, 2000, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("delete_states", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1993, __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":2018
+ /* "pywrapfst.pyx":2011
* 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, 2018, __pyx_L1_error)
+ __PYX_ERR(0, 2011, __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, 2018, __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, 2011, __pyx_L1_error)
- /* "pywrapfst.pyx":2019
+ /* "pywrapfst.pyx":2012
* """
* self._delete_states(states)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2000
+ /* "pywrapfst.pyx":1993
* self._check_mutating_imethod()
*
* def delete_states(self, states=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2021
+/* "pywrapfst.pyx":2014
* return self
*
* cdef void _encode(self, EncodeMapper encoder) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_encode", 0);
- /* "pywrapfst.pyx":2022
+ /* "pywrapfst.pyx":2015
*
* 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, 2022, __pyx_L1_error)
+ __PYX_ERR(0, 2015, __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, 2022, __pyx_L1_error)
+ __PYX_ERR(0, 2015, __pyx_L1_error)
}
fst::script::Encode(__pyx_v_self->_mfst.get(), __pyx_v_encoder->_encoder.get());
- /* "pywrapfst.pyx":2023
+ /* "pywrapfst.pyx":2016
* 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, 2023, __pyx_L1_error)
+ __PYX_ERR(0, 2016, __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, 2023, __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, 2016, __pyx_L1_error)
- /* "pywrapfst.pyx":2021
+ /* "pywrapfst.pyx":2014
* return self
*
* cdef void _encode(self, EncodeMapper encoder) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2025
+/* "pywrapfst.pyx":2018
* 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, 2025, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 2018, __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":2046
+ /* "pywrapfst.pyx":2039
* 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, 2046, __pyx_L1_error)
+ __PYX_ERR(0, 2039, __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, 2046, __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, 2039, __pyx_L1_error)
- /* "pywrapfst.pyx":2047
+ /* "pywrapfst.pyx":2040
* """
* self._encode(encoder)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2025
+ /* "pywrapfst.pyx":2018
* self._check_mutating_imethod()
*
* def encode(self, EncodeMapper encoder): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2049
+/* "pywrapfst.pyx":2042
* return self
*
* cdef void _invert(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_invert", 0);
- /* "pywrapfst.pyx":2050
+ /* "pywrapfst.pyx":2043
*
* 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, 2050, __pyx_L1_error)
+ __PYX_ERR(0, 2043, __pyx_L1_error)
}
fst::script::Invert(__pyx_v_self->_mfst.get());
- /* "pywrapfst.pyx":2051
+ /* "pywrapfst.pyx":2044
* 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, 2051, __pyx_L1_error)
+ __PYX_ERR(0, 2044, __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, 2051, __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, 2044, __pyx_L1_error)
- /* "pywrapfst.pyx":2049
+ /* "pywrapfst.pyx":2042
* return self
*
* cdef void _invert(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2053
+/* "pywrapfst.pyx":2046
* self._check_mutating_imethod()
*
* def invert(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("invert", 0);
- /* "pywrapfst.pyx":2065
+ /* "pywrapfst.pyx":2058
* 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, 2065, __pyx_L1_error)
+ __PYX_ERR(0, 2058, __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, 2065, __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, 2058, __pyx_L1_error)
- /* "pywrapfst.pyx":2066
+ /* "pywrapfst.pyx":2059
* """
* self._invert()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2053
+ /* "pywrapfst.pyx":2046
* self._check_mutating_imethod()
*
* def invert(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2068
+/* "pywrapfst.pyx":2061
* 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__15;
+ float __pyx_v_delta = __pyx_k__16;
- /* "pywrapfst.pyx":2069
+ /* "pywrapfst.pyx":2062
*
* cdef void _minimize(self, float delta=fst.kDelta,
* bool allow_nondet=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2071
+ /* "pywrapfst.pyx":2064
* 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, 2071, __pyx_L1_error)
+ __PYX_ERR(0, 2064, __pyx_L1_error)
}
fst::script::Minimize(__pyx_v_self->_mfst.get(), NULL, __pyx_v_delta, __pyx_v_allow_nondet);
- /* "pywrapfst.pyx":2072
+ /* "pywrapfst.pyx":2065
* # 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, 2072, __pyx_L1_error)
+ __PYX_ERR(0, 2065, __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, 2072, __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, 2065, __pyx_L1_error)
- /* "pywrapfst.pyx":2068
+ /* "pywrapfst.pyx":2061
* return self
*
* cdef void _minimize(self, float delta=fst.kDelta, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2074
+/* "pywrapfst.pyx":2067
* 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, 2074, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minimize") < 0)) __PYX_ERR(0, 2067, __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, 2074, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2067, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__16;
+ __pyx_v_delta = __pyx_k__17;
}
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, 2074, __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, 2067, __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, 2074, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("minimize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2067, __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":2100
+ /* "pywrapfst.pyx":2093
* 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, 2100, __pyx_L1_error)
+ __PYX_ERR(0, 2093, __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, 2100, __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, 2093, __pyx_L1_error)
- /* "pywrapfst.pyx":2101
+ /* "pywrapfst.pyx":2094
* """
* self._minimize(delta)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2074
+ /* "pywrapfst.pyx":2067
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2103
+/* "pywrapfst.pyx":2096
* 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, 2103, __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, 2096, __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, 2103, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2096, __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, 2103, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2096, __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, 2103, __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, 2096, __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, 2103, __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, 2096, __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, 2103, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2096, __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, 2103, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2096, __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, 2103, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_MutableArcIterator))))) __PYX_ERR(0, 2096, __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":2117
+ /* "pywrapfst.pyx":2110
* 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, 2117, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2110, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2117, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2110, __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, 2117, __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, 2110, __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":2103
+ /* "pywrapfst.pyx":2096
* 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, 2103, __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, 2096, __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, 2103, __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, 2096, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2119
+/* "pywrapfst.pyx":2112
* return MutableArcIterator(self, state)
*
* def mutable_input_symbols(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("mutable_input_symbols", 0);
- /* "pywrapfst.pyx":2125
+ /* "pywrapfst.pyx":2118
* Returns the FST's (mutable) input symbol table, or None if none is present.
* """
* 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, 2125, __pyx_L1_error)
+ __PYX_ERR(0, 2118, __pyx_L1_error)
}
__pyx_v_tst = __pyx_v_self->_mfst.get()->MutableInputSymbols();
- /* "pywrapfst.pyx":2126
+ /* "pywrapfst.pyx":2119
* """
* 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":2127
+ /* "pywrapfst.pyx":2120
* 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":2126
+ /* "pywrapfst.pyx":2119
* """
* cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols()
* if tst == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2128
+ /* "pywrapfst.pyx":2121
* 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, 2128, __pyx_L1_error)
+ __PYX_ERR(0, 2121, __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, 2128, __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, 2121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2119
+ /* "pywrapfst.pyx":2112
* return MutableArcIterator(self, state)
*
* def mutable_input_symbols(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2130
+/* "pywrapfst.pyx":2123
* return _init_MutableFstSymbolTable(tst, self._mfst)
*
* def mutable_output_symbols(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("mutable_output_symbols", 0);
- /* "pywrapfst.pyx":2136
+ /* "pywrapfst.pyx":2129
* Returns the FST's (mutable) output symbol table, or None if none is present.
* """
* 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, 2136, __pyx_L1_error)
+ __PYX_ERR(0, 2129, __pyx_L1_error)
}
__pyx_v_tst = __pyx_v_self->_mfst.get()->MutableOutputSymbols();
- /* "pywrapfst.pyx":2137
+ /* "pywrapfst.pyx":2130
* """
* 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":2138
+ /* "pywrapfst.pyx":2131
* 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":2137
+ /* "pywrapfst.pyx":2130
* """
* cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols()
* if tst == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2139
+ /* "pywrapfst.pyx":2132
* 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, 2139, __pyx_L1_error)
+ __PYX_ERR(0, 2132, __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, 2139, __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, 2132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2130
+ /* "pywrapfst.pyx":2123
* return _init_MutableFstSymbolTable(tst, self._mfst)
*
* def mutable_output_symbols(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2141
+/* "pywrapfst.pyx":2134
* 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, 2141, __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, 2134, __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, 2141, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2134, __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, 2141, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2134, __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, 2141, __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, 2134, __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":2147
+ /* "pywrapfst.pyx":2140
* Returns the number of states.
* """
* return self._mfst.get().NumStates() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 2147, __pyx_L1_error)
+ __PYX_ERR(0, 2140, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mfst.get()->NumStates();
goto __pyx_L0;
- /* "pywrapfst.pyx":2141
+ /* "pywrapfst.pyx":2134
* 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, 2141, __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, 2134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2149
+/* "pywrapfst.pyx":2142
* return self._mfst.get().NumStates()
*
* cdef void _project(self, bool project_output=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2150
+ /* "pywrapfst.pyx":2143
*
* 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, 2150, __pyx_L1_error)
+ __PYX_ERR(0, 2143, __pyx_L1_error)
}
fst::script::Project(__pyx_v_self->_mfst.get(), fst::script::GetProjectType(__pyx_v_project_output));
- /* "pywrapfst.pyx":2151
+ /* "pywrapfst.pyx":2144
* 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, 2151, __pyx_L1_error)
+ __PYX_ERR(0, 2144, __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, 2151, __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, 2144, __pyx_L1_error)
- /* "pywrapfst.pyx":2149
+ /* "pywrapfst.pyx":2142
* return self._mfst.get().NumStates()
*
* cdef void _project(self, bool project_output=False) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2153
+/* "pywrapfst.pyx":2146
* 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, 2153, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "project") < 0)) __PYX_ERR(0, 2146, __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, 2153, __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, 2146, __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, 2153, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("project", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2146, __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":2171
+ /* "pywrapfst.pyx":2164
* 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, 2171, __pyx_L1_error)
+ __PYX_ERR(0, 2164, __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, 2171, __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, 2164, __pyx_L1_error)
- /* "pywrapfst.pyx":2172
+ /* "pywrapfst.pyx":2165
* """
* self._project(project_output)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2153
+ /* "pywrapfst.pyx":2146
* self._check_mutating_imethod()
*
* def project(self, bool project_output=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2174
+/* "pywrapfst.pyx":2167
* return self
*
* cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
static void __pyx_f_9pywrapfst_11_MutableFst__prune(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__17;
- __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__18;
+ float __pyx_v_delta = __pyx_k__18;
+ __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__19;
- /* "pywrapfst.pyx":2175
+ /* "pywrapfst.pyx":2168
*
* cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId,
* weight=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2177
+ /* "pywrapfst.pyx":2170
* 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, 2177, __pyx_L1_error)
+ __PYX_ERR(0, 2170, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2178
+ /* "pywrapfst.pyx":2171
* # 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, 2177, __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, 2170, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":2179
+ /* "pywrapfst.pyx":2172
* 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, 2179, __pyx_L1_error)
+ __PYX_ERR(0, 2172, __pyx_L1_error)
}
fst::script::Prune(__pyx_v_self->_mfst.get(), __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":2180
+ /* "pywrapfst.pyx":2173
* 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, 2180, __pyx_L1_error)
+ __PYX_ERR(0, 2173, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2173, __pyx_L1_error)
- /* "pywrapfst.pyx":2174
+ /* "pywrapfst.pyx":2167
* return self
*
* cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2182
+/* "pywrapfst.pyx":2175
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_34prune[] = "\n prune(self, delta=0.0009765625, nstate=-1, weight=None)\n\n Removes paths with weights below a certain threshold.\n\n This operation deletes states and arcs in the input FST that do not belong\n to a successful path whose weight is no more (w.r.t the natural semiring\n order) than the threshold t \\otimes-times the weight of the shortest path in\n the input FST. Weights must be commutative and have the path property.\n\n Args:\n delta: Comparison/quantization delta.\n nstate: State number threshold.\n weight: A Weight or weight string indicating the desired weight threshold\n below which paths are pruned; if omitted, no paths are pruned.\n\n Returns:\n self.\n\n See also: The constructive variant.\n ";
+static char __pyx_doc_9pywrapfst_11_MutableFst_34prune[] = "\n prune(self, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)\n\n Removes paths with weights below a certain threshold.\n\n This operation deletes states and arcs in the input FST that do not belong\n to a successful path whose weight is no more (w.r.t the natural semiring\n order) than the threshold t \\otimes-times the weight of the shortest path in\n the input FST. Weights must be commutative and have the path property.\n\n Args:\n delta: Comparison/quantization delta.\n nstate: State number threshold.\n weight: A Weight or weight string indicating the desired weight threshold\n below which paths are pruned; if omitted, no paths are pruned.\n\n Returns:\n self.\n\n See also: The constructive variant.\n ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
float __pyx_v_delta;
__pyx_t_10basictypes_int64 __pyx_v_nstate;
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":2185
+ /* "pywrapfst.pyx":2178
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None): # <<<<<<<<<<<<<<
* """
- * prune(self, delta=0.0009765625, nstate=-1, weight=None)
+ * prune(self, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)
*/
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 2182, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 2175, __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, 2183, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2176, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__19;
+ __pyx_v_delta = __pyx_k__20;
}
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, 2184, __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, 2177, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__20;
+ __pyx_v_nstate = __pyx_k__21;
}
__pyx_v_weight = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2182, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2175, __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":2182
+ /* "pywrapfst.pyx":2175
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune __pyx_t_1;
__Pyx_RefNannySetupContext("prune", 0);
- /* "pywrapfst.pyx":2207
+ /* "pywrapfst.pyx":2200
* 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, 2207, __pyx_L1_error)
+ __PYX_ERR(0, 2200, __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, 2207, __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, 2200, __pyx_L1_error)
- /* "pywrapfst.pyx":2208
+ /* "pywrapfst.pyx":2201
* """
* self._prune(delta, nstate, weight)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2182
+ /* "pywrapfst.pyx":2175
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2210
+/* "pywrapfst.pyx":2203
* 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__21;
+ float __pyx_v_delta = __pyx_k__22;
- /* "pywrapfst.pyx":2212
+ /* "pywrapfst.pyx":2205
* cdef void _push(self,
* float delta=fst.kDelta,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_total_weight = ((bool)0);
- /* "pywrapfst.pyx":2213
+ /* "pywrapfst.pyx":2206
* float delta=fst.kDelta,
* bool remove_total_weight=False,
* bool to_final=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2214
+ /* "pywrapfst.pyx":2207
* 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, 2214, __pyx_L1_error)
+ __PYX_ERR(0, 2207, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2215
+ /* "pywrapfst.pyx":2208
* 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":2216
+ /* "pywrapfst.pyx":2209
* 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, 2216, __pyx_L1_error)
+ __PYX_ERR(0, 2209, __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, 2216, __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, 2209, __pyx_L1_error)
- /* "pywrapfst.pyx":2210
+ /* "pywrapfst.pyx":2203
* return self
*
* cdef void _push(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2218
+/* "pywrapfst.pyx":2211
* 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, 2218, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 2211, __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, 2219, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2212, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__22;
+ __pyx_v_delta = __pyx_k__23;
}
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, 2220, __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, 2213, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2220
+ /* "pywrapfst.pyx":2213
* 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, 2221, __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, 2214, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2221
+ /* "pywrapfst.pyx":2214
* 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, 2218, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("push", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2211, __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":2218
+ /* "pywrapfst.pyx":2211
* self._check_mutating_imethod()
*
* def push(self, # <<<<<<<<<<<<<<
struct __pyx_opt_args_9pywrapfst_11_MutableFst__push __pyx_t_1;
__Pyx_RefNannySetupContext("push", 0);
- /* "pywrapfst.pyx":2247
+ /* "pywrapfst.pyx":2240
* 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, 2247, __pyx_L1_error)
+ __PYX_ERR(0, 2240, __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, 2247, __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, 2240, __pyx_L1_error)
- /* "pywrapfst.pyx":2248
+ /* "pywrapfst.pyx":2241
* """
* self._push(delta, remove_total_weight, to_final)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2218
+ /* "pywrapfst.pyx":2211
* self._check_mutating_imethod()
*
* def push(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2250
+/* "pywrapfst.pyx":2243
* return self
*
* cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2252
+ /* "pywrapfst.pyx":2245
* 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, 2252, __pyx_L1_error)
+ __PYX_ERR(0, 2245, __pyx_L1_error)
}
__pyx_v__ipairs.reset(__pyx_t_1);
- /* "pywrapfst.pyx":2254
+ /* "pywrapfst.pyx":2247
* _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, 2254, __pyx_L1_error)
+ __PYX_ERR(0, 2247, __pyx_L1_error)
}
__pyx_v__opairs.reset(__pyx_t_1);
- /* "pywrapfst.pyx":2257
+ /* "pywrapfst.pyx":2250
* 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, 2257, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2250, __pyx_L1_error)
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2258
+ /* "pywrapfst.pyx":2251
* 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, 2258, __pyx_L1_error)
+ __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ipairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2251, __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, 2258, __pyx_L1_error)
+ __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2251, __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, 2258, __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, 2251, __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, 2258, __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, 2251, __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, 2258, __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, 2251, __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, 2258, __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, 2251, __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, 2258, __pyx_L1_error)
+ else __PYX_ERR(0, 2251, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 2258, __pyx_L1_error)
+ __PYX_ERR(0, 2251, __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, 2258, __pyx_L1_error)
+ __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2251, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2258, __pyx_L1_error)
+ __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2251, __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, 2258, __pyx_L1_error)
+ __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2251, __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, 2258, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2251, __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, 2258, __pyx_L1_error)
+ __PYX_ERR(0, 2251, __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, 2258, __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, 2251, __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, 2258, __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, 2251, __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":2259
+ /* "pywrapfst.pyx":2252
* 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, 2259, __pyx_L1_error)
+ __PYX_ERR(0, 2252, __pyx_L1_error)
}
try {
__pyx_v__ipairs.get()->push_back(__pyx_t_13);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2259, __pyx_L1_error)
+ __PYX_ERR(0, 2252, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2258
+ /* "pywrapfst.pyx":2251
* cdef int64 after
* if ipairs:
* for (before, after) in ipairs: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "pywrapfst.pyx":2257
+ /* "pywrapfst.pyx":2250
* cdef int64 before
* cdef int64 after
* if ipairs: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2260
+ /* "pywrapfst.pyx":2253
* 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, 2260, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2253, __pyx_L1_error)
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2261
+ /* "pywrapfst.pyx":2254
* _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, 2261, __pyx_L1_error)
+ __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_opairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2254, __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, 2261, __pyx_L1_error)
+ __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2254, __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, 2261, __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, 2254, __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, 2261, __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, 2254, __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, 2261, __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, 2254, __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, 2261, __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, 2254, __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, 2261, __pyx_L1_error)
+ else __PYX_ERR(0, 2254, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 2261, __pyx_L1_error)
+ __PYX_ERR(0, 2254, __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, 2261, __pyx_L1_error)
+ __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2254, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2261, __pyx_L1_error)
+ __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2254, __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, 2261, __pyx_L1_error)
+ __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2254, __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, 2261, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2254, __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, 2261, __pyx_L1_error)
+ __PYX_ERR(0, 2254, __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, 2261, __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, 2254, __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, 2261, __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, 2254, __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":2262
+ /* "pywrapfst.pyx":2255
* 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, 2262, __pyx_L1_error)
+ __PYX_ERR(0, 2255, __pyx_L1_error)
}
try {
__pyx_v__opairs.get()->push_back(__pyx_t_13);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2262, __pyx_L1_error)
+ __PYX_ERR(0, 2255, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2261
+ /* "pywrapfst.pyx":2254
* _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":2260
+ /* "pywrapfst.pyx":2253
* for (before, after) in ipairs:
* _ipairs.get().push_back(fst.LabelPair(before, after))
* if opairs: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2263
+ /* "pywrapfst.pyx":2256
* 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":2264
+ /* "pywrapfst.pyx":2257
* _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, 2264, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2264, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2257, __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, 2264, __pyx_L1_error)
+ __PYX_ERR(0, 2257, __pyx_L1_error)
- /* "pywrapfst.pyx":2263
+ /* "pywrapfst.pyx":2256
* for (before, after) in opairs:
* _opairs.get().push_back(fst.LabelPair(before, after))
* if _ipairs.get().empty() and _opairs.get().empty(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2265
+ /* "pywrapfst.pyx":2258
* 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, 2265, __pyx_L1_error)
+ __PYX_ERR(0, 2258, __pyx_L1_error)
}
fst::script::Relabel(__pyx_v_self->_mfst.get(), (*__pyx_v__ipairs), (*__pyx_v__opairs));
- /* "pywrapfst.pyx":2266
+ /* "pywrapfst.pyx":2259
* 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, 2266, __pyx_L1_error)
+ __PYX_ERR(0, 2259, __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, 2266, __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, 2259, __pyx_L1_error)
- /* "pywrapfst.pyx":2250
+ /* "pywrapfst.pyx":2243
* return self
*
* cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2268
+/* "pywrapfst.pyx":2261
* 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, 2268, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_pairs") < 0)) __PYX_ERR(0, 2261, __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, 2268, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("relabel_pairs", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2261, __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":2290
+ /* "pywrapfst.pyx":2283
* 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, 2290, __pyx_L1_error)
+ __PYX_ERR(0, 2283, __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, 2290, __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, 2283, __pyx_L1_error)
- /* "pywrapfst.pyx":2291
+ /* "pywrapfst.pyx":2284
* """
* self._relabel_pairs(ipairs, opairs)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2268
+ /* "pywrapfst.pyx":2261
* self._check_mutating_imethod()
*
* def relabel_pairs(self, ipairs=None, opairs=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2293
+/* "pywrapfst.pyx":2286
* 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":2294
+ /* "pywrapfst.pyx":2287
*
* 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":2295
+ /* "pywrapfst.pyx":2288
* cdef void _relabel_tables(self,
* _SymbolTable old_isymbols=None,
* _SymbolTable new_isymbols=None, # <<<<<<<<<<<<<<
* bool attach_new_isymbols=True,
*/
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__5);
+ PyObject *__pyx_v_unknown_isymbol = ((PyObject *)__pyx_kp_b__6);
- /* "pywrapfst.pyx":2297
+ /* "pywrapfst.pyx":2290
* _SymbolTable new_isymbols=None,
* unknown_isymbol=b"",
* bool attach_new_isymbols=True, # <<<<<<<<<<<<<<
*/
bool __pyx_v_attach_new_isymbols = ((bool)1);
- /* "pywrapfst.pyx":2298
+ /* "pywrapfst.pyx":2291
* 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":2299
+ /* "pywrapfst.pyx":2292
* bool attach_new_isymbols=True,
* _SymbolTable old_osymbols=None,
* _SymbolTable new_osymbols=None, # <<<<<<<<<<<<<<
* bool attach_new_osymbols=True) except *:
*/
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__5);
+ PyObject *__pyx_v_unknown_osymbol = ((PyObject *)__pyx_kp_b__6);
- /* "pywrapfst.pyx":2301
+ /* "pywrapfst.pyx":2294
* _SymbolTable new_osymbols=None,
* unknown_osymbol=b"",
* bool attach_new_osymbols=True) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2302
+ /* "pywrapfst.pyx":2295
* 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":2303
+ /* "pywrapfst.pyx":2296
* 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, 2303, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2303, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2296, __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, 2303, __pyx_L1_error)
+ __PYX_ERR(0, 2296, __pyx_L1_error)
- /* "pywrapfst.pyx":2302
+ /* "pywrapfst.pyx":2295
* unknown_osymbol=b"",
* bool attach_new_osymbols=True) except *:
* if new_isymbols is None and new_osymbols is None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2304
+ /* "pywrapfst.pyx":2297
* 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":2305
+ /* "pywrapfst.pyx":2298
* 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":2306
+ /* "pywrapfst.pyx":2299
* 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, 2306, __pyx_L1_error)
+ __PYX_ERR(0, 2299, __pyx_L1_error)
}
__pyx_t_6 = __pyx_v_new_isymbols->_table;
__pyx_v_new_isymbols_ptr = __pyx_t_6;
- /* "pywrapfst.pyx":2305
+ /* "pywrapfst.pyx":2298
* raise FstArgError("No new SymbolTables specified")
* cdef fst.SymbolTable *new_isymbols_ptr = NULL
* if new_isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2307
+ /* "pywrapfst.pyx":2300
* 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":2308
+ /* "pywrapfst.pyx":2301
* 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":2309
+ /* "pywrapfst.pyx":2302
* 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, 2309, __pyx_L1_error)
+ __PYX_ERR(0, 2302, __pyx_L1_error)
}
__pyx_t_6 = __pyx_v_new_osymbols->_table;
__pyx_v_new_osymbols_ptr = __pyx_t_6;
- /* "pywrapfst.pyx":2308
+ /* "pywrapfst.pyx":2301
* new_isymbols_ptr = new_isymbols._table
* cdef fst.SymbolTable *new_osymbols_ptr = NULL
* if new_osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2310
+ /* "pywrapfst.pyx":2303
* 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, 2310, __pyx_L1_error)
+ __PYX_ERR(0, 2303, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2311
+ /* "pywrapfst.pyx":2304
* 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, 2311, __pyx_L1_error)
+ __PYX_ERR(0, 2304, __pyx_L1_error)
}
__pyx_t_7 = __pyx_v_self->__pyx_base._fst.get()->InputSymbols();
} else {
- /* "pywrapfst.pyx":2312
+ /* "pywrapfst.pyx":2305
* 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, 2312, __pyx_L1_error)
+ __PYX_ERR(0, 2305, __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, 2312, __pyx_L1_error)
+ __pyx_t_8 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_isymbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2305, __pyx_L1_error)
- /* "pywrapfst.pyx":2314
+ /* "pywrapfst.pyx":2307
* 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, 2314, __pyx_L1_error)
+ __PYX_ERR(0, 2307, __pyx_L1_error)
}
__pyx_t_9 = __pyx_v_self->__pyx_base._fst.get()->OutputSymbols();
} else {
- /* "pywrapfst.pyx":2315
+ /* "pywrapfst.pyx":2308
* 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, 2315, __pyx_L1_error)
+ __PYX_ERR(0, 2308, __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, 2315, __pyx_L1_error)
+ __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_osymbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2308, __pyx_L1_error)
- /* "pywrapfst.pyx":2310
+ /* "pywrapfst.pyx":2303
* 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":2317
+ /* "pywrapfst.pyx":2310
* 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, 2317, __pyx_L1_error)
+ __PYX_ERR(0, 2310, __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, 2317, __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, 2310, __pyx_L1_error)
- /* "pywrapfst.pyx":2293
+ /* "pywrapfst.pyx":2286
* return self
*
* cdef void _relabel_tables(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2319
+/* "pywrapfst.pyx":2312
* 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":2320
+ /* "pywrapfst.pyx":2313
*
* def relabel_tables(self,
* _SymbolTable old_isymbols=None, # <<<<<<<<<<<<<<
*/
values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":2321
+ /* "pywrapfst.pyx":2314
* def relabel_tables(self,
* _SymbolTable old_isymbols=None,
* _SymbolTable new_isymbols=None, # <<<<<<<<<<<<<<
* bool attach_new_isymbols=True,
*/
values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- values[2] = ((PyObject *)__pyx_kp_b__5);
+ values[2] = ((PyObject *)__pyx_kp_b__6);
- /* "pywrapfst.pyx":2324
+ /* "pywrapfst.pyx":2317
* unknown_isymbol=b"",
* bool attach_new_isymbols=True,
* _SymbolTable old_osymbols=None, # <<<<<<<<<<<<<<
*/
values[4] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- /* "pywrapfst.pyx":2325
+ /* "pywrapfst.pyx":2318
* bool attach_new_isymbols=True,
* _SymbolTable old_osymbols=None,
* _SymbolTable new_osymbols=None, # <<<<<<<<<<<<<<
* bool attach_new_osymbols=True):
*/
values[5] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- values[6] = ((PyObject *)__pyx_kp_b__5);
+ values[6] = ((PyObject *)__pyx_kp_b__6);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_tables") < 0)) __PYX_ERR(0, 2319, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_tables") < 0)) __PYX_ERR(0, 2312, __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, 2323, __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, 2316, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2323
+ /* "pywrapfst.pyx":2316
* _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, 2327, __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, 2320, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2327
+ /* "pywrapfst.pyx":2320
* _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, 2319, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("relabel_tables", 0, 0, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2312, __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, 2320, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_isymbols", 0))) __PYX_ERR(0, 2321, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_osymbols", 0))) __PYX_ERR(0, 2324, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_osymbols", 0))) __PYX_ERR(0, 2325, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_isymbols", 0))) __PYX_ERR(0, 2313, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_isymbols", 0))) __PYX_ERR(0, 2314, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_osymbols", 0))) __PYX_ERR(0, 2317, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_osymbols", 0))) __PYX_ERR(0, 2318, __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":2319
+ /* "pywrapfst.pyx":2312
* 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":2363
+ /* "pywrapfst.pyx":2356
* 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, 2363, __pyx_L1_error)
+ __PYX_ERR(0, 2356, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2366
+ /* "pywrapfst.pyx":2359
* 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, 2363, __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, 2356, __pyx_L1_error)
- /* "pywrapfst.pyx":2367
+ /* "pywrapfst.pyx":2360
* old_osymbols, new_osymbols,
* unknown_osymbol, attach_new_osymbols)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2319
+ /* "pywrapfst.pyx":2312
* self._check_mutating_imethod()
*
* def relabel_tables(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2369
+/* "pywrapfst.pyx":2362
* 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":2370
+ /* "pywrapfst.pyx":2363
*
* 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, 2370, __pyx_L1_error)
+ __PYX_ERR(0, 2363, __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":2371
+ /* "pywrapfst.pyx":2364
* 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, 2371, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2371, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2364, __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, 2371, __pyx_L1_error)
+ __PYX_ERR(0, 2364, __pyx_L1_error)
- /* "pywrapfst.pyx":2370
+ /* "pywrapfst.pyx":2363
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *:
* if not self._mfst.get().ReserveArcs(state, n): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2372
+ /* "pywrapfst.pyx":2365
* 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, 2372, __pyx_L1_error)
+ __PYX_ERR(0, 2365, __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, 2372, __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, 2365, __pyx_L1_error)
- /* "pywrapfst.pyx":2369
+ /* "pywrapfst.pyx":2362
* return self
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2374
+/* "pywrapfst.pyx":2367
* 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, 2374, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2367, __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, 2374, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reserve_arcs") < 0)) __PYX_ERR(0, 2367, __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, 2374, __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, 2374, __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, 2367, __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, 2367, __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, 2374, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2367, __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":2392
+ /* "pywrapfst.pyx":2385
* 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, 2392, __pyx_L1_error)
+ __PYX_ERR(0, 2385, __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, 2392, __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, 2385, __pyx_L1_error)
- /* "pywrapfst.pyx":2393
+ /* "pywrapfst.pyx":2386
* """
* self._reserve_arcs(state, n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2374
+ /* "pywrapfst.pyx":2367
* self._check_mutating_imethod()
*
* def reserve_arcs(self, int64 state, size_t n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2395
+/* "pywrapfst.pyx":2388
* return self
*
* cdef void _reserve_states(self, int64 n) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_reserve_states", 0);
- /* "pywrapfst.pyx":2396
+ /* "pywrapfst.pyx":2389
*
* 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, 2396, __pyx_L1_error)
+ __PYX_ERR(0, 2389, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->ReserveStates(__pyx_v_n);
- /* "pywrapfst.pyx":2397
+ /* "pywrapfst.pyx":2390
* 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, 2397, __pyx_L1_error)
+ __PYX_ERR(0, 2390, __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, 2397, __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, 2390, __pyx_L1_error)
- /* "pywrapfst.pyx":2395
+ /* "pywrapfst.pyx":2388
* return self
*
* cdef void _reserve_states(self, int64 n) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2399
+/* "pywrapfst.pyx":2392
* 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, 2399, __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, 2392, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reserve_states", 0);
- /* "pywrapfst.pyx":2413
+ /* "pywrapfst.pyx":2406
* 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, 2413, __pyx_L1_error)
+ __PYX_ERR(0, 2406, __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, 2413, __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, 2406, __pyx_L1_error)
- /* "pywrapfst.pyx":2414
+ /* "pywrapfst.pyx":2407
* """
* self._reserve_states(n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2399
+ /* "pywrapfst.pyx":2392
* self._check_mutating_imethod()
*
* def reserve_states(self, int64 n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2416
+/* "pywrapfst.pyx":2409
* return self
*
* cdef void _reweight(self, potentials, bool to_final=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2418
+ /* "pywrapfst.pyx":2411
* 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, 2418, __pyx_L1_error)
+ __PYX_ERR(0, 2411, __pyx_L1_error)
}
__pyx_v__potentials.reset(__pyx_t_1);
- /* "pywrapfst.pyx":2419
+ /* "pywrapfst.pyx":2412
* 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, 2419, __pyx_L1_error)
+ __PYX_ERR(0, 2412, __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":2420
+ /* "pywrapfst.pyx":2413
* _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, 2420, __pyx_L1_error)
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_potentials); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2413, __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, 2420, __pyx_L1_error)
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2413, __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, 2420, __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, 2413, __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, 2420, __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, 2413, __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, 2420, __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, 2413, __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, 2420, __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, 2413, __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, 2420, __pyx_L1_error)
+ else __PYX_ERR(0, 2413, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_weight, __pyx_t_5);
__pyx_t_5 = 0;
- /* "pywrapfst.pyx":2421
+ /* "pywrapfst.pyx":2414
* 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, 2421, __pyx_L1_error)
+ __PYX_ERR(0, 2414, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2422
+ /* "pywrapfst.pyx":2415
* 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, 2421, __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, 2414, __pyx_L1_error)
- /* "pywrapfst.pyx":2421
+ /* "pywrapfst.pyx":2414
* 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, 2421, __pyx_L1_error)
+ __PYX_ERR(0, 2414, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2420
+ /* "pywrapfst.pyx":2413
* _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":2423
+ /* "pywrapfst.pyx":2416
* _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, 2423, __pyx_L1_error)
+ __PYX_ERR(0, 2416, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2424
+ /* "pywrapfst.pyx":2417
* 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":2425
+ /* "pywrapfst.pyx":2418
* 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, 2425, __pyx_L1_error)
+ __PYX_ERR(0, 2418, __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)
+ ((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, 2418, __pyx_L1_error)
- /* "pywrapfst.pyx":2416
+ /* "pywrapfst.pyx":2409
* return self
*
* cdef void _reweight(self, potentials, bool to_final=False) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2427
+/* "pywrapfst.pyx":2420
* 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, 2427, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reweight") < 0)) __PYX_ERR(0, 2420, __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, 2427, __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, 2420, __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, 2427, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reweight", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2420, __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":2449
+ /* "pywrapfst.pyx":2442
* 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, 2449, __pyx_L1_error)
+ __PYX_ERR(0, 2442, __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, 2449, __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, 2442, __pyx_L1_error)
- /* "pywrapfst.pyx":2450
+ /* "pywrapfst.pyx":2443
* """
* self._reweight(potentials, to_final)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2427
+ /* "pywrapfst.pyx":2420
* self._check_mutating_imethod()
*
* def reweight(self, potentials, bool to_final=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2452
+/* "pywrapfst.pyx":2445
* return self
*
* cdef void _rmepsilon(self, # <<<<<<<<<<<<<<
+ * queue_type=b"auto",
* bool connect=True,
- * float delta=fst.kDelta,
*/
static void __pyx_f_9pywrapfst_11_MutableFst__rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon *__pyx_optional_args) {
+ PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":2453
- *
+ /* "pywrapfst.pyx":2447
* cdef void _rmepsilon(self,
+ * queue_type=b"auto",
* bool connect=True, # <<<<<<<<<<<<<<
- * float delta=fst.kDelta,
+ * weight=None,
* int64 nstate=fst.kNoStateId,
*/
bool __pyx_v_connect = ((bool)1);
- float __pyx_v_delta = __pyx_k__26;
- __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__27;
- /* "pywrapfst.pyx":2456
- * float delta=fst.kDelta,
+ /* "pywrapfst.pyx":2448
+ * queue_type=b"auto",
+ * bool connect=True,
+ * weight=None, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
- * 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(),
+ * float delta=fst.kDelta) except *:
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
+ __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__27;
+ float __pyx_v_delta = __pyx_k__28;
fst::script::WeightClass __pyx_v_wc;
+ std::unique_ptr<fst::script::RmEpsilonOptions> __pyx_v_opts;
__Pyx_RefNannyDeclarations
fst::script::WeightClass __pyx_t_1;
+ std::string __pyx_t_2;
+ enum fst::QueueType __pyx_t_3;
__Pyx_RefNannySetupContext("_rmepsilon", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
- __pyx_v_connect = __pyx_optional_args->connect;
+ __pyx_v_queue_type = __pyx_optional_args->queue_type;
if (__pyx_optional_args->__pyx_n > 1) {
- __pyx_v_delta = __pyx_optional_args->delta;
+ __pyx_v_connect = __pyx_optional_args->connect;
if (__pyx_optional_args->__pyx_n > 2) {
- __pyx_v_nstate = __pyx_optional_args->nstate;
+ __pyx_v_weight = __pyx_optional_args->weight;
if (__pyx_optional_args->__pyx_n > 3) {
- __pyx_v_weight = __pyx_optional_args->weight;
+ __pyx_v_nstate = __pyx_optional_args->nstate;
+ if (__pyx_optional_args->__pyx_n > 4) {
+ __pyx_v_delta = __pyx_optional_args->delta;
+ }
}
}
}
}
}
- /* "pywrapfst.pyx":2458
- * weight=None) except *:
- * # Threshold is set to semiring Zero (no pruning) if weight unspecified.
+ /* "pywrapfst.pyx":2451
+ * int64 nstate=fst.kNoStateId,
+ * float delta=fst.kDelta) except *:
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(), # <<<<<<<<<<<<<<
* weight)
- * fst.RmEpsilon(self._mfst.get(), connect, wc, nstate, delta)
+ * cdef unique_ptr[fst.RmEpsilonOptions] opts
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 2458, __pyx_L1_error)
+ __PYX_ERR(0, 2451, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2459
- * # Threshold is set to semiring Zero (no pruning) if weight unspecified.
+ /* "pywrapfst.pyx":2452
+ * float delta=fst.kDelta) except *:
* 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()
+ * cdef unique_ptr[fst.RmEpsilonOptions] opts
+ * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
*/
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2458, __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, 2451, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":2460
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
+ /* "pywrapfst.pyx":2454
* weight)
- * fst.RmEpsilon(self._mfst.get(), connect, wc, nstate, delta) # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.RmEpsilonOptions] opts
+ * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
+ * connect, wc, nstate, delta))
+ * fst.RmEpsilon(self._mfst.get(), deref(opts))
+ */
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L1_error)
+
+ /* "pywrapfst.pyx":2455
+ * cdef unique_ptr[fst.RmEpsilonOptions] opts
+ * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
+ * connect, wc, nstate, delta)) # <<<<<<<<<<<<<<
+ * fst.RmEpsilon(self._mfst.get(), deref(opts))
+ * self._check_mutating_imethod()
+ */
+ __pyx_v_opts.reset(new fst::script::RmEpsilonOptions(__pyx_t_3, __pyx_v_connect, __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta));
+
+ /* "pywrapfst.pyx":2456
+ * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
+ * connect, wc, nstate, delta))
+ * fst.RmEpsilon(self._mfst.get(), deref(opts)) # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
- __PYX_ERR(0, 2460, __pyx_L1_error)
+ __PYX_ERR(0, 2456, __pyx_L1_error)
}
- fst::script::RmEpsilon(__pyx_v_self->_mfst.get(), __pyx_v_connect, __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
+ fst::script::RmEpsilon(__pyx_v_self->_mfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":2461
- * weight)
- * fst.RmEpsilon(self._mfst.get(), connect, wc, nstate, delta)
+ /* "pywrapfst.pyx":2457
+ * connect, wc, nstate, delta))
+ * fst.RmEpsilon(self._mfst.get(), deref(opts))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*
* def rmepsilon(self,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2461, __pyx_L1_error)
+ __PYX_ERR(0, 2457, __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, 2461, __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, 2457, __pyx_L1_error)
- /* "pywrapfst.pyx":2452
+ /* "pywrapfst.pyx":2445
* return self
*
* cdef void _rmepsilon(self, # <<<<<<<<<<<<<<
+ * queue_type=b"auto",
* bool connect=True,
- * float delta=fst.kDelta,
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2463
+/* "pywrapfst.pyx":2459
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
+ * queue_type=b"auto",
* bool connect=True,
- * float delta=fst.kDelta,
*/
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_48rmepsilon[] = "\n rmepsilon(self, connect=True, delta=0.0009765625, nstate=-1, weight=None)\n\n Removes epsilon transitions.\n\n This operation destructively removes epsilon transitions, i.e., those where\n both input and output labels are epsilon) from an FST.\n\n Args:\n connect: Should output be trimmed?\n delta: Comparison/quantization delta.\n nstate: State number threshold.\n weight: A Weight or weight string indicating the desired weight threshold\n below which paths are pruned; if omitted, no paths are pruned.\n\n Returns:\n self.\n\n See also: The constructive variant, which also supports epsilon removal in\n reverse (and which may be more efficient).\n ";
+static char __pyx_doc_9pywrapfst_11_MutableFst_48rmepsilon[] = "\n rmepsilon(self, queue_type=\"auto\", connect=True, weight=None,\n nstate=NO_STATE_ID, delta=0.0009765625):\n\n Removes epsilon transitions.\n\n This operation destructively removes epsilon transitions, i.e., those where\n both input and output labels are epsilon) from an FST.\n\n Args:\n queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n \"lifo\", \"shortest\", \"state\", \"top\".\n connect: Should output be trimmed?\n weight: A Weight or weight string indicating the desired weight threshold\n below which paths are pruned; if omitted, no paths are pruned.\n nstate: State number threshold.\n delta: Comparison/quantization delta.\n\n Returns:\n self.\n ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_queue_type = 0;
bool __pyx_v_connect;
- float __pyx_v_delta;
- __pyx_t_10basictypes_int64 __pyx_v_nstate;
PyObject *__pyx_v_weight = 0;
+ __pyx_t_10basictypes_int64 __pyx_v_nstate;
+ float __pyx_v_delta;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("rmepsilon (wrapper)", 0);
{
- 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};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_queue_type,&__pyx_n_s_connect,&__pyx_n_s_weight,&__pyx_n_s_nstate,&__pyx_n_s_delta,0};
+ PyObject* values[5] = {0,0,0,0,0};
+ values[0] = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":2467
- * float delta=fst.kDelta,
+ /* "pywrapfst.pyx":2462
+ * queue_type=b"auto",
+ * bool connect=True,
+ * weight=None, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
- * weight=None): # <<<<<<<<<<<<<<
- * """
- * rmepsilon(self, connect=True, delta=0.0009765625, nstate=-1, weight=None)
+ * float delta=fst.kDelta):
*/
- values[3] = ((PyObject *)Py_None);
+ values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
switch (pos_args) {
case 0:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_connect);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_type);
if (value) { values[0] = value; kw_args--; }
}
case 1:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_connect);
if (value) { values[1] = value; kw_args--; }
}
case 2:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nstate);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight);
if (value) { values[2] = value; kw_args--; }
}
case 3:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nstate);
if (value) { values[3] = value; kw_args--; }
}
+ case 4:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
+ if (value) { values[4] = value; kw_args--; }
+ }
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 2463, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 2459, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
default: goto __pyx_L5_argtuple_error;
}
}
- if (values[0]) {
- __pyx_v_connect = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2464, __pyx_L3_error)
+ __pyx_v_queue_type = values[0];
+ if (values[1]) {
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2461, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2464
- *
+ /* "pywrapfst.pyx":2461
* def rmepsilon(self,
+ * queue_type=b"auto",
* bool connect=True, # <<<<<<<<<<<<<<
- * float delta=fst.kDelta,
+ * weight=None,
* int64 nstate=fst.kNoStateId,
*/
__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, 2465, __pyx_L3_error)
+ __pyx_v_weight = values[2];
+ if (values[3]) {
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2463, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__28;
+ __pyx_v_nstate = __pyx_k__29;
}
- 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, 2466, __pyx_L3_error)
+ if (values[4]) {
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2464, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__29;
+ __pyx_v_delta = __pyx_k__30;
}
- __pyx_v_weight = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2463, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2459, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_connect, __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);
+ __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_queue_type, __pyx_v_connect, __pyx_v_weight, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":2463
+ /* "pywrapfst.pyx":2459
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
+ * queue_type=b"auto",
* bool connect=True,
- * float delta=fst.kDelta,
*/
/* function exit code */
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_connect, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_weight) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, __pyx_t_10basictypes_int64 __pyx_v_nstate, float __pyx_v_delta) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon __pyx_t_1;
__Pyx_RefNannySetupContext("rmepsilon", 0);
- /* "pywrapfst.pyx":2489
- * reverse (and which may be more efficient).
+ /* "pywrapfst.pyx":2486
+ * self.
* """
- * self._rmepsilon(connect, delta, nstate, weight) # <<<<<<<<<<<<<<
+ * self._rmepsilon(queue_type, connect, weight, nstate, delta) # <<<<<<<<<<<<<<
* return self
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_rmepsilon");
- __PYX_ERR(0, 2489, __pyx_L1_error)
+ __PYX_ERR(0, 2486, __pyx_L1_error)
}
- __pyx_t_1.__pyx_n = 4;
+ __pyx_t_1.__pyx_n = 5;
+ __pyx_t_1.queue_type = __pyx_v_queue_type;
__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, 2489, __pyx_L1_error)
+ __pyx_t_1.nstate = __pyx_v_nstate;
+ __pyx_t_1.delta = __pyx_v_delta;
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_rmepsilon(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2486, __pyx_L1_error)
- /* "pywrapfst.pyx":2490
+ /* "pywrapfst.pyx":2487
* """
- * self._rmepsilon(connect, delta, nstate, weight)
+ * self._rmepsilon(queue_type, connect, weight, nstate, delta)
* return self # <<<<<<<<<<<<<<
*
* cdef void _set_final(self, int64 state, weight=None) except *:
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2463
+ /* "pywrapfst.pyx":2459
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
+ * queue_type=b"auto",
* bool connect=True,
- * float delta=fst.kDelta,
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":2492
+/* "pywrapfst.pyx":2489
* return self
*
* cdef void _set_final(self, int64 state, weight=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2493
+ /* "pywrapfst.pyx":2490
*
* 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, 2493, __pyx_L1_error)
+ __PYX_ERR(0, 2490, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2494
+ /* "pywrapfst.pyx":2491
* 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, 2494, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2491, __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, 2494, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2491, __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, 2494, __pyx_L1_error)
+ __PYX_ERR(0, 2491, __pyx_L1_error)
- /* "pywrapfst.pyx":2493
+ /* "pywrapfst.pyx":2490
*
* cdef void _set_final(self, int64 state, weight=None) except *:
* if not self._mfst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2495
+ /* "pywrapfst.pyx":2492
* 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, 2495, __pyx_L1_error)
+ __PYX_ERR(0, 2492, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2496
+ /* "pywrapfst.pyx":2493
* 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, 2495, __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, 2492, __pyx_L1_error)
__pyx_v_wc = __pyx_t_4;
- /* "pywrapfst.pyx":2497
+ /* "pywrapfst.pyx":2494
* 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, 2497, __pyx_L1_error)
+ __PYX_ERR(0, 2494, __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":2498
+ /* "pywrapfst.pyx":2495
* 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, 2498, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2495, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2498, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2495, __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, 2498, __pyx_L1_error)
+ __PYX_ERR(0, 2495, __pyx_L1_error)
- /* "pywrapfst.pyx":2497
+ /* "pywrapfst.pyx":2494
* cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
* weight)
* if not self._mfst.get().SetFinal(state, wc): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2499
+ /* "pywrapfst.pyx":2496
* 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, 2499, __pyx_L1_error)
+ __PYX_ERR(0, 2496, __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, 2499, __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, 2496, __pyx_L1_error)
- /* "pywrapfst.pyx":2492
+ /* "pywrapfst.pyx":2489
* return self
*
* cdef void _set_final(self, int64 state, weight=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2501
+/* "pywrapfst.pyx":2498
* self._check_mutating_imethod()
*
* def set_final(self, int64 state, weight=None): # <<<<<<<<<<<<<<
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_51set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_50set_final[] = "\n set_final(self, state, weight)\n\n Sets the final weight for a state.\n\n Args:\n state: The integer index of a state.\n weight: A Weight or weight string indicating the desired final weight; if\n omitted, it is set to semiring One.\n\n Raises:\n FstIndexError: State index out of range.\n FstOpError: Incompatible or invalid weight.\n\n See also: `set_start`.\n ";
+static char __pyx_doc_9pywrapfst_11_MutableFst_50set_final[] = "\n set_final(self, state, weight)\n\n Sets the final weight for a state.\n\n Args:\n state: The integer index of a state.\n weight: A Weight or weight string indicating the desired final weight; if\n omitted, it is set to semiring One.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n FstOpError: Incompatible or invalid weight.\n\n See also: `set_start`.\n ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_51set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__pyx_t_10basictypes_int64 __pyx_v_state;
PyObject *__pyx_v_weight = 0;
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2501, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2498, __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, 2501, __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, 2498, __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, 2501, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_final", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2498, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableFst.set_final", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2501
+ /* "pywrapfst.pyx":2498
* self._check_mutating_imethod()
*
* def set_final(self, int64 state, weight=None): # <<<<<<<<<<<<<<
*/
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2595, __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, 2595, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2595, __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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2621, __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__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2621, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2621, __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;
*/
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2690, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2690, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2690, __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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2698, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2698, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2698, __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);
return __pyx_r;
}
-/* "pywrapfst.pyx":2921
+/* "pywrapfst.pyx":2926
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":2922
+ /* "pywrapfst.pyx":2927
*
* 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, 2922, __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, 2927, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2922, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2927, __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, 2922, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2927, __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, 2922, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2927, __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, 2922, __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, 2927, __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, 2922, __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, 2927, __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, 2922, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2927, __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, 2922, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2927, __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":2921
+ /* "pywrapfst.pyx":2926
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2924
+/* "pywrapfst.pyx":2929
* 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, 2924, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 2929, __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, 2924, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 2929, __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, 2924, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 2929, __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, 2924, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2929, __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, 2924, __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, 2924, __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, 2929, __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, 2929, __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, 2924, __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, 2929, __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, 2924, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2929, __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":2925
+ /* "pywrapfst.pyx":2930
*
* 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, 2925, __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, 2925, __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, 2930, __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, 2930, __pyx_L1_error)
__pyx_v_wc = __pyx_t_2;
- /* "pywrapfst.pyx":2926
+ /* "pywrapfst.pyx":2931
* 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, 2926, __pyx_L1_error)
+ __PYX_ERR(0, 2931, __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":2924
+ /* "pywrapfst.pyx":2929
* return "<Arc at 0x{:x}>".format(id(self))
*
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2928
+/* "pywrapfst.pyx":2933
* 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, 2928, __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, 2933, __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, 2928, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2933, __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, 2928, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2933, __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, 2928, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Arc))))) __PYX_ERR(0, 2933, __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":2929
+ /* "pywrapfst.pyx":2934
*
* 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, 2929, __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, 2934, __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, 2929, __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, 2934, __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, 2929, __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, 2934, __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, 2929, __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, 2934, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2929, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2934, __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, 2929, __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, 2934, __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":2928
+ /* "pywrapfst.pyx":2933
* 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, 2928, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Arc_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2933, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2933
+/* "pywrapfst.pyx":2938
* property ilabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":2934
+ /* "pywrapfst.pyx":2939
*
* 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, 2934, __pyx_L1_error)
+ __PYX_ERR(0, 2939, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2934, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2939, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2933
+ /* "pywrapfst.pyx":2938
* property ilabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2936
+/* "pywrapfst.pyx":2941
* 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, 2936, __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, 2941, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":2937
+ /* "pywrapfst.pyx":2942
*
* 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, 2937, __pyx_L1_error)
+ __PYX_ERR(0, 2942, __pyx_L1_error)
}
(*__pyx_v_self->_arc).ilabel = __pyx_v_value;
- /* "pywrapfst.pyx":2936
+ /* "pywrapfst.pyx":2941
* return deref(self._arc).ilabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2941
+/* "pywrapfst.pyx":2946
* property olabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":2942
+ /* "pywrapfst.pyx":2947
*
* 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, 2942, __pyx_L1_error)
+ __PYX_ERR(0, 2947, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2942, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2947, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2941
+ /* "pywrapfst.pyx":2946
* property olabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2944
+/* "pywrapfst.pyx":2949
* 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, 2944, __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, 2949, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":2945
+ /* "pywrapfst.pyx":2950
*
* 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, 2945, __pyx_L1_error)
+ __PYX_ERR(0, 2950, __pyx_L1_error)
}
(*__pyx_v_self->_arc).olabel = __pyx_v_value;
- /* "pywrapfst.pyx":2944
+ /* "pywrapfst.pyx":2949
* return deref(self._arc).olabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2949
+/* "pywrapfst.pyx":2954
* property weight:
*
* def __get__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":2950
+ /* "pywrapfst.pyx":2955
*
* 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, 2950, __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, 2955, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2950, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2955, __pyx_L1_error)
__pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":2951
+ /* "pywrapfst.pyx":2956
* 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, 2951, __pyx_L1_error)
+ __PYX_ERR(0, 2956, __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, 2951, __pyx_L1_error)
+ __PYX_ERR(0, 2956, __pyx_L1_error)
}
__pyx_v_weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_arc).weight));
- /* "pywrapfst.pyx":2952
+ /* "pywrapfst.pyx":2957
* 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":2949
+ /* "pywrapfst.pyx":2954
* property weight:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2954
+/* "pywrapfst.pyx":2959
* return weight
*
* def __set__(self, weight): # <<<<<<<<<<<<<<
fst::script::WeightClass __pyx_t_2;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":2955
+ /* "pywrapfst.pyx":2960
*
* 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, 2955, __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, 2955, __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, 2960, __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, 2960, __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, 2955, __pyx_L1_error)
+ __PYX_ERR(0, 2960, __pyx_L1_error)
}
(*__pyx_v_self->_arc).weight = __pyx_t_2;
- /* "pywrapfst.pyx":2954
+ /* "pywrapfst.pyx":2959
* return weight
*
* def __set__(self, weight): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2959
+/* "pywrapfst.pyx":2964
* property nextstate:
*
* def __get__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":2960
+ /* "pywrapfst.pyx":2965
*
* 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, 2960, __pyx_L1_error)
+ __PYX_ERR(0, 2965, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2960, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2965, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2959
+ /* "pywrapfst.pyx":2964
* property nextstate:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2962
+/* "pywrapfst.pyx":2967
* 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, 2962, __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, 2967, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":2963
+ /* "pywrapfst.pyx":2968
*
* 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, 2963, __pyx_L1_error)
+ __PYX_ERR(0, 2968, __pyx_L1_error)
}
(*__pyx_v_self->_arc).nextstate = __pyx_v_value;
- /* "pywrapfst.pyx":2962
+ /* "pywrapfst.pyx":2967
* return deref(self._arc).nextstate
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2966
+/* "pywrapfst.pyx":2971
*
*
* cdef Arc _init_Arc(const fst.ArcClass &arc): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("_init_Arc", 0);
- /* "pywrapfst.pyx":2967
+ /* "pywrapfst.pyx":2972
*
* 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, 2967, __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, 2972, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2967, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2972, __pyx_L1_error)
__pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":2968
+ /* "pywrapfst.pyx":2973
* 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, 2968, __pyx_L1_error)
+ __PYX_ERR(0, 2973, __pyx_L1_error)
}
__pyx_v_weight->_weight.reset(new fst::script::WeightClass(__pyx_v_arc.weight));
- /* "pywrapfst.pyx":2969
+ /* "pywrapfst.pyx":2974
* 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, 2969, __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, 2974, __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, 2969, __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, 2974, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":2970
+ /* "pywrapfst.pyx":2975
* 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, 2970, __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, 2975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":2969
+ /* "pywrapfst.pyx":2974
* 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, 2969, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2974, __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, 2969, __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, 2974, __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":2966
+ /* "pywrapfst.pyx":2971
*
*
* cdef Arc _init_Arc(const fst.ArcClass &arc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2981
+/* "pywrapfst.pyx":2986
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":2982
+ /* "pywrapfst.pyx":2987
*
* 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, 2982, __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, 2987, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2982, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2987, __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, 2982, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2987, __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, 2982, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2987, __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, 2982, __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, 2987, __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, 2982, __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, 2987, __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, 2982, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2987, __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, 2982, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2987, __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":2981
+ /* "pywrapfst.pyx":2986
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2984
+/* "pywrapfst.pyx":2989
* 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, 2984, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2989, __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, 2984, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2989, __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, 2984, __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, 2989, __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, 2984, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2989, __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, 2984, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 2989, __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":2985
+ /* "pywrapfst.pyx":2990
*
* 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, 2985, __pyx_L1_error)
+ __PYX_ERR(0, 2990, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_ifst->_fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2986
+ /* "pywrapfst.pyx":2991
* 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, 2986, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2991, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2986, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2991, __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, 2986, __pyx_L1_error)
+ __PYX_ERR(0, 2991, __pyx_L1_error)
- /* "pywrapfst.pyx":2985
+ /* "pywrapfst.pyx":2990
*
* def __init__(self, _Fst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2988
+ /* "pywrapfst.pyx":2993
* 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, 2988, __pyx_L1_error)
+ __PYX_ERR(0, 2993, __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, 2988, __pyx_L1_error)
+ __PYX_ERR(0, 2993, __pyx_L1_error)
}
__pyx_v_self->_fst = __pyx_t_4;
- /* "pywrapfst.pyx":2989
+ /* "pywrapfst.pyx":2994
* # 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, 2989, __pyx_L1_error)
+ __PYX_ERR(0, 2994, __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, 2989, __pyx_L1_error)
+ __PYX_ERR(0, 2994, __pyx_L1_error)
}
__pyx_v_self->_aiter.reset(new fst::script::ArcIteratorClass((*__pyx_v_self->_fst), __pyx_v_state));
- /* "pywrapfst.pyx":2984
+ /* "pywrapfst.pyx":2989
* return "<ArcIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _Fst ifst, int64 state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2992
+/* "pywrapfst.pyx":2997
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":2993
+ /* "pywrapfst.pyx":2998
* # 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":2992
+ /* "pywrapfst.pyx":2997
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2996
+/* "pywrapfst.pyx":3001
*
* # 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":2997
+ /* "pywrapfst.pyx":3002
* # 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, 2997, __pyx_L1_error)
+ __PYX_ERR(0, 3002, __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":2998
+ /* "pywrapfst.pyx":3003
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* self.next()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 2998, __pyx_L1_error)
+ __PYX_ERR(0, 3003, __pyx_L1_error)
- /* "pywrapfst.pyx":2997
+ /* "pywrapfst.pyx":3002
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2999
+ /* "pywrapfst.pyx":3004
* 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, 2999, __pyx_L1_error)
+ __PYX_ERR(0, 3004, __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, 2999, __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, 3004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":3000
+ /* "pywrapfst.pyx":3005
* 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, 3000, __pyx_L1_error)
+ __PYX_ERR(0, 3005, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3001
+ /* "pywrapfst.pyx":3006
* result = self.value()
* self.next()
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":2996
+ /* "pywrapfst.pyx":3001
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3003
+/* "pywrapfst.pyx":3008
* 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, 3003, __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, 3008, __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, 3003, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3008, __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, 3003, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3008, __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, 3003, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3008, __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":3012
+ /* "pywrapfst.pyx":3017
* 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, 3012, __pyx_L1_error)
+ __PYX_ERR(0, 3017, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3003
+ /* "pywrapfst.pyx":3008
* 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, 3003, __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, 3008, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3014
+/* "pywrapfst.pyx":3019
* 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, 3014, __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, 3019, __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, 3014, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3019, __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, 3014, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3019, __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, 3014, __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, 3019, __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":3023
+ /* "pywrapfst.pyx":3028
* 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, 3023, __pyx_L1_error)
+ __PYX_ERR(0, 3028, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":3014
+ /* "pywrapfst.pyx":3019
* 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, 3014, __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, 3019, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3025
+/* "pywrapfst.pyx":3030
* 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, 3025, __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, 3030, __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, 3025, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3030, __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, 3025, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3030, __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":3031
+ /* "pywrapfst.pyx":3036
* Advances the iterator.
* """
* 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, 3031, __pyx_L1_error)
+ __PYX_ERR(0, 3036, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Next();
- /* "pywrapfst.pyx":3025
+ /* "pywrapfst.pyx":3030
* 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, 3025, __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, 3030, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3033
+/* "pywrapfst.pyx":3038
* 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, 3033, __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, 3038, __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, 3033, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3038, __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, 3038, __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, 3033, __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, 3038, __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":3042
+ /* "pywrapfst.pyx":3047
* 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, 3042, __pyx_L1_error)
+ __PYX_ERR(0, 3047, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Position();
goto __pyx_L0;
- /* "pywrapfst.pyx":3033
+ /* "pywrapfst.pyx":3038
* 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, 3033, __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, 3038, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3044
+/* "pywrapfst.pyx":3049
* 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, 3044, __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, 3049, __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, 3044, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3049, __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, 3044, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3049, __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":3050
+ /* "pywrapfst.pyx":3055
* Resets the iterator to the initial position.
* """
* self._aiter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
- __PYX_ERR(0, 3050, __pyx_L1_error)
+ __PYX_ERR(0, 3055, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Reset();
- /* "pywrapfst.pyx":3044
+ /* "pywrapfst.pyx":3049
* 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, 3044, __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, 3049, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3052
+/* "pywrapfst.pyx":3057
* 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, 3052, __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, 3057, __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, 3052, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3057, __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, 3052, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3057, __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, 3052, __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, 3057, __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, 3052, __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, 3057, __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, 3052, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3057, __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, 3052, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3057, __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":3061
+ /* "pywrapfst.pyx":3066
* 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, 3061, __pyx_L1_error)
+ __PYX_ERR(0, 3066, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Seek(__pyx_v_a);
- /* "pywrapfst.pyx":3052
+ /* "pywrapfst.pyx":3057
* 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, 3052, __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, 3057, __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, 3052, __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, 3057, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3063
+/* "pywrapfst.pyx":3068
* 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, 3063, __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, 3068, __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, 3063, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3068, __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, 3063, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3068, __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, 3063, __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, 3068, __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, 3063, __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, 3068, __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, 3063, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3068, __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, 3063, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3068, __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":3073
+ /* "pywrapfst.pyx":3078
* 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, 3073, __pyx_L1_error)
+ __PYX_ERR(0, 3078, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);
- /* "pywrapfst.pyx":3063
+ /* "pywrapfst.pyx":3068
* 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, 3063, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3068, __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, 3063, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3068, __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, 3063, __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, 3063, __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, 3068, __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, 3068, __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, 3063, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3068, __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, 3063, __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, 3068, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3075
+/* "pywrapfst.pyx":3080
* 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, 3075, __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, 3080, __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, 3075, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3080, __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, 3075, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3080, __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":3081
+ /* "pywrapfst.pyx":3086
* Returns the current arc.
* """
* return _init_Arc(self._aiter.get().Value()) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
- __PYX_ERR(0, 3081, __pyx_L1_error)
+ __PYX_ERR(0, 3086, __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, 3081, __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, 3086, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3075
+ /* "pywrapfst.pyx":3080
* 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, 3075, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_11ArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3080, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3093
+/* "pywrapfst.pyx":3098
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3094
+ /* "pywrapfst.pyx":3099
*
* 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, 3094, __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, 3099, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3094, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3099, __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, 3094, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3099, __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, 3094, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3099, __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, 3094, __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, 3099, __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, 3094, __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, 3099, __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, 3094, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3099, __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, 3094, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3099, __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":3093
+ /* "pywrapfst.pyx":3098
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3096
+/* "pywrapfst.pyx":3101
* 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, 3096, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3101, __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, 3096, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3101, __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, 3096, __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, 3101, __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, 3096, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3101, __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, 3096, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__MutableFst, 1, "ifst", 0))) __PYX_ERR(0, 3101, __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":3097
+ /* "pywrapfst.pyx":3102
*
* 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, 3097, __pyx_L1_error)
+ __PYX_ERR(0, 3102, __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":3098
+ /* "pywrapfst.pyx":3103
* 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, 3098, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3098, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3103, __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, 3098, __pyx_L1_error)
+ __PYX_ERR(0, 3103, __pyx_L1_error)
- /* "pywrapfst.pyx":3097
+ /* "pywrapfst.pyx":3102
*
* def __init__(self, _MutableFst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3100
+ /* "pywrapfst.pyx":3105
* 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, 3100, __pyx_L1_error)
+ __PYX_ERR(0, 3105, __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, 3100, __pyx_L1_error)
+ __PYX_ERR(0, 3105, __pyx_L1_error)
}
__pyx_v_self->_mfst = __pyx_t_4;
- /* "pywrapfst.pyx":3101
+ /* "pywrapfst.pyx":3106
* # 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, 3101, __pyx_L1_error)
+ __PYX_ERR(0, 3106, __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, 3101, __pyx_L1_error)
+ __PYX_ERR(0, 3106, __pyx_L1_error)
}
__pyx_v_self->_aiter.reset(new fst::script::MutableArcIteratorClass(__pyx_v_ifst->_mfst.get(), __pyx_v_state));
- /* "pywrapfst.pyx":3096
+ /* "pywrapfst.pyx":3101
* return "<MutableArcIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _MutableFst ifst, int64 state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3103
+/* "pywrapfst.pyx":3108
* self._aiter.reset(new fst.MutableArcIteratorClass(ifst._mfst.get(), state))
*
* 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, 3103, __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, 3108, __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_5done)) {
__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, 3103, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3108, __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, 3103, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3108, __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, 3103, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3108, __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":3112
+ /* "pywrapfst.pyx":3117
* 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, 3112, __pyx_L1_error)
+ __PYX_ERR(0, 3117, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3103
+ /* "pywrapfst.pyx":3108
* self._aiter.reset(new fst.MutableArcIteratorClass(ifst._mfst.get(), state))
*
* 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, 3103, __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, 3108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3114
+/* "pywrapfst.pyx":3119
* 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, 3114, __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, 3119, __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_7flags)) {
__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, 3114, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3119, __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, 3114, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3119, __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, 3114, __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, 3119, __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":3123
+ /* "pywrapfst.pyx":3128
* 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, 3123, __pyx_L1_error)
+ __PYX_ERR(0, 3128, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":3114
+ /* "pywrapfst.pyx":3119
* 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, 3114, __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, 3119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3125
+/* "pywrapfst.pyx":3130
* 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, 3125, __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, 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_9next)) {
__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, 3125, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3130, __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, 3125, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3130, __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":3131
+ /* "pywrapfst.pyx":3136
* Advances the iterator.
* """
* 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, 3131, __pyx_L1_error)
+ __PYX_ERR(0, 3136, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Next();
- /* "pywrapfst.pyx":3125
+ /* "pywrapfst.pyx":3130
* 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, 3125, __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, 3130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3133
+/* "pywrapfst.pyx":3138
* 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, 3133, __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, 3138, __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_11position)) {
__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, 3133, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3138, __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, 3133, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3138, __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, 3133, __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, 3138, __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":3142
+ /* "pywrapfst.pyx":3147
* 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, 3142, __pyx_L1_error)
+ __PYX_ERR(0, 3147, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Position();
goto __pyx_L0;
- /* "pywrapfst.pyx":3133
+ /* "pywrapfst.pyx":3138
* 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, 3133, __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, 3138, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3144
+/* "pywrapfst.pyx":3149
* 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, 3144, __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, 3149, __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_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, 3144, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3149, __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, 3144, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3149, __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":3150
+ /* "pywrapfst.pyx":3155
* Resets the iterator to the initial position.
* """
* self._aiter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
- __PYX_ERR(0, 3150, __pyx_L1_error)
+ __PYX_ERR(0, 3155, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Reset();
- /* "pywrapfst.pyx":3144
+ /* "pywrapfst.pyx":3149
* 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, 3144, __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, 3149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3152
+/* "pywrapfst.pyx":3157
* 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, 3152, __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, 3157, __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_15seek)) {
- __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3152, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3157, __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, 3152, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3157, __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, 3152, __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, 3157, __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, 3152, __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, 3157, __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, 3152, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3157, __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, 3152, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3157, __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":3161
+ /* "pywrapfst.pyx":3166
* 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, 3161, __pyx_L1_error)
+ __PYX_ERR(0, 3166, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Seek(__pyx_v_a);
- /* "pywrapfst.pyx":3152
+ /* "pywrapfst.pyx":3157
* 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, 3152, __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, 3157, __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, 3152, __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, 3157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3163
+/* "pywrapfst.pyx":3168
* 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, 3163, __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, 3168, __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_17set_flags)) {
- __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3163, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3168, __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, 3163, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3168, __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, 3163, __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, 3168, __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, 3163, __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, 3168, __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, 3163, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3168, __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, 3163, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3168, __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":3173
+ /* "pywrapfst.pyx":3178
* 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, 3173, __pyx_L1_error)
+ __PYX_ERR(0, 3178, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);
- /* "pywrapfst.pyx":3163
+ /* "pywrapfst.pyx":3168
* 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, 3163, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3168, __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, 3163, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3168, __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, 3163, __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, 3163, __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, 3168, __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, 3168, __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, 3163, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3168, __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, 3163, __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, 3168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3175
+/* "pywrapfst.pyx":3180
* 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, 3175, __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, 3180, __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_19set_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, 3175, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_arc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3180, __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, 3175, __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, 3180, __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, 3175, __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, 3180, __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, 3175, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3180, __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, 3175, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3180, __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":3184
+ /* "pywrapfst.pyx":3189
* 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, 3184, __pyx_L1_error)
+ __PYX_ERR(0, 3189, __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, 3184, __pyx_L1_error)
+ __PYX_ERR(0, 3189, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetValue((*__pyx_v_arc->_arc));
- /* "pywrapfst.pyx":3175
+ /* "pywrapfst.pyx":3180
* 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, 3175, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 3180, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_18set_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, 3175, __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, 3180, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3186
+/* "pywrapfst.pyx":3191
* 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, 3186, __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, 3191, __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_21value)) {
__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, 3186, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3191, __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, 3186, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3191, __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":3192
+ /* "pywrapfst.pyx":3197
* Returns the current arc.
* """
* return _init_Arc(self._aiter.get().Value()) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
- __PYX_ERR(0, 3192, __pyx_L1_error)
+ __PYX_ERR(0, 3197, __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, 3192, __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, 3197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3186
+ /* "pywrapfst.pyx":3191
* 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, 3186, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_18MutableArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3206
+/* "pywrapfst.pyx":3211
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3207
+ /* "pywrapfst.pyx":3212
*
* 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, 3207, __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, 3212, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3207, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3212, __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, 3207, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3212, __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, 3207, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3212, __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, 3207, __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, 3212, __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, 3207, __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, 3212, __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, 3207, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3212, __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, 3207, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3212, __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":3206
+ /* "pywrapfst.pyx":3211
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3209
+/* "pywrapfst.pyx":3214
* 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, 3209, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3214, __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, 3209, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3214, __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, 3209, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3214, __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":3211
+ /* "pywrapfst.pyx":3216
* 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, 3211, __pyx_L1_error)
+ __PYX_ERR(0, 3216, __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, 3211, __pyx_L1_error)
+ __PYX_ERR(0, 3216, __pyx_L1_error)
}
__pyx_v_self->_fst = __pyx_t_1;
- /* "pywrapfst.pyx":3212
+ /* "pywrapfst.pyx":3217
* # 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, 3212, __pyx_L1_error)
+ __PYX_ERR(0, 3217, __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, 3212, __pyx_L1_error)
+ __PYX_ERR(0, 3217, __pyx_L1_error)
}
__pyx_v_self->_siter.reset(new fst::script::StateIteratorClass((*__pyx_v_self->_fst)));
- /* "pywrapfst.pyx":3209
+ /* "pywrapfst.pyx":3214
* return "<StateIterator at 0x{:x}>".format(id(self))
*
* def __init__(self, _Fst ifst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3215
+/* "pywrapfst.pyx":3220
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":3216
+ /* "pywrapfst.pyx":3221
* # 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":3215
+ /* "pywrapfst.pyx":3220
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3219
+/* "pywrapfst.pyx":3224
*
* # 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":3220
+ /* "pywrapfst.pyx":3225
* # 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, 3220, __pyx_L1_error)
+ __PYX_ERR(0, 3225, __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":3221
+ /* "pywrapfst.pyx":3226
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* self.next()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 3221, __pyx_L1_error)
+ __PYX_ERR(0, 3226, __pyx_L1_error)
- /* "pywrapfst.pyx":3220
+ /* "pywrapfst.pyx":3225
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3222
+ /* "pywrapfst.pyx":3227
* 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, 3222, __pyx_L1_error)
+ __PYX_ERR(0, 3227, __pyx_L1_error)
}
__pyx_v_result = ((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3223
+ /* "pywrapfst.pyx":3228
* 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, 3223, __pyx_L1_error)
+ __PYX_ERR(0, 3228, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3224
+ /* "pywrapfst.pyx":3229
* 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, 3224, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3219
+ /* "pywrapfst.pyx":3224
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3226
+/* "pywrapfst.pyx":3231
* 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, 3226, __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, 3231, __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, 3226, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3231, __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, 3226, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3231, __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, 3226, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3231, __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":3235
+ /* "pywrapfst.pyx":3240
* 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, 3235, __pyx_L1_error)
+ __PYX_ERR(0, 3240, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3226
+ /* "pywrapfst.pyx":3231
* 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, 3226, __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, 3231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3237
+/* "pywrapfst.pyx":3242
* 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, 3237, __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, 3242, __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, 3237, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3242, __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, 3237, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3242, __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":3243
+ /* "pywrapfst.pyx":3248
* Advances the iterator.
* """
* 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, 3243, __pyx_L1_error)
+ __PYX_ERR(0, 3248, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Next();
- /* "pywrapfst.pyx":3237
+ /* "pywrapfst.pyx":3242
* 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, 3237, __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, 3242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3245
+/* "pywrapfst.pyx":3250
* 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, 3245, __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, 3250, __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, 3245, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3250, __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, 3245, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3250, __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":3251
+ /* "pywrapfst.pyx":3256
* Resets the iterator to the initial position.
* """
* self._siter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
- __PYX_ERR(0, 3251, __pyx_L1_error)
+ __PYX_ERR(0, 3256, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Reset();
- /* "pywrapfst.pyx":3245
+ /* "pywrapfst.pyx":3250
* 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, 3245, __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, 3250, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3253
+/* "pywrapfst.pyx":3258
* 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, 3253, __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, 3258, __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, 3253, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3258, __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, 3253, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3258, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3253, __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, 3258, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "pywrapfst.pyx":3259
+ /* "pywrapfst.pyx":3264
* Returns the current state index.
* """
* return self._siter.get().Value() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
- __PYX_ERR(0, 3259, __pyx_L1_error)
+ __PYX_ERR(0, 3264, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Value();
goto __pyx_L0;
- /* "pywrapfst.pyx":3253
+ /* "pywrapfst.pyx":3258
* 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, 3253, __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, 3258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3265
+/* "pywrapfst.pyx":3270
*
*
* cdef _Fst _map(_Fst ifst, # <<<<<<<<<<<<<<
*/
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__38;
+ float __pyx_v_delta = __pyx_k__39;
PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_b_identity);
- /* "pywrapfst.pyx":3268
+ /* "pywrapfst.pyx":3273
* float delta=fst.kDelta,
* map_type=b"identity",
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3270
+ /* "pywrapfst.pyx":3275
* weight=None):
* cdef fst.MapType map_type_enum
* if not fst.GetMapType(tostring(map_type), addr(map_type_enum)): # <<<<<<<<<<<<<<
* raise FstArgError("Unknown map type: {!r}".format(map_type))
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_map_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3270, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_map_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3275, __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":3271
+ /* "pywrapfst.pyx":3276
* cdef fst.MapType map_type_enum
* if not fst.GetMapType(tostring(map_type), addr(map_type_enum)):
* raise FstArgError("Unknown map type: {!r}".format(map_type)) # <<<<<<<<<<<<<<
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
* weight) if map_type_enum == fst.TIMES_MAPPER else
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3271, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3276, __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, 3271, __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, 3276, __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_map_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3271, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_map_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3276, __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_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, 3271, __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, 3276, __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_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, 3271, __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, 3276, __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, 3271, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3276, __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_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, 3271, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3276, __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, 3271, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3276, __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, 3271, __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, 3276, __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, 3271, __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, 3276, __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, 3271, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3276, __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, 3271, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3276, __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, 3271, __pyx_L1_error)
+ __PYX_ERR(0, 3276, __pyx_L1_error)
- /* "pywrapfst.pyx":3270
+ /* "pywrapfst.pyx":3275
* weight=None):
* cdef fst.MapType map_type_enum
* if not fst.GetMapType(tostring(map_type), addr(map_type_enum)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3273
+ /* "pywrapfst.pyx":3278
* raise FstArgError("Unknown map type: {!r}".format(map_type))
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
* weight) if map_type_enum == fst.TIMES_MAPPER else # <<<<<<<<<<<<<<
*/
if (((__pyx_v_map_type_enum == fst::script::TIMES_MAPPER) != 0)) {
- /* "pywrapfst.pyx":3272
+ /* "pywrapfst.pyx":3277
* if not fst.GetMapType(tostring(map_type), addr(map_type_enum)):
* raise FstArgError("Unknown map type: {!r}".format(map_type))
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 3272, __pyx_L1_error)
+ __PYX_ERR(0, 3277, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3273
+ /* "pywrapfst.pyx":3278
* raise FstArgError("Unknown map type: {!r}".format(map_type))
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
* weight) if map_type_enum == fst.TIMES_MAPPER else # <<<<<<<<<<<<<<
* _get_WeightClass_or_Zero(ifst.weight_type(), weight))
* return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, 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, 3272, __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, 3277, __pyx_L1_error)
__pyx_t_9 = __pyx_t_10;
} else {
- /* "pywrapfst.pyx":3274
+ /* "pywrapfst.pyx":3279
* cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
* weight) if map_type_enum == fst.TIMES_MAPPER else
* _get_WeightClass_or_Zero(ifst.weight_type(), weight)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 3274, __pyx_L1_error)
+ __PYX_ERR(0, 3279, __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, 3274, __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, 3279, __pyx_L1_error)
__pyx_t_9 = __pyx_t_10;
}
__pyx_v_wc = __pyx_t_9;
- /* "pywrapfst.pyx":3275
+ /* "pywrapfst.pyx":3280
* weight) if map_type_enum == fst.TIMES_MAPPER else
* _get_WeightClass_or_Zero(ifst.weight_type(), weight))
* return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, 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, 3275, __pyx_L1_error)
+ __PYX_ERR(0, 3280, __pyx_L1_error)
}
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(fst::script::Map((*__pyx_v_ifst->_fst), __pyx_v_map_type_enum, __pyx_v_delta, __pyx_v_wc))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3275, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(fst::script::Map((*__pyx_v_ifst->_fst), __pyx_v_map_type_enum, __pyx_v_delta, __pyx_v_wc))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3280, __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":3265
+ /* "pywrapfst.pyx":3270
*
*
* cdef _Fst _map(_Fst ifst, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3278
+/* "pywrapfst.pyx":3283
*
*
* cpdef _Fst arcmap(_Fst ifst, # <<<<<<<<<<<<<<
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__39;
+ float __pyx_v_delta = __pyx_k__40;
PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_b_identity);
- /* "pywrapfst.pyx":3281
+ /* "pywrapfst.pyx":3286
* float delta=fst.kDelta,
* map_type=b"identity",
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3320
+ /* "pywrapfst.pyx":3325
* See also: `statemap`.
* """
* return _map(ifst, delta, map_type, weight) # <<<<<<<<<<<<<<
__pyx_t_2.delta = __pyx_v_delta;
__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, 3320, __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, 3325, __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":3278
+ /* "pywrapfst.pyx":3283
*
*
* cpdef _Fst arcmap(_Fst ifst, # <<<<<<<<<<<<<<
/* 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, 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 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; ignored unless\n `map_type` 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 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* values[4] = {0,0,0,0};
values[2] = ((PyObject *)__pyx_n_b_identity);
- /* "pywrapfst.pyx":3281
+ /* "pywrapfst.pyx":3286
* float delta=fst.kDelta,
* map_type=b"identity",
* weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcmap") < 0)) __PYX_ERR(0, 3278, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcmap") < 0)) __PYX_ERR(0, 3283, __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, 3279, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3284, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__39;
+ __pyx_v_delta = __pyx_k__40;
}
__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, 3278, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3283, __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, 3278, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3283, __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":3278
+ /* "pywrapfst.pyx":3283
*
*
* cpdef _Fst arcmap(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_2.delta = __pyx_v_delta;
__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, 3278, __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, 3283, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3323
+/* "pywrapfst.pyx":3328
*
*
* cpdef _MutableFst compose(_Fst ifst1, # <<<<<<<<<<<<<<
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_compose(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_compose *__pyx_optional_args) {
PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3326
+ /* "pywrapfst.pyx":3331
* _Fst ifst2,
* compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
*/
bool __pyx_v_connect = ((bool)1);
std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- std::unique_ptr<fst::script::ComposeOptions> __pyx_v_opts;
+ std::unique_ptr<fst::ComposeOptions> __pyx_v_opts;
struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
}
}
- /* "pywrapfst.pyx":3351
+ /* "pywrapfst.pyx":3356
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3351, __pyx_L1_error)
+ __PYX_ERR(0, 3356, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0)));
- /* "pywrapfst.pyx":3354
+ /* "pywrapfst.pyx":3359
* cdef unique_ptr[fst.ComposeOptions] opts
* opts.reset(new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter)))) # <<<<<<<<<<<<<<
* fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release())
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3354, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3354, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3359, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3359, __pyx_L1_error)
- /* "pywrapfst.pyx":3353
+ /* "pywrapfst.pyx":3358
* tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
* cdef unique_ptr[fst.ComposeOptions] opts
* opts.reset(new fst.ComposeOptions(connect, # <<<<<<<<<<<<<<
* _get_compose_filter(tostring(compose_filter))))
* fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
*/
- __pyx_v_opts.reset(new fst::script::ComposeOptions(__pyx_v_connect, __pyx_t_2));
+ __pyx_v_opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
- /* "pywrapfst.pyx":3355
+ /* "pywrapfst.pyx":3360
* opts.reset(new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter))))
* fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3355, __pyx_L1_error)
+ __PYX_ERR(0, 3360, __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, 3355, __pyx_L1_error)
+ __PYX_ERR(0, 3360, __pyx_L1_error)
}
fst::script::Compose((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3356
+ /* "pywrapfst.pyx":3361
* _get_compose_filter(tostring(compose_filter))))
* fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3356, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3361, __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":3323
+ /* "pywrapfst.pyx":3328
*
*
* cpdef _MutableFst compose(_Fst ifst1, # <<<<<<<<<<<<<<
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, 3323, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, 1); __PYX_ERR(0, 3328, __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, "compose") < 0)) __PYX_ERR(0, 3323, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(0, 3328, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
__pyx_v_compose_filter = values[2];
if (values[3]) {
- __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3326, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3331, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3326
+ /* "pywrapfst.pyx":3331
* _Fst ifst2,
* compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3323, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3328, __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, 3323, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3324, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3328, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3329, __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":3323
+ /* "pywrapfst.pyx":3328
*
*
* cpdef _MutableFst compose(_Fst ifst1, # <<<<<<<<<<<<<<
__pyx_t_2.__pyx_n = 2;
__pyx_t_2.compose_filter = __pyx_v_compose_filter;
__pyx_t_2.connect = __pyx_v_connect;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_compose(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3323, __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, 3328, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3359
+/* "pywrapfst.pyx":3364
*
*
* cpdef _Fst convert(_Fst ifst, fst_type=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3376
+ /* "pywrapfst.pyx":3381
* FstOpError: Conversion failed.
* """
- * cdef string fst_type_string = "" if fst_type is None else tostring(fst_type) # <<<<<<<<<<<<<<
+ * cdef string fst_type_string = b"" if fst_type is None else tostring(fst_type) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))
*/
__pyx_t_2 = (__pyx_v_fst_type == Py_None);
if ((__pyx_t_2 != 0)) {
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b__5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3376, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b__6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3381, __pyx_L1_error)
__pyx_t_1 = __pyx_t_3;
} else {
- __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3376, __pyx_L1_error)
- __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3376, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3381, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3376, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3381, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_1 = __pyx_t_3;
}
__pyx_v_fst_type_string = __pyx_t_1;
- /* "pywrapfst.pyx":3378
- * cdef string fst_type_string = "" if fst_type is None else tostring(fst_type)
+ /* "pywrapfst.pyx":3383
+ * cdef string fst_type_string = b"" if fst_type is None else tostring(fst_type)
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string)) # <<<<<<<<<<<<<<
* # Script-land Convert returns the null pointer to signal failure.
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3378, __pyx_L1_error)
+ __PYX_ERR(0, 3383, __pyx_L1_error)
}
__pyx_v_tfst.reset(fst::script::Convert((*__pyx_v_ifst->_fst), __pyx_v_fst_type_string));
- /* "pywrapfst.pyx":3380
+ /* "pywrapfst.pyx":3385
* tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))
* # Script-land Convert returns the null pointer to signal failure.
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v_tfst.get() == NULL) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":3381
+ /* "pywrapfst.pyx":3386
* # Script-land Convert returns the null pointer to signal failure.
* if tfst.get() == NULL:
* raise FstOpError("Conversion to {!r} failed".format(fst_type)) # <<<<<<<<<<<<<<
* return _init_XFst(tfst.release())
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3381, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed_2, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3381, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed_2, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3386, __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, 3381, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_fst_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3386, __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, 3381, __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, 3386, __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, 3381, __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, 3386, __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, 3381, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3386, __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, 3381, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3386, __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, 3381, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3386, __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, 3381, __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, 3386, __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, 3381, __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, 3386, __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, 3381, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3386, __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, 3381, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3386, __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, 3381, __pyx_L1_error)
+ __PYX_ERR(0, 3386, __pyx_L1_error)
- /* "pywrapfst.pyx":3380
+ /* "pywrapfst.pyx":3385
* tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))
* # Script-land Convert returns the null pointer to signal failure.
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3382
+ /* "pywrapfst.pyx":3387
* if tfst.get() == NULL:
* raise FstOpError("Conversion to {!r} failed".format(fst_type))
* return _init_XFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3382, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3387, __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":3359
+ /* "pywrapfst.pyx":3364
*
*
* cpdef _Fst convert(_Fst ifst, fst_type=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 3359, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 3364, __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, 3359, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("convert", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3364, __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, 3359, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3364, __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, 3359, __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, 3364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3385
+/* "pywrapfst.pyx":3390
*
*
* cpdef _MutableFst determinize(_Fst ifst, # <<<<<<<<<<<<<<
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__40;
+ float __pyx_v_delta = __pyx_k__41;
PyObject *__pyx_v_det_type = ((PyObject *)__pyx_n_b_functional);
- __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__41;
+ __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__42;
__pyx_t_10basictypes_int64 __pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);
- /* "pywrapfst.pyx":3390
+ /* "pywrapfst.pyx":3395
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None, # <<<<<<<<<<<<<<
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- /* "pywrapfst.pyx":3391
+ /* "pywrapfst.pyx":3396
* int64 subsequential_label=0,
* weight=None,
* bool increment_subsequential_label=False): # <<<<<<<<<<<<<<
* """
- * determinize(ifst, delta=0.0009765625, det_type="functional", nstate=-1,
+ * determinize(ifst, delta=0.0009765625, det_type="functional",
*/
bool __pyx_v_increment_subsequential_label = ((bool)0);
std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
}
}
- /* "pywrapfst.pyx":3427
+ /* "pywrapfst.pyx":3432
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3427, __pyx_L1_error)
+ __PYX_ERR(0, 3432, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3429
+ /* "pywrapfst.pyx":3434
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* # Threshold is set to semiring Zero (no pruning) if weight unspecified.
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 3429, __pyx_L1_error)
+ __PYX_ERR(0, 3434, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3430
+ /* "pywrapfst.pyx":3435
* # Threshold is set to semiring Zero (no pruning) if weight unspecified.
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(),
* weight) # <<<<<<<<<<<<<<
* cdef fst.DeterminizeType determinize_type_enum
* if not fst.GetDeterminizeType(tostring(det_type),
*/
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3429, __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, 3434, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":3432
+ /* "pywrapfst.pyx":3437
* weight)
* cdef fst.DeterminizeType determinize_type_enum
* if not fst.GetDeterminizeType(tostring(det_type), # <<<<<<<<<<<<<<
* addr(determinize_type_enum)):
* raise FstArgError("Unknown determinization type: {!r}".format(det_type))
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_det_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3432, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_det_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3437, __pyx_L1_error)
- /* "pywrapfst.pyx":3433
+ /* "pywrapfst.pyx":3438
* cdef fst.DeterminizeType determinize_type_enum
* if not fst.GetDeterminizeType(tostring(det_type),
* addr(determinize_type_enum)): # <<<<<<<<<<<<<<
*/
__pyx_t_3 = ((!(fst::script::GetDeterminizeType(__pyx_t_2, (&__pyx_v_determinize_type_enum)) != 0)) != 0);
- /* "pywrapfst.pyx":3432
+ /* "pywrapfst.pyx":3437
* weight)
* cdef fst.DeterminizeType determinize_type_enum
* if not fst.GetDeterminizeType(tostring(det_type), # <<<<<<<<<<<<<<
*/
if (__pyx_t_3) {
- /* "pywrapfst.pyx":3434
+ /* "pywrapfst.pyx":3439
* 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, 3434, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3439, __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, 3434, __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, 3439, __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_det_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3434, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_det_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3439, __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_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, 3434, __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, 3439, __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_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, 3434, __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, 3439, __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, 3434, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3439, __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_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, 3434, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3439, __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, 3434, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3439, __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, 3434, __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, 3439, __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, 3434, __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, 3439, __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, 3434, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3439, __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, 3434, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3439, __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, 3434, __pyx_L1_error)
+ __PYX_ERR(0, 3439, __pyx_L1_error)
- /* "pywrapfst.pyx":3432
+ /* "pywrapfst.pyx":3437
* weight)
* cdef fst.DeterminizeType determinize_type_enum
* if not fst.GetDeterminizeType(tostring(det_type), # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3436
+ /* "pywrapfst.pyx":3441
* raise FstArgError("Unknown determinization type: {!r}".format(det_type))
* cdef unique_ptr[fst.DeterminizeOptions] opts
* opts.reset(new fst.DeterminizeOptions(delta, wc, nstate, subsequential_label, # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::script::DeterminizeOptions(__pyx_v_delta, __pyx_v_wc, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_determinize_type_enum, __pyx_v_increment_subsequential_label));
- /* "pywrapfst.pyx":3439
+ /* "pywrapfst.pyx":3444
* determinize_type_enum,
* increment_subsequential_label))
* fst.Determinize(deref(ifst._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3439, __pyx_L1_error)
+ __PYX_ERR(0, 3444, __pyx_L1_error)
}
fst::script::Determinize((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3440
+ /* "pywrapfst.pyx":3445
* increment_subsequential_label))
* fst.Determinize(deref(ifst._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3440, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3445, __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":3385
+ /* "pywrapfst.pyx":3390
*
*
* cpdef _MutableFst determinize(_Fst ifst, # <<<<<<<<<<<<<<
/* 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, 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 char __pyx_doc_9pywrapfst_18determinize[] = "\n determinize(ifst, delta=0.0009765625, det_type=\"functional\",\n nstate=NO_STATE_ID, 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* values[7] = {0,0,0,0,0,0,0};
values[2] = ((PyObject *)__pyx_n_b_functional);
- /* "pywrapfst.pyx":3390
+ /* "pywrapfst.pyx":3395
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "determinize") < 0)) __PYX_ERR(0, 3385, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "determinize") < 0)) __PYX_ERR(0, 3390, __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, 3386, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3391, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__40;
+ __pyx_v_delta = __pyx_k__41;
}
__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, 3388, __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, 3393, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__41;
+ __pyx_v_nstate = __pyx_k__42;
}
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, 3389, __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, 3394, __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, 3391, __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, 3396, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3391
+ /* "pywrapfst.pyx":3396
* int64 subsequential_label=0,
* weight=None,
* bool increment_subsequential_label=False): # <<<<<<<<<<<<<<
* """
- * determinize(ifst, delta=0.0009765625, det_type="functional", nstate=-1,
+ * determinize(ifst, delta=0.0009765625, det_type="functional",
*/
__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, 3385, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3390, __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, 3385, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3390, __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":3385
+ /* "pywrapfst.pyx":3390
*
*
* cpdef _MutableFst determinize(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_2.subsequential_label = __pyx_v_subsequential_label;
__pyx_t_2.weight = __pyx_v_weight;
__pyx_t_2.increment_subsequential_label = __pyx_v_increment_subsequential_label;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_determinize(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3385, __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, 3390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3443
+/* "pywrapfst.pyx":3448
*
*
* cpdef _MutableFst difference(_Fst ifst1, # <<<<<<<<<<<<<<
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_difference(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_difference *__pyx_optional_args) {
PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3446
+ /* "pywrapfst.pyx":3451
* _Fst ifst2,
* compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
*/
bool __pyx_v_connect = ((bool)1);
std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- std::unique_ptr<fst::script::ComposeOptions> __pyx_v_opts;
+ std::unique_ptr<fst::ComposeOptions> __pyx_v_opts;
struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
}
}
- /* "pywrapfst.pyx":3470
+ /* "pywrapfst.pyx":3475
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3470, __pyx_L1_error)
+ __PYX_ERR(0, 3475, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0)));
- /* "pywrapfst.pyx":3473
+ /* "pywrapfst.pyx":3478
* cdef unique_ptr[fst.ComposeOptions] opts
* opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(
* tostring(compose_filter)))) # <<<<<<<<<<<<<<
* fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release())
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3473, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3478, __pyx_L1_error)
- /* "pywrapfst.pyx":3472
+ /* "pywrapfst.pyx":3477
* tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
* cdef unique_ptr[fst.ComposeOptions] opts
* opts.reset(new fst.ComposeOptions(connect, _get_compose_filter( # <<<<<<<<<<<<<<
* tostring(compose_filter))))
* fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
*/
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3472, __pyx_L1_error)
- __pyx_v_opts.reset(new fst::script::ComposeOptions(__pyx_v_connect, __pyx_t_2));
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3477, __pyx_L1_error)
+ __pyx_v_opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
- /* "pywrapfst.pyx":3474
+ /* "pywrapfst.pyx":3479
* opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(
* tostring(compose_filter))))
* fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3474, __pyx_L1_error)
+ __PYX_ERR(0, 3479, __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, 3474, __pyx_L1_error)
+ __PYX_ERR(0, 3479, __pyx_L1_error)
}
fst::script::Difference((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3475
+ /* "pywrapfst.pyx":3480
* tostring(compose_filter))))
* fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3475, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3480, __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":3443
+ /* "pywrapfst.pyx":3448
*
*
* cpdef _MutableFst difference(_Fst ifst1, # <<<<<<<<<<<<<<
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, 3443, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, 1); __PYX_ERR(0, 3448, __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, "difference") < 0)) __PYX_ERR(0, 3443, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(0, 3448, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
__pyx_v_compose_filter = values[2];
if (values[3]) {
- __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3446, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3451, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3446
+ /* "pywrapfst.pyx":3451
* _Fst ifst2,
* compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3443, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3448, __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, 3443, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3444, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3448, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3449, __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":3443
+ /* "pywrapfst.pyx":3448
*
*
* cpdef _MutableFst difference(_Fst ifst1, # <<<<<<<<<<<<<<
__pyx_t_2.__pyx_n = 2;
__pyx_t_2.compose_filter = __pyx_v_compose_filter;
__pyx_t_2.connect = __pyx_v_connect;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_difference(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3443, __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, 3448, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3478
+/* "pywrapfst.pyx":3483
*
*
* cpdef _MutableFst disambiguate(_Fst ifst, # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_23disambiguate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_disambiguate(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_disambiguate *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__42;
- __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__43;
+ float __pyx_v_delta = __pyx_k__43;
+ __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__44;
__pyx_t_10basictypes_int64 __pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);
- /* "pywrapfst.pyx":3482
+ /* "pywrapfst.pyx":3487
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None): # <<<<<<<<<<<<<<
* """
- * disambiguate(ifst, delta=0.0009765625, nstate=-1, subsequential_label=0,
+ * disambiguate(ifst, delta=0.0009765625, nstate=NO_STATE_ID,
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
}
}
- /* "pywrapfst.pyx":3509
+ /* "pywrapfst.pyx":3514
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3509, __pyx_L1_error)
+ __PYX_ERR(0, 3514, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3511
+ /* "pywrapfst.pyx":3516
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 3511, __pyx_L1_error)
+ __PYX_ERR(0, 3516, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3512
+ /* "pywrapfst.pyx":3517
* # 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, 3511, __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, 3516, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":3514
+ /* "pywrapfst.pyx":3519
* 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":3516
+ /* "pywrapfst.pyx":3521
* opts.reset(new fst.DisambiguateOptions(delta, wc, nstate,
* subsequential_label))
* fst.Disambiguate(deref(ifst._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3516, __pyx_L1_error)
+ __PYX_ERR(0, 3521, __pyx_L1_error)
}
fst::script::Disambiguate((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3517
+ /* "pywrapfst.pyx":3522
* subsequential_label))
* fst.Disambiguate(deref(ifst._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3517, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3522, __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":3478
+ /* "pywrapfst.pyx":3483
*
*
* cpdef _MutableFst disambiguate(_Fst ifst, # <<<<<<<<<<<<<<
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_23disambiguate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_22disambiguate[] = "\n disambiguate(ifst, delta=0.0009765625, nstate=-1, subsequential_label=0,\n weight=None):\n\n Constructively disambiguates a weighted transducer.\n\n This operation disambiguates a weighted transducer. The result will be an\n equivalent FST that has the property that no two successful paths have the\n same input labeling. For this algorithm, epsilon transitions are treated as\n regular symbols (cf. `rmepsilon`).\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta.\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\n Returns:\n An equivalent disambiguated FST.\n\n See also: `determinize`, `rmepsilon`.\n ";
+static char __pyx_doc_9pywrapfst_22disambiguate[] = "\n disambiguate(ifst, delta=0.0009765625, nstate=NO_STATE_ID,\n subsequential_label=0, weight=None):\n\n Constructively disambiguates a weighted transducer.\n\n This operation disambiguates a weighted transducer. The result will be an\n equivalent FST that has the property that no two successful paths have the\n same input labeling. For this algorithm, epsilon transitions are treated as\n regular symbols (cf. `rmepsilon`).\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta.\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\n Returns:\n An equivalent disambiguated FST.\n\n See also: `determinize`, `rmepsilon`.\n ";
static PyObject *__pyx_pw_9pywrapfst_23disambiguate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
float __pyx_v_delta;
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":3482
+ /* "pywrapfst.pyx":3487
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None): # <<<<<<<<<<<<<<
* """
- * disambiguate(ifst, delta=0.0009765625, nstate=-1, subsequential_label=0,
+ * disambiguate(ifst, delta=0.0009765625, nstate=NO_STATE_ID,
*/
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "disambiguate") < 0)) __PYX_ERR(0, 3478, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "disambiguate") < 0)) __PYX_ERR(0, 3483, __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, 3479, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3484, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__42;
+ __pyx_v_delta = __pyx_k__43;
}
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, 3480, __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, 3485, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__43;
+ __pyx_v_nstate = __pyx_k__44;
}
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, 3481, __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, 3486, __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, 3478, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("disambiguate", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3483, __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, 3478, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3483, __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":3478
+ /* "pywrapfst.pyx":3483
*
*
* 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, 3478, __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, 3483, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3520
+/* "pywrapfst.pyx":3525
*
*
* cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3543
+ /* "pywrapfst.pyx":3548
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3543, __pyx_L1_error)
+ __PYX_ERR(0, 3548, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3544
+ /* "pywrapfst.pyx":3549
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.EpsNormalize(deref(ifst._fst), tfst.get(), fst.EPS_NORM_OUTPUT if # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3544, __pyx_L1_error)
+ __PYX_ERR(0, 3549, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3545
+ /* "pywrapfst.pyx":3550
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.EpsNormalize(deref(ifst._fst), tfst.get(), fst.EPS_NORM_OUTPUT if
* eps_norm_output else # <<<<<<<<<<<<<<
*/
if ((__pyx_v_eps_norm_output != 0)) {
- /* "pywrapfst.pyx":3544
+ /* "pywrapfst.pyx":3549
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.EpsNormalize(deref(ifst._fst), tfst.get(), fst.EPS_NORM_OUTPUT if # <<<<<<<<<<<<<<
__pyx_t_1 = fst::EPS_NORM_OUTPUT;
} else {
- /* "pywrapfst.pyx":3546
+ /* "pywrapfst.pyx":3551
* fst.EpsNormalize(deref(ifst._fst), tfst.get(), fst.EPS_NORM_OUTPUT if
* eps_norm_output else
* fst.EPS_NORM_INPUT) # <<<<<<<<<<<<<<
__pyx_t_1 = fst::EPS_NORM_INPUT;
}
- /* "pywrapfst.pyx":3544
+ /* "pywrapfst.pyx":3549
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.EpsNormalize(deref(ifst._fst), tfst.get(), fst.EPS_NORM_OUTPUT if # <<<<<<<<<<<<<<
*/
fst::script::EpsNormalize((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_t_1);
- /* "pywrapfst.pyx":3547
+ /* "pywrapfst.pyx":3552
* eps_norm_output else
* fst.EPS_NORM_INPUT)
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3547, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3552, __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":3520
+ /* "pywrapfst.pyx":3525
*
*
* 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, 3520, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "epsnormalize") < 0)) __PYX_ERR(0, 3525, __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, 3520, __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, 3525, __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, 3520, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("epsnormalize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3525, __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, 3520, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3525, __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, 3520, __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, 3525, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3550
+/* "pywrapfst.pyx":3555
*
*
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_27equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_9pywrapfst_equal(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_equal *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__44;
+ float __pyx_v_delta = __pyx_k__45;
bool __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("equal", 0);
}
}
- /* "pywrapfst.pyx":3570
+ /* "pywrapfst.pyx":3575
* 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, 3570, __pyx_L1_error)
+ __PYX_ERR(0, 3575, __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, 3570, __pyx_L1_error)
+ __PYX_ERR(0, 3575, __pyx_L1_error)
}
__pyx_r = fst::script::Equal((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3550
+ /* "pywrapfst.pyx":3555
*
*
* 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, 3550, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, 1); __PYX_ERR(0, 3555, __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, 3550, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(0, 3555, __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, 3550, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3555, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__44;
+ __pyx_v_delta = __pyx_k__45;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3550, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3555, __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, 3550, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3550, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3555, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3555, __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, 3550, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3573
+/* "pywrapfst.pyx":3578
*
*
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *: # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_29equivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_9pywrapfst_equivalent(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_equivalent *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__45;
- bool __pyx_v_error;
- bool __pyx_v_result;
+ float __pyx_v_delta = __pyx_k__46;
bool __pyx_r;
__Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("equivalent", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3597
+ /* "pywrapfst.pyx":3598
+ * See also: `equal`, `isomorphic`, `randequivalent`.
* """
- * cdef bool error
- * cdef bool result = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta, # <<<<<<<<<<<<<<
- * addr(error))
- * if error:
+ * return fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta) # <<<<<<<<<<<<<<
+ *
+ *
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3597, __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, 3597, __pyx_L1_error)
- }
-
- /* "pywrapfst.pyx":3598
- * cdef bool error
- * cdef bool result = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta,
- * addr(error)) # <<<<<<<<<<<<<<
- * if error:
- * raise FstOpError("Equivalence test encountered error")
- */
- __pyx_v_result = fst::script::Equivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta, (&__pyx_v_error));
-
- /* "pywrapfst.pyx":3599
- * cdef bool result = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta,
- * addr(error))
- * if error: # <<<<<<<<<<<<<<
- * raise FstOpError("Equivalence test encountered error")
- * return result
- */
- __pyx_t_1 = (__pyx_v_error != 0);
- if (__pyx_t_1) {
-
- /* "pywrapfst.pyx":3600
- * 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, 3600, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3600, __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, 3600, __pyx_L1_error)
-
- /* "pywrapfst.pyx":3599
- * cdef bool result = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta,
- * addr(error))
- * if error: # <<<<<<<<<<<<<<
- * raise FstOpError("Equivalence test encountered error")
- * return result
- */
+ __PYX_ERR(0, 3598, __pyx_L1_error)
}
-
- /* "pywrapfst.pyx":3601
- * if error:
- * raise FstOpError("Equivalence test encountered error")
- * return result # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = __pyx_v_result;
+ __pyx_r = fst::script::Equivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3573
+ /* "pywrapfst.pyx":3578
*
*
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *: # <<<<<<<<<<<<<<
/* function exit code */
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("pywrapfst.equivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_29equivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_28equivalent[] = "\n equivalent(ifst1, ifst2, delta=0.0009765625)\n\n Are the two acceptors equivalent?\n\n This operation tests whether two epsilon-free deterministic weighted\n acceptors are equivalent, that is if they accept the same strings with the\n same weights.\n\n Args:\n ifst1: The first input FST.\n ifst2: The second input FST.\n delta: Comparison/quantization delta.\n\n Returns:\n True if the FSTs satisfy the above condition, else False.\n\n Raises:\n FstOpError: Equivalence test encountered error.\n\n See also: `equal`, `isomorphic`, `randequivalent`.\n ";
+static char __pyx_doc_9pywrapfst_28equivalent[] = "\n equivalent(ifst1, ifst2, delta=0.0009765625)\n\n Are the two acceptors equivalent?\n\n This operation tests whether two epsilon-free deterministic weighted\n acceptors are equivalent, that is if they accept the same strings with the\n same weights.\n\n Args:\n ifst1: The first input FST.\n ifst2: The second input FST.\n delta: Comparison/quantization delta.\n\n Returns:\n True if the FSTs satisfy the above condition, else False.\n\n See also: `equal`, `isomorphic`, `randequivalent`.\n ";
static PyObject *__pyx_pw_9pywrapfst_29equivalent(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;
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, 3573, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, 1); __PYX_ERR(0, 3578, __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, 3573, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equivalent") < 0)) __PYX_ERR(0, 3578, __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, 3573, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3578, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__45;
+ __pyx_v_delta = __pyx_k__46;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3573, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3578, __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, 3573, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3573, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3578, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3578, __pyx_L1_error)
__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, 3573, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3573, __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, 3578, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3604
+/* "pywrapfst.pyx":3601
*
*
* cpdef _MutableFst intersect(_Fst ifst1, # <<<<<<<<<<<<<<
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_intersect(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_intersect *__pyx_optional_args) {
PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3607
+ /* "pywrapfst.pyx":3604
* _Fst ifst2,
* compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
*/
bool __pyx_v_connect = ((bool)1);
std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- std::unique_ptr<fst::script::ComposeOptions> __pyx_v_opts;
+ std::unique_ptr<fst::ComposeOptions> __pyx_v_opts;
struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
}
}
- /* "pywrapfst.pyx":3629
+ /* "pywrapfst.pyx":3626
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3629, __pyx_L1_error)
+ __PYX_ERR(0, 3626, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0)));
- /* "pywrapfst.pyx":3632
+ /* "pywrapfst.pyx":3629
* cdef unique_ptr[fst.ComposeOptions] opts
* opts.reset(new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter)))) # <<<<<<<<<<<<<<
* fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release())
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3632, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3632, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3629, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3629, __pyx_L1_error)
- /* "pywrapfst.pyx":3631
+ /* "pywrapfst.pyx":3628
* tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
* cdef unique_ptr[fst.ComposeOptions] opts
* opts.reset(new fst.ComposeOptions(connect, # <<<<<<<<<<<<<<
* _get_compose_filter(tostring(compose_filter))))
* fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
*/
- __pyx_v_opts.reset(new fst::script::ComposeOptions(__pyx_v_connect, __pyx_t_2));
+ __pyx_v_opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
- /* "pywrapfst.pyx":3633
+ /* "pywrapfst.pyx":3630
* opts.reset(new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter))))
* fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3633, __pyx_L1_error)
+ __PYX_ERR(0, 3630, __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, 3633, __pyx_L1_error)
+ __PYX_ERR(0, 3630, __pyx_L1_error)
}
fst::script::Intersect((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3634
+ /* "pywrapfst.pyx":3631
* _get_compose_filter(tostring(compose_filter))))
* fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3634, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3631, __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":3604
+ /* "pywrapfst.pyx":3601
*
*
* cpdef _MutableFst intersect(_Fst ifst1, # <<<<<<<<<<<<<<
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, 3604, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, 1); __PYX_ERR(0, 3601, __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, "intersect") < 0)) __PYX_ERR(0, 3604, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersect") < 0)) __PYX_ERR(0, 3601, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
__pyx_v_compose_filter = values[2];
if (values[3]) {
- __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3607, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3604, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3607
+ /* "pywrapfst.pyx":3604
* _Fst ifst2,
* compose_filter=b"auto",
* bool connect=True): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3604, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3601, __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, 3604, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3605, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3601, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3602, __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":3604
+ /* "pywrapfst.pyx":3601
*
*
* cpdef _MutableFst intersect(_Fst ifst1, # <<<<<<<<<<<<<<
__pyx_t_2.__pyx_n = 2;
__pyx_t_2.compose_filter = __pyx_v_compose_filter;
__pyx_t_2.connect = __pyx_v_connect;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_intersect(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3604, __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, 3601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3637
+/* "pywrapfst.pyx":3634
*
*
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3660
+ /* "pywrapfst.pyx":3657
* 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, 3660, __pyx_L1_error)
+ __PYX_ERR(0, 3657, __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, 3660, __pyx_L1_error)
+ __PYX_ERR(0, 3657, __pyx_L1_error)
}
__pyx_r = fst::script::Isomorphic((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3637
+ /* "pywrapfst.pyx":3634
*
*
* 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, 3637, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, 1); __PYX_ERR(0, 3634, __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, 3637, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isomorphic") < 0)) __PYX_ERR(0, 3634, __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, 3637, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3634, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__47;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3637, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3634, __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, 3637, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3637, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3634, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3634, __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, 3637, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3634, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3663
+/* "pywrapfst.pyx":3660
*
*
* cpdef _MutableFst prune(_Fst ifst, # <<<<<<<<<<<<<<
float __pyx_v_delta = __pyx_k__48;
__pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__49;
- /* "pywrapfst.pyx":3666
+ /* "pywrapfst.pyx":3663
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None): # <<<<<<<<<<<<<<
* """
- * prune(ifst, delta=0.0009765625, nstate=-1, weight=None)
+ * prune(ifst, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
}
}
- /* "pywrapfst.pyx":3690
+ /* "pywrapfst.pyx":3687
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3690, __pyx_L1_error)
+ __PYX_ERR(0, 3687, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3691
+ /* "pywrapfst.pyx":3688
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 3691, __pyx_L1_error)
+ __PYX_ERR(0, 3688, __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, 3691, __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, 3688, __pyx_L1_error)
__pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":3692
+ /* "pywrapfst.pyx":3689
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
* fst.Prune(deref(ifst._fst), tfst.get(), wc, nstate, delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3692, __pyx_L1_error)
+ __PYX_ERR(0, 3689, __pyx_L1_error)
}
fst::script::Prune((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":3693
+ /* "pywrapfst.pyx":3690
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
* fst.Prune(deref(ifst._fst), tfst.get(), wc, nstate, delta)
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3693, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3690, __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":3663
+ /* "pywrapfst.pyx":3660
*
*
* cpdef _MutableFst prune(_Fst ifst, # <<<<<<<<<<<<<<
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_35prune(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_34prune[] = "\n prune(ifst, delta=0.0009765625, nstate=-1, weight=None)\n\n Constructively removes paths with weights below a certain threshold.\n\n This operation deletes states and arcs in the input FST that do not belong\n to a successful path whose weight is no more (w.r.t the natural semiring\n order) than the threshold t \\otimes-times the weight of the shortest path in\n the input FST. Weights must be commutative and have the path property.\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta.\n nstate: State number threshold.\n weight: A Weight or weight string indicating the desired weight threshold\n below which paths are pruned; if omitted, no paths are pruned.\n\n Returns:\n A pruned FST.\n\n See also: The destructive variant.\n ";
+static char __pyx_doc_9pywrapfst_34prune[] = "\n prune(ifst, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)\n\n Constructively removes paths with weights below a certain threshold.\n\n This operation deletes states and arcs in the input FST that do not belong\n to a successful path whose weight is no more (w.r.t the natural semiring\n order) than the threshold t \\otimes-times the weight of the shortest path in\n the input FST. Weights must be commutative and have the path property.\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta.\n nstate: State number threshold.\n weight: A Weight or weight string indicating the desired weight threshold\n below which paths are pruned; if omitted, no paths are pruned.\n\n Returns:\n A pruned FST.\n\n See also: The destructive variant.\n ";
static PyObject *__pyx_pw_9pywrapfst_35prune(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
float __pyx_v_delta;
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":3666
+ /* "pywrapfst.pyx":3663
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None): # <<<<<<<<<<<<<<
* """
- * prune(ifst, delta=0.0009765625, nstate=-1, weight=None)
+ * prune(ifst, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)
*/
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 3663, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 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, 3664, __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__48;
}
if (values[2]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3665, __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, 3662, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__49;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3663, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3660, __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, 3663, __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_34prune(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);
- /* "pywrapfst.pyx":3663
+ /* "pywrapfst.pyx":3660
*
*
* 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, 3663, __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, 3660, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3696
+/* "pywrapfst.pyx":3693
*
*
* 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__50;
- /* "pywrapfst.pyx":3698
+ /* "pywrapfst.pyx":3695
* cpdef _MutableFst push(_Fst ifst,
* float delta=fst.kDelta,
* bool push_weights=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_push_weights = ((bool)0);
- /* "pywrapfst.pyx":3699
+ /* "pywrapfst.pyx":3696
* float delta=fst.kDelta,
* bool push_weights=False,
* bool push_labels=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_push_labels = ((bool)0);
- /* "pywrapfst.pyx":3700
+ /* "pywrapfst.pyx":3697
* bool push_weights=False,
* bool push_labels=False,
* bool remove_common_affix=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_common_affix = ((bool)0);
- /* "pywrapfst.pyx":3701
+ /* "pywrapfst.pyx":3698
* bool push_labels=False,
* bool remove_common_affix=False,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_total_weight = ((bool)0);
- /* "pywrapfst.pyx":3702
+ /* "pywrapfst.pyx":3699
* bool remove_common_affix=False,
* bool remove_total_weight=False,
* bool to_final=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3742
+ /* "pywrapfst.pyx":3739
* # This is copied, almost verbatim, from nlp/fst/bin/fstpush.cc.
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3742, __pyx_L1_error)
+ __PYX_ERR(0, 3739, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3743
+ /* "pywrapfst.pyx":3740
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* cdef uint32 flags = fst.GetPushFlags(push_weights, push_labels, # <<<<<<<<<<<<<<
*/
__pyx_v_flags = fst::script::GetPushFlags(__pyx_v_push_weights, __pyx_v_push_labels, __pyx_v_remove_common_affix, __pyx_v_remove_total_weight);
- /* "pywrapfst.pyx":3745
+ /* "pywrapfst.pyx":3742
* cdef uint32 flags = fst.GetPushFlags(push_weights, push_labels,
* remove_common_affix, remove_total_weight)
* fst.Push(deref(ifst._fst), tfst.get(), flags, fst.GetReweightType(to_final), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3745, __pyx_L1_error)
+ __PYX_ERR(0, 3742, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3746
+ /* "pywrapfst.pyx":3743
* remove_common_affix, remove_total_weight)
* fst.Push(deref(ifst._fst), tfst.get(), flags, fst.GetReweightType(to_final),
* delta) # <<<<<<<<<<<<<<
*/
fst::script::Push((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_flags, fst::script::GetReweightType(__pyx_v_to_final), __pyx_v_delta);
- /* "pywrapfst.pyx":3747
+ /* "pywrapfst.pyx":3744
* fst.Push(deref(ifst._fst), tfst.get(), flags, fst.GetReweightType(to_final),
* delta)
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3747, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3744, __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":3696
+ /* "pywrapfst.pyx":3693
*
*
* 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, 3696, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 3693, __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, 3697, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3694, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__50;
}
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, 3698, __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, 3695, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3698
+ /* "pywrapfst.pyx":3695
* 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, 3699, __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, 3696, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3699
+ /* "pywrapfst.pyx":3696
* 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, 3700, __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, 3697, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3700
+ /* "pywrapfst.pyx":3697
* 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, 3701, __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, 3698, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3701
+ /* "pywrapfst.pyx":3698
* 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, 3702, __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, 3699, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3702
+ /* "pywrapfst.pyx":3699
* 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, 3696, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("push", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3693, __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, 3696, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3693, __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":3696
+ /* "pywrapfst.pyx":3693
*
*
* 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, 3696, __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, 3693, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3750
+/* "pywrapfst.pyx":3747
*
*
* cpdef bool randequivalent(_Fst ifst1, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int32 __pyx_v_max_length = __pyx_k__52;
enum fst::script::RandArcSelection __pyx_v_ras;
std::unique_ptr<fst::RandGenOptions<enum fst::script::RandArcSelection> > __pyx_v_opts;
- bool __pyx_v_error;
- bool __pyx_v_result;
bool __pyx_r;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
enum fst::script::RandArcSelection __pyx_t_2;
int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("randequivalent", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3788
+ /* "pywrapfst.pyx":3782
* 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, 3788, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3788, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3782, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3782, __pyx_L1_error)
__pyx_v_ras = __pyx_t_2;
- /* "pywrapfst.pyx":3791
+ /* "pywrapfst.pyx":3785
* 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":3793
+ /* "pywrapfst.pyx":3787
* opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,
* 1, False, False))
* if seed == 0: # <<<<<<<<<<<<<<
* seed = time(NULL) + getpid()
- * cdef bool error
+ * return fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), npath, delta,
*/
__pyx_t_3 = ((__pyx_v_seed == 0) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":3794
+ /* "pywrapfst.pyx":3788
* 1, False, False))
* if seed == 0:
* seed = time(NULL) + getpid() # <<<<<<<<<<<<<<
- * cdef bool error
- * cdef bool result = fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst),
+ * return fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), npath, delta,
+ * seed, deref(opts))
*/
__pyx_v_seed = (time(NULL) + getpid());
- /* "pywrapfst.pyx":3793
+ /* "pywrapfst.pyx":3787
* opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,
* 1, False, False))
* if seed == 0: # <<<<<<<<<<<<<<
* seed = time(NULL) + getpid()
- * cdef bool error
+ * return fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), npath, delta,
*/
}
- /* "pywrapfst.pyx":3796
+ /* "pywrapfst.pyx":3789
+ * if seed == 0:
* seed = time(NULL) + getpid()
- * cdef bool error
- * cdef bool result = fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), # <<<<<<<<<<<<<<
- * npath, delta, seed, deref(opts),
- * addr(error))
+ * return fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), npath, delta, # <<<<<<<<<<<<<<
+ * seed, deref(opts))
+ *
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3796, __pyx_L1_error)
+ __PYX_ERR(0, 3789, __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, 3796, __pyx_L1_error)
- }
-
- /* "pywrapfst.pyx":3798
- * cdef bool result = fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst),
- * npath, delta, seed, deref(opts),
- * addr(error)) # <<<<<<<<<<<<<<
- * if error:
- * raise FstOpError("Random equivalence test encountered 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":3799
- * npath, delta, seed, deref(opts),
- * addr(error))
- * if error: # <<<<<<<<<<<<<<
- * raise FstOpError("Random equivalence test encountered error")
- * return result
- */
- __pyx_t_3 = (__pyx_v_error != 0);
- if (__pyx_t_3) {
-
- /* "pywrapfst.pyx":3800
- * 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, 3800, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3800, __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, 3800, __pyx_L1_error)
-
- /* "pywrapfst.pyx":3799
- * npath, delta, seed, deref(opts),
- * addr(error))
- * if error: # <<<<<<<<<<<<<<
- * raise FstOpError("Random equivalence test encountered error")
- * return result
- */
+ __PYX_ERR(0, 3789, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3801
- * if error:
- * raise FstOpError("Random equivalence test encountered error")
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3790
+ * seed = time(NULL) + getpid()
+ * return fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), npath, delta,
+ * seed, deref(opts)) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_r = __pyx_v_result;
+ __pyx_r = fst::script::RandEquivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_npath, __pyx_v_delta, __pyx_v_seed, (*__pyx_v_opts));
goto __pyx_L0;
- /* "pywrapfst.pyx":3750
+ /* "pywrapfst.pyx":3747
*
*
* cpdef bool randequivalent(_Fst ifst1, # <<<<<<<<<<<<<<
/* function exit code */
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("pywrapfst.randequivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_39randequivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_38randequivalent[] = "\n randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, seed=0,\n select=\"uniform\", max_length=2147483647)\n\n Are two acceptors stochastically equivalent?\n\n This operation tests whether two FSTs are equivalent by randomly generating\n paths alternatively in each of the two FSTs. For each randomly generated path,\n the algorithm computes for each of the two FSTs the sum of the weights of all\n the successful paths sharing the same input and output labels as the randomly\n generated path and checks that these two values are within `delta`.\n\n Args:\n ifst1: The first input FST.\n ifst2: The second input FST.\n npath: The number of random paths to generate.\n delta: Comparison/quantization delta.\n seed: An optional seed value for random path generation; if zero, the\n current time and process ID is used.\n select: A string matching a known random arc selection type; one of:\n \"uniform\", \"log_prob\", \"fast_log_prob\".\n max_length: The maximum length of each random path.\n\n Returns:\n True if the two transducers satisfy the above condition, else False.\n\n Raise:\n FstOpError: Random equivalence test encountered error.\n\n See also: `equal`, `equivalent`, `isomorphic`, `randgen`.\n ";
+static char __pyx_doc_9pywrapfst_38randequivalent[] = "\n randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, seed=0,\n select=\"uniform\", max_length=2147483647)\n\n Are two acceptors stochastically equivalent?\n\n This operation tests whether two FSTs are equivalent by randomly generating\n paths alternatively in each of the two FSTs. For each randomly generated path,\n the algorithm computes for each of the two FSTs the sum of the weights of all\n the successful paths sharing the same input and output labels as the randomly\n generated path and checks that these two values are within `delta`.\n\n Args:\n ifst1: The first input FST.\n ifst2: The second input FST.\n npath: The number of random paths to generate.\n delta: Comparison/quantization delta.\n seed: An optional seed value for random path generation; if zero, the\n current time and process ID is used.\n select: A string matching a known random arc selection type; one of:\n \"uniform\", \"log_prob\", \"fast_log_prob\".\n max_length: The maximum length of each random path.\n\n Returns:\n True if the two transducers satisfy the above condition, else False.\n\n See also: `equal`, `equivalent`, `isomorphic`, `randgen`.\n ";
static PyObject *__pyx_pw_9pywrapfst_39randequivalent(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;
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, 3750, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, 1); __PYX_ERR(0, 3747, __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, 3750, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randequivalent") < 0)) __PYX_ERR(0, 3747, __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, 3752, __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, 3749, __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, 3753, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3750, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__51;
}
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, 3754, __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, 3751, __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, 3756, __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, 3753, __pyx_L3_error)
} else {
__pyx_v_max_length = __pyx_k__52;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3750, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3747, __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, 3750, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3751, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3747, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3748, __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, 3750, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3750, __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, 3747, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3747, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3804
+/* "pywrapfst.pyx":3793
*
*
* cpdef _MutableFst randgen(_Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_10basictypes_int32 __pyx_v_npath = ((__pyx_t_10basictypes_int32)1);
time_t __pyx_v_seed = ((time_t)0);
PyObject *__pyx_v_select = ((PyObject *)__pyx_n_b_uniform);
- __pyx_t_10basictypes_int32 __pyx_v_max_length = __pyx_k__54;
+ __pyx_t_10basictypes_int32 __pyx_v_max_length = __pyx_k__53;
- /* "pywrapfst.pyx":3809
+ /* "pywrapfst.pyx":3798
* select=b"uniform",
* int32 max_length=INT32_MAX,
* bool weighted=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_weighted = ((bool)0);
- /* "pywrapfst.pyx":3810
+ /* "pywrapfst.pyx":3799
* int32 max_length=INT32_MAX,
* bool weighted=False,
* bool remove_total_weight=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3842
+ /* "pywrapfst.pyx":3831
* 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, 3842, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3842, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3831, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3831, __pyx_L1_error)
__pyx_v_ras = __pyx_t_2;
- /* "pywrapfst.pyx":3844
+ /* "pywrapfst.pyx":3833
* 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":3848
+ /* "pywrapfst.pyx":3837
* remove_total_weight))
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3848, __pyx_L1_error)
+ __PYX_ERR(0, 3837, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3849
+ /* "pywrapfst.pyx":3838
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* if seed == 0: # <<<<<<<<<<<<<<
__pyx_t_3 = ((__pyx_v_seed == 0) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":3850
+ /* "pywrapfst.pyx":3839
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* if seed == 0:
* seed = time(NULL) + getpid() # <<<<<<<<<<<<<<
*/
__pyx_v_seed = (time(NULL) + getpid());
- /* "pywrapfst.pyx":3849
+ /* "pywrapfst.pyx":3838
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* if seed == 0: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3851
+ /* "pywrapfst.pyx":3840
* if seed == 0:
* seed = time(NULL) + getpid()
* fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3851, __pyx_L1_error)
+ __PYX_ERR(0, 3840, __pyx_L1_error)
}
fst::script::RandGen((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_seed, (*__pyx_v_opts));
- /* "pywrapfst.pyx":3852
+ /* "pywrapfst.pyx":3841
* seed = time(NULL) + getpid()
* fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3852, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3841, __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":3804
+ /* "pywrapfst.pyx":3793
*
*
* 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, 3804, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randgen") < 0)) __PYX_ERR(0, 3793, __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, 3805, __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, 3794, __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, 3806, __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, 3795, __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, 3808, __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, 3797, __pyx_L3_error)
} else {
- __pyx_v_max_length = __pyx_k__54;
+ __pyx_v_max_length = __pyx_k__53;
}
if (values[5]) {
- __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3809, __pyx_L3_error)
+ __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3798, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3809
+ /* "pywrapfst.pyx":3798
* 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, 3810, __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, 3799, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3810
+ /* "pywrapfst.pyx":3799
* 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, 3804, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randgen", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3793, __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, 3804, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3793, __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":3804
+ /* "pywrapfst.pyx":3793
*
*
* 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, 3804, __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, 3793, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3855
+/* "pywrapfst.pyx":3844
*
*
* 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":3858
+ /* "pywrapfst.pyx":3847
* call_arc_labeling=b"input",
* return_arc_labeling=b"neither",
* bool epsilon_on_replace=False, # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3900
+ /* "pywrapfst.pyx":3889
* 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, 3900, __pyx_L1_error)
+ __pyx_t_1 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3889, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_it = __pyx_t_1;
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":3901
+ /* "pywrapfst.pyx":3890
* cdef _Fst ifst
* it = iter(pairs)
* (root_label, ifst) = next(it) # <<<<<<<<<<<<<<
* _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
* cdef unique_ptr[fst.VectorFstClass] tfst
*/
- __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3901, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3890, __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, 3901, __pyx_L1_error)
+ __PYX_ERR(0, 3890, __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, 3901, __pyx_L1_error)
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3890, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3901, __pyx_L1_error)
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3890, __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, 3901, __pyx_L1_error)
+ __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3890, __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, 3901, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 3890, __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, 3901, __pyx_L1_error)
+ __PYX_ERR(0, 3890, __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, 3901, __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, 3890, __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, 3901, __pyx_L1_error)
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3890, __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":3902
+ /* "pywrapfst.pyx":3891
* 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, 3902, __pyx_L1_error)
+ __PYX_ERR(0, 3891, __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, 3902, __pyx_L1_error)
+ __PYX_ERR(0, 3891, __pyx_L1_error)
}
try {
__pyx_v__pairs.push_back(__pyx_t_7);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 3902, __pyx_L1_error)
+ __PYX_ERR(0, 3891, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3904
+ /* "pywrapfst.pyx":3893
* _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3904, __pyx_L1_error)
+ __PYX_ERR(0, 3893, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3905
+ /* "pywrapfst.pyx":3894
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* for (label, ifst) in it: # <<<<<<<<<<<<<<
__pyx_t_1 = __pyx_v_it; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3905, __pyx_L1_error)
+ __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3894, __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, 3905, __pyx_L1_error)
+ __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3894, __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, 3905, __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, 3894, __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, 3905, __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, 3894, __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, 3905, __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, 3894, __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, 3905, __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, 3894, __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, 3905, __pyx_L1_error)
+ else __PYX_ERR(0, 3894, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 3905, __pyx_L1_error)
+ __PYX_ERR(0, 3894, __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, 3905, __pyx_L1_error)
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3894, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3905, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3894, __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, 3905, __pyx_L1_error)
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3894, __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, 3905, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_10), 2) < 0) __PYX_ERR(0, 3894, __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, 3905, __pyx_L1_error)
+ __PYX_ERR(0, 3894, __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, 3905, __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, 3894, __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, 3905, __pyx_L1_error)
+ if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3894, __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":3906
+ /* "pywrapfst.pyx":3895
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* for (label, ifst) in it:
* _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3906, __pyx_L1_error)
+ __PYX_ERR(0, 3895, __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, 3906, __pyx_L1_error)
+ __PYX_ERR(0, 3895, __pyx_L1_error)
}
try {
__pyx_v__pairs.push_back(__pyx_t_7);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 3906, __pyx_L1_error)
+ __PYX_ERR(0, 3895, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3905
+ /* "pywrapfst.pyx":3894
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* for (label, ifst) in it: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":3908
+ /* "pywrapfst.pyx":3897
* _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, 3908, __pyx_L1_error)
+ __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_call_arc_labeling, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3897, __pyx_L1_error)
- /* "pywrapfst.pyx":3907
+ /* "pywrapfst.pyx":3896
* 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, 3907, __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, 3896, __pyx_L1_error)
__pyx_v_cal = __pyx_t_12;
- /* "pywrapfst.pyx":3910
+ /* "pywrapfst.pyx":3899
* 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, 3910, __pyx_L1_error)
+ __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_return_arc_labeling, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3899, __pyx_L1_error)
- /* "pywrapfst.pyx":3909
+ /* "pywrapfst.pyx":3898
* 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, 3909, __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, 3898, __pyx_L1_error)
__pyx_v_ral = __pyx_t_12;
- /* "pywrapfst.pyx":3912
+ /* "pywrapfst.pyx":3901
* 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":3913
+ /* "pywrapfst.pyx":3902
* cdef unique_ptr[fst.ReplaceOptions] opts
* opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label))
* fst.Replace(_pairs, tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
fst::script::Replace(__pyx_v__pairs, __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3914
+ /* "pywrapfst.pyx":3903
* opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label))
* fst.Replace(_pairs, tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3914, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3903, __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":3855
+ /* "pywrapfst.pyx":3844
*
*
* 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, 3855, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(0, 3844, __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, 3858, __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, 3847, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3858
+ /* "pywrapfst.pyx":3847
* 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, 3859, __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, 3848, __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, 3855, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("replace", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3844, __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":3855
+ /* "pywrapfst.pyx":3844
*
*
* 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, 3855, __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, 3844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3917
+/* "pywrapfst.pyx":3906
*
*
* cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=True): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3937
+ /* "pywrapfst.pyx":3926
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3937, __pyx_L1_error)
+ __PYX_ERR(0, 3926, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3938
+ /* "pywrapfst.pyx":3927
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.Reverse(deref(ifst._fst), tfst.get(), require_superinitial) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3938, __pyx_L1_error)
+ __PYX_ERR(0, 3927, __pyx_L1_error)
}
fst::script::Reverse((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_require_superinitial);
- /* "pywrapfst.pyx":3939
+ /* "pywrapfst.pyx":3928
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.Reverse(deref(ifst._fst), tfst.get(), require_superinitial)
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3939, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3928, __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":3917
+ /* "pywrapfst.pyx":3906
*
*
* 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, 3917, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reverse") < 0)) __PYX_ERR(0, 3906, __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, 3917, __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, 3906, __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, 3917, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3906, __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, 3917, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3906, __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, 3917, __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, 3906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3942
- *
- *
- * cpdef _MutableFst rmepsilon(_Fst ifst, # <<<<<<<<<<<<<<
- * bool connect=True,
- * float delta=fst.kDelta,
- */
-
-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":3943
- *
- * cpdef _MutableFst rmepsilon(_Fst ifst,
- * bool connect=True, # <<<<<<<<<<<<<<
- * float delta=fst.kDelta,
- * int64 nstate=fst.kNoStateId,
- */
- bool __pyx_v_connect = ((bool)1);
- float __pyx_v_delta = __pyx_k__55;
- __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__56;
- PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);
-
- /* "pywrapfst.pyx":3947
- * int64 nstate=fst.kNoStateId,
- * queue_type=b"auto",
- * bool reverse=False, # <<<<<<<<<<<<<<
- * weight=None):
- * """
- */
- bool __pyx_v_reverse = ((bool)0);
-
- /* "pywrapfst.pyx":3948
- * queue_type=b"auto",
- * bool reverse=False,
- * weight=None): # <<<<<<<<<<<<<<
- * """
- * rmepsilon(ifst, connect=True, delta=0.0009765625, nstate=-1,
- */
- PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- fst::script::WeightClass __pyx_v_wc;
- std::unique_ptr<fst::script::RmEpsilonOptions> __pyx_v_opts;
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- fst::script::WeightClass __pyx_t_1;
- std::string __pyx_t_2;
- enum fst::QueueType __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- __Pyx_RefNannySetupContext("rmepsilon", 0);
- if (__pyx_optional_args) {
- if (__pyx_optional_args->__pyx_n > 0) {
- __pyx_v_connect = __pyx_optional_args->connect;
- if (__pyx_optional_args->__pyx_n > 1) {
- __pyx_v_delta = __pyx_optional_args->delta;
- if (__pyx_optional_args->__pyx_n > 2) {
- __pyx_v_nstate = __pyx_optional_args->nstate;
- if (__pyx_optional_args->__pyx_n > 3) {
- __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) {
- __pyx_v_weight = __pyx_optional_args->weight;
- }
- }
- }
- }
- }
- }
- }
-
- /* "pywrapfst.pyx":3972
- * 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(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, 3972, __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, 3972, __pyx_L1_error)
- __pyx_v_wc = __pyx_t_1;
-
- /* "pywrapfst.pyx":3974
- * 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(queue_type)), # <<<<<<<<<<<<<<
- * delta, connect, wc, nstate))
- * cdef unique_ptr[fst.VectorFstClass] tfst
- */
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3974, __pyx_L1_error)
- __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3974, __pyx_L1_error)
-
- /* "pywrapfst.pyx":3975
- * cdef unique_ptr[fst.RmEpsilonOptions] opts
- * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
- * delta, connect, wc, nstate)) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
- */
- __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":3977
- * delta, connect, wc, nstate))
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
- * fst.RmEpsilon(deref(ifst._fst), tfst.get(), reverse, deref(opts))
- * return _init_MutableFst(tfst.release())
- */
- if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 3977, __pyx_L1_error)
- }
- __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
-
- /* "pywrapfst.pyx":3978
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
- * fst.RmEpsilon(deref(ifst._fst), tfst.get(), reverse, deref(opts)) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
- *
- */
- if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3978, __pyx_L1_error)
- }
- fst::script::RmEpsilon((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_reverse, (*__pyx_v_opts));
-
- /* "pywrapfst.pyx":3979
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
- * fst.RmEpsilon(deref(ifst._fst), tfst.get(), reverse, deref(opts))
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3979, __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":3942
- *
- *
- * cpdef _MutableFst rmepsilon(_Fst ifst, # <<<<<<<<<<<<<<
- * bool connect=True,
- * float delta=fst.kDelta,
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("pywrapfst.rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF((PyObject *)__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* 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,\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_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_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":3948
- * queue_type=b"auto",
- * bool reverse=False,
- * weight=None): # <<<<<<<<<<<<<<
- * """
- * rmepsilon(ifst, connect=True, delta=0.0009765625, nstate=-1,
- */
- values[6] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
- case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_connect);
- if (value) { values[1] = value; kw_args--; }
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
- if (value) { values[2] = value; kw_args--; }
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nstate);
- if (value) { values[3] = value; kw_args--; }
- }
- case 4:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_type);
- if (value) { values[4] = value; kw_args--; }
- }
- case 5:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reverse);
- if (value) { values[5] = value; kw_args--; }
- }
- case 6:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight);
- if (value) { values[6] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 3942, __pyx_L3_error)
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
- case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __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, 3943, __pyx_L3_error)
- } else {
-
- /* "pywrapfst.pyx":3943
- *
- * cpdef _MutableFst rmepsilon(_Fst ifst,
- * bool connect=True, # <<<<<<<<<<<<<<
- * float delta=fst.kDelta,
- * int64 nstate=fst.kNoStateId,
- */
- __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, 3944, __pyx_L3_error)
- } else {
- __pyx_v_delta = __pyx_k__55;
- }
- 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, 3945, __pyx_L3_error)
- } else {
- __pyx_v_nstate = __pyx_k__56;
- }
- __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, 3947, __pyx_L3_error)
- } else {
-
- /* "pywrapfst.pyx":3947
- * int64 nstate=fst.kNoStateId,
- * queue_type=b"auto",
- * bool reverse=False, # <<<<<<<<<<<<<<
- * weight=None):
- * """
- */
- __pyx_v_reverse = ((bool)0);
- }
- __pyx_v_weight = values[6];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3942, __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, 3942, __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":3942
- *
- *
- * cpdef _MutableFst rmepsilon(_Fst ifst, # <<<<<<<<<<<<<<
- * bool connect=True,
- * float delta=fst.kDelta,
- */
-
- /* function exit code */
- goto __pyx_L0;
- __pyx_L1_error:;
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- 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_queue_type, bool __pyx_v_reverse, PyObject *__pyx_v_weight) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- struct __pyx_opt_args_9pywrapfst_rmepsilon __pyx_t_2;
- __Pyx_RefNannySetupContext("rmepsilon", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2.__pyx_n = 6;
- __pyx_t_2.connect = __pyx_v_connect;
- __pyx_t_2.delta = __pyx_v_delta;
- __pyx_t_2.nstate = __pyx_v_nstate;
- __pyx_t_2.queue_type = __pyx_v_queue_type;
- __pyx_t_2.reverse = __pyx_v_reverse;
- __pyx_t_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, 3942, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("pywrapfst.rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "pywrapfst.pyx":3985
+/* "pywrapfst.pyx":3934
*
*
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
*/
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__57;
- __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__58;
+ float __pyx_v_delta = __pyx_k__54;
+ __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__55;
PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":3987
+ /* "pywrapfst.pyx":3936
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,
* float delta=fst.kDelta, int64 nstate=fst.kNoStateId, queue_type=b"auto",
* bool reverse=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3989
+ /* "pywrapfst.pyx":3938
* bool reverse=False) except *:
* cdef unique_ptr[vector[fst.WeightClass]] distance
* distance.reset(new vector[fst.WeightClass]()) # <<<<<<<<<<<<<<
__pyx_t_1 = new std::vector<fst::script::WeightClass> ();
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 3989, __pyx_L1_error)
+ __PYX_ERR(0, 3938, __pyx_L1_error)
}
__pyx_v_distance.reset(__pyx_t_1);
- /* "pywrapfst.pyx":3993
+ /* "pywrapfst.pyx":3942
* # not be used in all cases.
* cdef unique_ptr[fst.ShortestDistanceOptions] opts
* if reverse: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_v_reverse != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":3996
+ /* "pywrapfst.pyx":3945
* # Only the simpler signature supports shortest distance to final states;
* # `nstate` and `queue_type` arguments are ignored.
* fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 3996, __pyx_L1_error)
+ __PYX_ERR(0, 3945, __pyx_L1_error)
}
fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance.get(), 1, __pyx_v_delta);
- /* "pywrapfst.pyx":3993
+ /* "pywrapfst.pyx":3942
* # not be used in all cases.
* cdef unique_ptr[fst.ShortestDistanceOptions] opts
* if reverse: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":3998
+ /* "pywrapfst.pyx":3947
* fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta)
* else:
* opts.reset(new fst.ShortestDistanceOptions( # <<<<<<<<<<<<<<
*/
/*else*/ {
- /* "pywrapfst.pyx":3999
+ /* "pywrapfst.pyx":3948
* else:
* opts.reset(new fst.ShortestDistanceOptions(
* _get_queue_type(tostring(queue_type)), fst.ANY_ARC_FILTER, nstate, # <<<<<<<<<<<<<<
* delta))
* fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts))
*/
- __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3999, __pyx_L1_error)
- __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3999, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3948, __pyx_L1_error)
+ __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3948, __pyx_L1_error)
- /* "pywrapfst.pyx":3998
+ /* "pywrapfst.pyx":3947
* fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta)
* else:
* opts.reset(new fst.ShortestDistanceOptions( # <<<<<<<<<<<<<<
*/
__pyx_v_opts.reset(new fst::script::ShortestDistanceOptions(__pyx_t_4, fst::script::ANY_ARC_FILTER, __pyx_v_nstate, __pyx_v_delta));
- /* "pywrapfst.pyx":4001
+ /* "pywrapfst.pyx":3950
* _get_queue_type(tostring(queue_type)), fst.ANY_ARC_FILTER, nstate,
* delta))
* fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 4001, __pyx_L1_error)
+ __PYX_ERR(0, 3950, __pyx_L1_error)
}
fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance.get(), (*__pyx_v_opts));
}
__pyx_L3:;
- /* "pywrapfst.pyx":4002
+ /* "pywrapfst.pyx":3951
* delta))
* fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts))
* return distance.release() # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_distance.release();
goto __pyx_L0;
- /* "pywrapfst.pyx":3985
+ /* "pywrapfst.pyx":3934
*
*
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4005
+/* "pywrapfst.pyx":3954
*
*
* 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, 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) {
+static PyObject *__pyx_pw_9pywrapfst_47shortestdistance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_46shortestdistance[] = "\n shortestdistance(ifst, delta=0.0009765625, nstate=NO_STATE_ID,\n queue_type=\"auto\", 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 (ignored if `reverse` is True).\n queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n \"lifo\", \"shortest\", \"state\", \"top\" (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 PyMethodDef __pyx_mdef_9pywrapfst_47shortestdistance = {"shortestdistance", (PyCFunction)__pyx_pw_9pywrapfst_47shortestdistance, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_46shortestdistance};
+static PyObject *__pyx_pw_9pywrapfst_47shortestdistance(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;
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 4005, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 3954, __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, 4006, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3955, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__59;
+ __pyx_v_delta = __pyx_k__56;
}
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, 4007, __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, 3956, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__60;
+ __pyx_v_nstate = __pyx_k__57;
}
__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, 4009, __pyx_L3_error)
+ __pyx_v_reverse = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_reverse == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3958, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4009
+ /* "pywrapfst.pyx":3958
* int64 nstate=fst.kNoStateId,
* queue_type=b"auto",
* bool reverse=False): # <<<<<<<<<<<<<<
* """
- * shortestdistance(ifst, delta=0.0009765625, nstate=-1, queue_type="auto",
+ * shortestdistance(ifst, delta=0.0009765625, nstate=NO_STATE_ID,
*/
__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, 4005, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3954, __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, 4005, __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);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3954, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_46shortestdistance(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_queue_type, __pyx_v_reverse);
- /* "pywrapfst.pyx":4005
+ /* "pywrapfst.pyx":3954
*
*
* 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_queue_type, bool __pyx_v_reverse) {
+static PyObject *__pyx_pf_9pywrapfst_46shortestdistance(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;
- std::vector<fst::script::WeightClass> ::iterator __pyx_v_it;
+ fst::script::WeightClass __pyx_v_weight;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::vector<fst::script::WeightClass> *__pyx_t_1;
struct __pyx_opt_args_9pywrapfst__shortestdistance __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
+ std::vector<fst::script::WeightClass> ::iterator __pyx_t_4;
+ fst::script::WeightClass __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
- int __pyx_t_7;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("shortestdistance", 0);
- /* "pywrapfst.pyx":4038
+ /* "pywrapfst.pyx":3986
* """
* cdef unique_ptr[vector[fst.WeightClass]] distance
* 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()
+ * return [Weight(weight_type, weight.ToString()) for weight in deref(distance)]
*/
__pyx_t_2.__pyx_n = 4;
__pyx_t_2.delta = __pyx_v_delta;
__pyx_t_2.nstate = __pyx_v_nstate;
__pyx_t_2.queue_type = __pyx_v_queue_type;
__pyx_t_2.reverse = __pyx_v_reverse;
- __pyx_t_1 = __pyx_f_9pywrapfst__shortestdistance(__pyx_v_ifst, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4038, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__shortestdistance(__pyx_v_ifst, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3986, __pyx_L1_error)
__pyx_v_distance.reset(__pyx_t_1);
- /* "pywrapfst.pyx":4040
+ /* "pywrapfst.pyx":3987
+ * cdef unique_ptr[vector[fst.WeightClass]] distance
* 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 = []
- * # This is just the Cython version of the normal vector iteration idiom.
+ * return [Weight(weight_type, weight.ToString()) for weight in deref(distance)]
+ *
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 4040, __pyx_L1_error)
+ __PYX_ERR(0, 3987, __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":4041
- * # Packs the distances, as strings, into a Python list.
+ /* "pywrapfst.pyx":3988
+ * distance.reset(_shortestdistance(ifst, delta, nstate, queue_type, reverse))
* 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, 4041, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_result = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "pywrapfst.pyx":4043
- * result = []
- * # 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():
- * result.append(Weight(weight_type, deref(it).ToString()))
- */
- __pyx_v_it = __pyx_v_distance.get()->begin();
-
- /* "pywrapfst.pyx":4044
- * # 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(): # <<<<<<<<<<<<<<
- * result.append(Weight(weight_type, deref(it).ToString()))
- * inc(it)
- */
- while (1) {
- __pyx_t_4 = ((__pyx_v_it != __pyx_v_distance.get()->end()) != 0);
- if (!__pyx_t_4) break;
-
- /* "pywrapfst.pyx":4045
- * 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, 4045, __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, 4045, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4045, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_5);
- 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, 4045, __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, 4045, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "pywrapfst.pyx":4046
- * while it != distance.get().end():
- * result.append(Weight(weight_type, deref(it).ToString()))
- * inc(it) # <<<<<<<<<<<<<<
- * return result
- *
- */
- (++__pyx_v_it);
- }
-
- /* "pywrapfst.pyx":4047
- * result.append(Weight(weight_type, deref(it).ToString()))
- * inc(it)
- * return result # <<<<<<<<<<<<<<
+ * return [Weight(weight_type, weight.ToString()) for weight in deref(distance)] # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_result);
- __pyx_r = __pyx_v_result;
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3988, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = &(*__pyx_v_distance);
+ __pyx_t_4 = __pyx_t_1->begin();
+ for (;;) {
+ if (!(__pyx_t_4 != __pyx_t_1->end())) break;
+ __pyx_t_5 = *__pyx_t_4;
+ ++__pyx_t_4;
+ __pyx_v_weight = __pyx_t_5;
+ __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_weight_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3988, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_weight.ToString()); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3988, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3988, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
+ __pyx_t_6 = 0;
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3988, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 3988, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4005
+ /* "pywrapfst.pyx":3954
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("pywrapfst.shortestdistance", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
- __Pyx_XDECREF(__pyx_v_result);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":4050
+/* "pywrapfst.pyx":3991
*
*
* cpdef _MutableFst shortestpath(_Fst ifst, # <<<<<<<<<<<<<<
* int32 nshortest=1,
*/
-static PyObject *__pyx_pw_9pywrapfst_51shortestpath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_49shortestpath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_shortestpath *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__61;
+ float __pyx_v_delta = __pyx_k__58;
__pyx_t_10basictypes_int32 __pyx_v_nshortest = ((__pyx_t_10basictypes_int32)1);
- __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__62;
+ __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__59;
PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":4055
+ /* "pywrapfst.pyx":3996
* int64 nstate=fst.kNoStateId,
* queue_type=b"auto",
* bool unique=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_unique = ((bool)0);
- /* "pywrapfst.pyx":4056
+ /* "pywrapfst.pyx":3997
* queue_type=b"auto",
* bool unique=False,
* weight=None): # <<<<<<<<<<<<<<
* """
- * shortestpath(ifst, delta=0.0009765625, nshortest=1, nstate=-1,
+ * shortestpath(ifst, delta=0.0009765625, nshortest=1, nstate=NO_STATE_ID,
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- std::unique_ptr<std::vector<fst::script::WeightClass> > __pyx_v_distance;
fst::script::WeightClass __pyx_v_wc;
std::unique_ptr<fst::script::ShortestPathOptions> __pyx_v_opts;
struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- std::vector<fst::script::WeightClass> *__pyx_t_1;
- fst::script::WeightClass __pyx_t_2;
- std::string __pyx_t_3;
- enum fst::QueueType __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
+ fst::script::WeightClass __pyx_t_1;
+ std::string __pyx_t_2;
+ enum fst::QueueType __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("shortestpath", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":4088
+ /* "pywrapfst.pyx":4029
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
- * cdef unique_ptr[vector[fst.WeightClass]] distance
- * 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)
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 4088, __pyx_L1_error)
+ __PYX_ERR(0, 4029, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":4090
+ /* "pywrapfst.pyx":4031
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
- * cdef unique_ptr[vector[fst.WeightClass]] distance
- * 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)
- */
- try {
- __pyx_t_1 = new std::vector<fst::script::WeightClass> ();
- } catch(...) {
- __Pyx_CppExn2PyErr();
- __PYX_ERR(0, 4090, __pyx_L1_error)
- }
- __pyx_v_distance.reset(__pyx_t_1);
-
- /* "pywrapfst.pyx":4092
- * 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
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
- __PYX_ERR(0, 4092, __pyx_L1_error)
+ __PYX_ERR(0, 4031, __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, 4092, __pyx_L1_error)
- __pyx_v_wc = __pyx_t_2;
+ __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, 4031, __pyx_L1_error)
+ __pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":4094
+ /* "pywrapfst.pyx":4033
* cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
* cdef unique_ptr[fst.ShortestPathOptions] opts
* opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
- * nshortest, unique, False, delta,
- * False, wc, nstate))
+ * nshortest, unique, delta, wc, nstate))
+ * fst.ShortestPath(deref(ifst._fst), tfst.get(), deref(opts))
*/
- __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4094, __pyx_L1_error)
- __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4094, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4033, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4033, __pyx_L1_error)
- /* "pywrapfst.pyx":4096
+ /* "pywrapfst.pyx":4034
+ * cdef unique_ptr[fst.ShortestPathOptions] opts
* opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),
- * nshortest, unique, False, delta,
- * False, wc, nstate)) # <<<<<<<<<<<<<<
- * fst.ShortestPath(deref(ifst._fst), tfst.get(), distance.get(), deref(opts))
+ * nshortest, unique, delta, wc, nstate)) # <<<<<<<<<<<<<<
+ * fst.ShortestPath(deref(ifst._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release())
*/
- __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));
+ __pyx_v_opts.reset(new fst::script::ShortestPathOptions(__pyx_t_3, __pyx_v_nshortest, __pyx_v_unique, __pyx_v_delta, __pyx_v_wc, __pyx_v_nstate));
- /* "pywrapfst.pyx":4097
- * nshortest, unique, False, delta,
- * False, wc, nstate))
- * fst.ShortestPath(deref(ifst._fst), tfst.get(), distance.get(), deref(opts)) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4035
+ * opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),
+ * nshortest, unique, delta, wc, nstate))
+ * fst.ShortestPath(deref(ifst._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
* return _init_MutableFst(tfst.release())
*
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 4097, __pyx_L1_error)
+ __PYX_ERR(0, 4035, __pyx_L1_error)
}
- fst::script::ShortestPath((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_distance.get(), (*__pyx_v_opts));
+ fst::script::ShortestPath((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":4098
- * False, wc, nstate))
- * fst.ShortestPath(deref(ifst._fst), tfst.get(), distance.get(), deref(opts))
+ /* "pywrapfst.pyx":4036
+ * nshortest, unique, delta, wc, nstate))
+ * fst.ShortestPath(deref(ifst._fst), tfst.get(), deref(opts))
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_5 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4098, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_5);
- __pyx_t_5 = 0;
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4036, __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":4050
+ /* "pywrapfst.pyx":3991
*
*
* cpdef _MutableFst shortestpath(_Fst ifst, # <<<<<<<<<<<<<<
/* function exit code */
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("pywrapfst.shortestpath", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
}
/* 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,\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) {
+static PyObject *__pyx_pw_9pywrapfst_49shortestpath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_48shortestpath[] = "\n shortestpath(ifst, delta=0.0009765625, nshortest=1, nstate=NO_STATE_ID,\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_49shortestpath(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;
PyObject* values[7] = {0,0,0,0,0,0,0};
values[4] = ((PyObject *)__pyx_n_b_auto);
- /* "pywrapfst.pyx":4056
+ /* "pywrapfst.pyx":3997
* queue_type=b"auto",
* bool unique=False,
* weight=None): # <<<<<<<<<<<<<<
* """
- * shortestpath(ifst, delta=0.0009765625, nshortest=1, nstate=-1,
+ * shortestpath(ifst, delta=0.0009765625, nshortest=1, nstate=NO_STATE_ID,
*/
values[6] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestpath") < 0)) __PYX_ERR(0, 4050, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestpath") < 0)) __PYX_ERR(0, 3991, __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, 4051, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3992, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__61;
+ __pyx_v_delta = __pyx_k__58;
}
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, 4052, __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, 3993, __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, 4053, __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, 3994, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__62;
+ __pyx_v_nstate = __pyx_k__59;
}
__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, 4055, __pyx_L3_error)
+ __pyx_v_unique = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_unique == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3996, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4055
+ /* "pywrapfst.pyx":3996
* int64 nstate=fst.kNoStateId,
* queue_type=b"auto",
* bool unique=False, # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4050, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3991, __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, 4050, __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);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3991, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_48shortestpath(__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":4050
+ /* "pywrapfst.pyx":3991
*
*
* 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_queue_type, bool __pyx_v_unique, PyObject *__pyx_v_weight) {
+static PyObject *__pyx_pf_9pywrapfst_48shortestpath(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.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, 4050, __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, 3991, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4101
+/* "pywrapfst.pyx":4039
*
*
* 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 PyObject *__pyx_pw_9pywrapfst_51statemap(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_map_type, CYTHON_UNUSED int __pyx_skip_dispatch) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst__map __pyx_t_2;
__Pyx_RefNannySetupContext("statemap", 0);
- /* "pywrapfst.pyx":4124
+ /* "pywrapfst.pyx":4062
* See also: `arcmap`.
* """
* return _map(ifst, fst.kDelta, map_type, None) # <<<<<<<<<<<<<<
__pyx_t_2.delta = fst::kDelta;
__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, 4124, __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, 4062, __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":4101
+ /* "pywrapfst.pyx":4039
*
*
* cpdef _Fst statemap(_Fst 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 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) {
+static PyObject *__pyx_pw_9pywrapfst_51statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_9pywrapfst_50statemap[] = "\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_51statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
PyObject *__pyx_v_map_type = 0;
PyObject *__pyx_r = 0;
case 1:
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, 4101, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4039, __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, 4101, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "statemap") < 0)) __PYX_ERR(0, 4039, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4101, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4039, __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, 4101, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_52statemap(__pyx_self, __pyx_v_ifst, __pyx_v_map_type);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4039, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_50statemap(__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_map_type) {
+static PyObject *__pyx_pf_9pywrapfst_50statemap(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_map_type, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4101, __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, 4039, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4127
+/* "pywrapfst.pyx":4065
*
*
* cpdef _MutableFst synchronize(_Fst ifst): # <<<<<<<<<<<<<<
* synchronize(ifst)
*/
-static PyObject *__pyx_pw_9pywrapfst_55synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_53synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_synchronize(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch) {
std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("synchronize", 0);
- /* "pywrapfst.pyx":4147
+ /* "pywrapfst.pyx":4085
* """
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
- __PYX_ERR(0, 4147, __pyx_L1_error)
+ __PYX_ERR(0, 4085, __pyx_L1_error)
}
__pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":4148
+ /* "pywrapfst.pyx":4086
* cdef unique_ptr[fst.VectorFstClass] tfst
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.Synchronize(deref(ifst._fst), tfst.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
- __PYX_ERR(0, 4148, __pyx_L1_error)
+ __PYX_ERR(0, 4086, __pyx_L1_error)
}
fst::script::Synchronize((*__pyx_v_ifst->_fst), __pyx_v_tfst.get());
- /* "pywrapfst.pyx":4149
+ /* "pywrapfst.pyx":4087
* tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.Synchronize(deref(ifst._fst), tfst.get())
* return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4149, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4087, __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":4127
+ /* "pywrapfst.pyx":4065
*
*
* cpdef _MutableFst synchronize(_Fst ifst): # <<<<<<<<<<<<<<
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_55synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst); /*proto*/
-static char __pyx_doc_9pywrapfst_54synchronize[] = "\n synchronize(ifst)\n\n Constructively synchronizes an FST.\n\n This operation synchronizes a transducer. The result will be an equivalent\n FST that has the property that during the traversal of a path, the delay is\n either zero or strictly increasing, where the delay is the difference between\n the number of non-epsilon output labels and input labels along the path. For\n the algorithm to terminate, the input transducer must have bounded delay,\n i.e., the delay of every cycle must be zero.\n\n Args:\n ifst: The input FST.\n\n Returns:\n An equivalent synchronized FST.\n ";
-static PyObject *__pyx_pw_9pywrapfst_55synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst) {
+static PyObject *__pyx_pw_9pywrapfst_53synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst); /*proto*/
+static char __pyx_doc_9pywrapfst_52synchronize[] = "\n synchronize(ifst)\n\n Constructively synchronizes an FST.\n\n This operation synchronizes a transducer. The result will be an equivalent\n FST that has the property that during the traversal of a path, the delay is\n either zero or strictly increasing, where the delay is the difference between\n the number of non-epsilon output labels and input labels along the path. For\n the algorithm to terminate, the input transducer must have bounded delay,\n i.e., the delay of every cycle must be zero.\n\n Args:\n ifst: The input FST.\n\n Returns:\n An equivalent synchronized FST.\n ";
+static PyObject *__pyx_pw_9pywrapfst_53synchronize(PyObject *__pyx_self, PyObject *__pyx_v_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, 4127, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_54synchronize(__pyx_self, ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_ifst));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4065, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_52synchronize(__pyx_self, ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_ifst));
/* function exit code */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_54synchronize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
+static PyObject *__pyx_pf_9pywrapfst_52synchronize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
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, 4127, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_synchronize(__pyx_v_ifst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4065, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4206
+/* "pywrapfst.pyx":4144
* """
*
* 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":4209
+ /* "pywrapfst.pyx":4147
* 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":4210
+ /* "pywrapfst.pyx":4148
* string arc_type=b"standard",
* SymbolTable isymbols=None,
* SymbolTable osymbols=None, # <<<<<<<<<<<<<<
*/
values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
- /* "pywrapfst.pyx":4211
+ /* "pywrapfst.pyx":4149
* 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, 4206, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 4144, __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, 4207, __pyx_L3_error)
+ __pyx_v_fst_type = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4145, __pyx_L3_error)
} else {
- __pyx_v_fst_type = __pyx_k__63;
+ __pyx_v_fst_type = __pyx_k__60;
}
if (values[1]) {
- __pyx_v_arc_type = __pyx_convert_string_from_py_std__in_string(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4208, __pyx_L3_error)
+ __pyx_v_arc_type = __pyx_convert_string_from_py_std__in_string(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4146, __pyx_L3_error)
} else {
- __pyx_v_arc_type = __pyx_k__64;
+ __pyx_v_arc_type = __pyx_k__61;
}
__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)values[2]);
__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, 4212, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4150, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4212
+ /* "pywrapfst.pyx":4150
* 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, 4213, __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, 4151, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4213
+ /* "pywrapfst.pyx":4151
* 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, 4214, __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, 4152, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4214
+ /* "pywrapfst.pyx":4152
* 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, 4215, __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, 4153, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4215
+ /* "pywrapfst.pyx":4153
* 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, 4216, __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, 4154, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4216
+ /* "pywrapfst.pyx":4154
* 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, 4206, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4144, __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, 4209, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4210, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4211, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 4147, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4148, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4149, __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":4206
+ /* "pywrapfst.pyx":4144
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
fst::SymbolTable *__pyx_t_5;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "pywrapfst.pyx":4217
+ /* "pywrapfst.pyx":4155
* 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, 4217, __pyx_L1_error)
+ __PYX_ERR(0, 4155, __pyx_L1_error)
}
__pyx_v_self->_sstrm.reset(new std::stringstream());
- /* "pywrapfst.pyx":4218
+ /* "pywrapfst.pyx":4156
* 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, 4218, __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, 4156, __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, 4218, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4156, __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, 4218, __pyx_L1_error)
+ __PYX_ERR(0, 4156, __pyx_L1_error)
}
__pyx_v_self->_fst_type = __pyx_t_2;
- /* "pywrapfst.pyx":4219
+ /* "pywrapfst.pyx":4157
* 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, 4219, __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, 4157, __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, 4219, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4157, __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, 4219, __pyx_L1_error)
+ __PYX_ERR(0, 4157, __pyx_L1_error)
}
__pyx_v_self->_arc_type = __pyx_t_2;
- /* "pywrapfst.pyx":4220
+ /* "pywrapfst.pyx":4158
* 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, 4220, __pyx_L1_error)
+ __PYX_ERR(0, 4158, __pyx_L1_error)
}
__pyx_v_self->_isymbols = NULL;
- /* "pywrapfst.pyx":4221
+ /* "pywrapfst.pyx":4159
* 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":4222
+ /* "pywrapfst.pyx":4160
* 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, 4222, __pyx_L1_error)
+ __PYX_ERR(0, 4160, __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, 4222, __pyx_L1_error)
+ __PYX_ERR(0, 4160, __pyx_L1_error)
}
__pyx_v_self->_isymbols = __pyx_t_5;
- /* "pywrapfst.pyx":4221
+ /* "pywrapfst.pyx":4159
* self._arc_type = tostring(arc_type)
* self._isymbols = NULL
* if isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4223
+ /* "pywrapfst.pyx":4161
* 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, 4223, __pyx_L1_error)
+ __PYX_ERR(0, 4161, __pyx_L1_error)
}
__pyx_v_self->_osymbols = NULL;
- /* "pywrapfst.pyx":4224
+ /* "pywrapfst.pyx":4162
* 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":4225
+ /* "pywrapfst.pyx":4163
* 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, 4225, __pyx_L1_error)
+ __PYX_ERR(0, 4163, __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, 4225, __pyx_L1_error)
+ __PYX_ERR(0, 4163, __pyx_L1_error)
}
__pyx_v_self->_osymbols = __pyx_t_5;
- /* "pywrapfst.pyx":4224
+ /* "pywrapfst.pyx":4162
* self._isymbols = isymbols._table
* self._osymbols = NULL
* if osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4226
+ /* "pywrapfst.pyx":4164
* 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, 4226, __pyx_L1_error)
+ __PYX_ERR(0, 4164, __pyx_L1_error)
}
__pyx_v_self->_ssymbols = NULL;
- /* "pywrapfst.pyx":4227
+ /* "pywrapfst.pyx":4165
* 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":4228
+ /* "pywrapfst.pyx":4166
* 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, 4228, __pyx_L1_error)
+ __PYX_ERR(0, 4166, __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, 4228, __pyx_L1_error)
+ __PYX_ERR(0, 4166, __pyx_L1_error)
}
__pyx_v_self->_ssymbols = __pyx_t_5;
- /* "pywrapfst.pyx":4227
+ /* "pywrapfst.pyx":4165
* self._osymbols = osymbols._table
* self._ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4229
+ /* "pywrapfst.pyx":4167
* 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, 4229, __pyx_L1_error)
+ __PYX_ERR(0, 4167, __pyx_L1_error)
}
__pyx_v_self->_acceptor = __pyx_v_acceptor;
- /* "pywrapfst.pyx":4230
+ /* "pywrapfst.pyx":4168
* 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, 4230, __pyx_L1_error)
+ __PYX_ERR(0, 4168, __pyx_L1_error)
}
__pyx_v_self->_keep_isymbols = __pyx_v_keep_isymbols;
- /* "pywrapfst.pyx":4231
+ /* "pywrapfst.pyx":4169
* 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, 4231, __pyx_L1_error)
+ __PYX_ERR(0, 4169, __pyx_L1_error)
}
__pyx_v_self->_keep_osymbols = __pyx_v_keep_osymbols;
- /* "pywrapfst.pyx":4232
+ /* "pywrapfst.pyx":4170
* 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, 4232, __pyx_L1_error)
+ __PYX_ERR(0, 4170, __pyx_L1_error)
}
__pyx_v_self->_keep_state_numbering = __pyx_v_keep_state_numbering;
- /* "pywrapfst.pyx":4233
+ /* "pywrapfst.pyx":4171
* 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, 4233, __pyx_L1_error)
+ __PYX_ERR(0, 4171, __pyx_L1_error)
}
__pyx_v_self->_allow_negative_labels = __pyx_v_allow_negative_labels;
- /* "pywrapfst.pyx":4206
+ /* "pywrapfst.pyx":4144
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4235
+/* "pywrapfst.pyx":4173
* 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, 4235, __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, 4173, __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, 4235, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4173, __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, 4235, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4173, __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, 4235, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 4173, __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":4250
+ /* "pywrapfst.pyx":4188
* """
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.CompileFstInternal(deref(self._sstrm), # <<<<<<<<<<<<<<
- * "<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
+ * b"<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
* self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_sstrm");
- __PYX_ERR(0, 4250, __pyx_L1_error)
+ __PYX_ERR(0, 4188, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4251
+ /* "pywrapfst.pyx":4189
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.CompileFstInternal(deref(self._sstrm),
- * "<pywrapfst>", self._fst_type, self._arc_type, self._isymbols, # <<<<<<<<<<<<<<
+ * b"<pywrapfst>", self._fst_type, self._arc_type, self._isymbols, # <<<<<<<<<<<<<<
* self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,
* self._keep_osymbols, self._keep_state_numbering,
*/
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_pywrapfst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4251, __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, 4189, __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, 4251, __pyx_L1_error)
+ __PYX_ERR(0, 4189, __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, 4251, __pyx_L1_error)
+ __PYX_ERR(0, 4189, __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, 4251, __pyx_L1_error)
+ __PYX_ERR(0, 4189, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4252
+ /* "pywrapfst.pyx":4190
* tfst.reset(fst.CompileFstInternal(deref(self._sstrm),
- * "<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
+ * b"<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
* self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols, # <<<<<<<<<<<<<<
* self._keep_osymbols, self._keep_state_numbering,
* self._allow_negative_labels))
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_osymbols");
- __PYX_ERR(0, 4252, __pyx_L1_error)
+ __PYX_ERR(0, 4190, __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, 4252, __pyx_L1_error)
+ __PYX_ERR(0, 4190, __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, 4252, __pyx_L1_error)
+ __PYX_ERR(0, 4190, __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, 4252, __pyx_L1_error)
+ __PYX_ERR(0, 4190, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4253
- * "<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
+ /* "pywrapfst.pyx":4191
+ * b"<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
* self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,
* self._keep_osymbols, self._keep_state_numbering, # <<<<<<<<<<<<<<
* self._allow_negative_labels))
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_keep_osymbols");
- __PYX_ERR(0, 4253, __pyx_L1_error)
+ __PYX_ERR(0, 4191, __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, 4253, __pyx_L1_error)
+ __PYX_ERR(0, 4191, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4254
+ /* "pywrapfst.pyx":4192
* 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, 4254, __pyx_L1_error)
+ __PYX_ERR(0, 4192, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4250
+ /* "pywrapfst.pyx":4188
* """
* cdef unique_ptr[fst.FstClass] tfst
* tfst.reset(fst.CompileFstInternal(deref(self._sstrm), # <<<<<<<<<<<<<<
- * "<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
+ * b"<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
* self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,
*/
__pyx_v_tfst.reset(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":4255
+ /* "pywrapfst.pyx":4193
* 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, 4255, __pyx_L1_error)
+ __PYX_ERR(0, 4193, __pyx_L1_error)
}
__pyx_v_self->_sstrm.reset(new std::stringstream());
- /* "pywrapfst.pyx":4256
+ /* "pywrapfst.pyx":4194
* self._allow_negative_labels))
* self._sstrm.reset(new stringstream())
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_6 = ((__pyx_v_tfst.get() == NULL) != 0);
if (__pyx_t_6) {
- /* "pywrapfst.pyx":4257
+ /* "pywrapfst.pyx":4195
* self._sstrm.reset(new stringstream())
* if tfst.get() == NULL:
* raise FstOpError("Compilation failed") # <<<<<<<<<<<<<<
* return _init_XFst(tfst.release())
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4257, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4257, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4195, __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, 4257, __pyx_L1_error)
+ __PYX_ERR(0, 4195, __pyx_L1_error)
- /* "pywrapfst.pyx":4256
+ /* "pywrapfst.pyx":4194
* self._allow_negative_labels))
* self._sstrm.reset(new stringstream())
* if tfst.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4258
+ /* "pywrapfst.pyx":4196
* if tfst.get() == NULL:
* raise FstOpError("Compilation failed")
* return _init_XFst(tfst.release()) # <<<<<<<<<<<<<<
* cpdef void write(self, expression):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4258, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4196, __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":4235
+ /* "pywrapfst.pyx":4173
* 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, 4235, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_8Compiler_compile(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4260
+/* "pywrapfst.pyx":4198
* return _init_XFst(tfst.release())
*
* 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, 4260, __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, 4198, __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, 4260, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4198, __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, 4260, __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, 4198, __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, 4260, __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, 4198, __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, 4260, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4198, __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, 4260, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4198, __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":4276
+ /* "pywrapfst.pyx":4214
* 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, 4276, __pyx_L1_error)
+ __PYX_ERR(0, 4214, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4276, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4214, __pyx_L1_error)
((*__pyx_v_self->_sstrm) << __pyx_t_6);
- /* "pywrapfst.pyx":4260
+ /* "pywrapfst.pyx":4198
* return _init_XFst(tfst.release())
*
* cpdef void write(self, expression): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("write", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_8Compiler_write(__pyx_v_self, __pyx_v_expression, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4260, __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, 4198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4298
+/* "pywrapfst.pyx":4236
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":4299
+ /* "pywrapfst.pyx":4237
*
* 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, 4299, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4300
+ /* "pywrapfst.pyx":4238
* 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, 4300, __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, 4238, __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, 4300, __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, 4238, __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, 4300, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4238, __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, 4300, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4238, __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, 4300, __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, 4238, __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, 4300, __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, 4238, __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, 4300, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4238, __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, 4300, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4238, __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, 4299, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4237, __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, 4299, __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, 4237, __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, 4299, __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, 4237, __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, 4299, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4237, __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, 4299, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4237, __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, 4299, __pyx_L1_error)
+ __PYX_ERR(0, 4237, __pyx_L1_error)
- /* "pywrapfst.pyx":4298
+ /* "pywrapfst.pyx":4236
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4302
+/* "pywrapfst.pyx":4240
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":4303
+ /* "pywrapfst.pyx":4241
*
* 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, 4303, __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, 4241, __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, 4303, __pyx_L1_error)
+ __PYX_ERR(0, 4241, __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, 4303, __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, 4241, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4303, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4241, __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, 4303, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4241, __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, 4303, __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, 4241, __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, 4303, __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, 4241, __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, 4303, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4241, __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, 4303, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4241, __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":4302
+ /* "pywrapfst.pyx":4240
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4306
+/* "pywrapfst.pyx":4244
*
* @classmethod
* def open(cls, *filenames): # <<<<<<<<<<<<<<
__Pyx_RefNannySetupContext("open", 0);
__Pyx_INCREF(__pyx_v_filenames);
- /* "pywrapfst.pyx":4324
+ /* "pywrapfst.pyx":4262
* FstIOError: Read failed.
* """
* filenames = [tostring(filename) for filename in filenames] # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.FarReaderClass] tfar
* tfar.reset(fst.FarReaderClass.Open(filenames))
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4324, __pyx_L1_error)
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4262, __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, 4324, __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, 4262, __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, 4324, __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, 4262, __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, 4324, __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, 4324, __pyx_L1_error)
+ __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4262, __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, 4262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4324, __pyx_L1_error)
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4262, __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":4326
+ /* "pywrapfst.pyx":4264
* filenames = [tostring(filename) for filename in filenames]
* cdef unique_ptr[fst.FarReaderClass] tfar
* tfar.reset(fst.FarReaderClass.Open(filenames)) # <<<<<<<<<<<<<<
* if tfar.get() == 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, 4326, __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, 4264, __pyx_L1_error)
__pyx_v_tfar.reset(fst::script::FarReaderClass::Open(__pyx_t_6));
- /* "pywrapfst.pyx":4327
+ /* "pywrapfst.pyx":4265
* cdef unique_ptr[fst.FarReaderClass] tfar
* tfar.reset(fst.FarReaderClass.Open(filenames))
* if tfar.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_7 = ((__pyx_v_tfar.get() == NULL) != 0);
if (__pyx_t_7) {
- /* "pywrapfst.pyx":4328
+ /* "pywrapfst.pyx":4266
* tfar.reset(fst.FarReaderClass.Open(filenames))
* if tfar.get() == NULL:
* raise FstIOError("Read failed: {!r}".format(filenames)) # <<<<<<<<<<<<<<
* cdef FarReader result = FarReader.__new__(FarReader)
* result._reader.reset(tfar.release())
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4328, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4266, __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, 4328, __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, 4266, __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, 4328, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_filenames); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4266, __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, 4328, __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, 4266, __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, 4328, __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, 4266, __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, 4328, __pyx_L1_error)
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4266, __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, 4328, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4266, __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, 4328, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4266, __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, 4328, __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, 4266, __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, 4328, __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, 4266, __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, 4328, __pyx_L1_error)
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4266, __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, 4328, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4266, __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, 4328, __pyx_L1_error)
+ __PYX_ERR(0, 4266, __pyx_L1_error)
- /* "pywrapfst.pyx":4327
+ /* "pywrapfst.pyx":4265
* cdef unique_ptr[fst.FarReaderClass] tfar
* tfar.reset(fst.FarReaderClass.Open(filenames))
* if tfar.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4329
+ /* "pywrapfst.pyx":4267
* if tfar.get() == NULL:
* raise FstIOError("Read failed: {!r}".format(filenames))
* cdef FarReader result = FarReader.__new__(FarReader) # <<<<<<<<<<<<<<
* result._reader.reset(tfar.release())
* return result
*/
- __pyx_t_1 = __pyx_tp_new_9pywrapfst_FarReader(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarReader), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4329, __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, 4267, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_FarReader)))) __PYX_ERR(0, 4329, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_FarReader)))) __PYX_ERR(0, 4267, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":4330
+ /* "pywrapfst.pyx":4268
* raise FstIOError("Read failed: {!r}".format(filenames))
* cdef FarReader result = FarReader.__new__(FarReader)
* result._reader.reset(tfar.release()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
- __PYX_ERR(0, 4330, __pyx_L1_error)
+ __PYX_ERR(0, 4268, __pyx_L1_error)
}
__pyx_v_result->_reader.reset(__pyx_v_tfar.release());
- /* "pywrapfst.pyx":4331
+ /* "pywrapfst.pyx":4269
* cdef FarReader result = FarReader.__new__(FarReader)
* result._reader.reset(tfar.release())
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":4306
+ /* "pywrapfst.pyx":4244
*
* @classmethod
* def open(cls, *filenames): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4334
+/* "pywrapfst.pyx":4272
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":4335
+ /* "pywrapfst.pyx":4273
* # 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":4334
+ /* "pywrapfst.pyx":4272
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4338
+/* "pywrapfst.pyx":4276
*
* # 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":4339
+ /* "pywrapfst.pyx":4277
* # 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, 4339, __pyx_L1_error)
+ __PYX_ERR(0, 4277, __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":4340
+ /* "pywrapfst.pyx":4278
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* cdef _Fst f = self.get_fst()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 4340, __pyx_L1_error)
+ __PYX_ERR(0, 4278, __pyx_L1_error)
- /* "pywrapfst.pyx":4339
+ /* "pywrapfst.pyx":4277
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4341
+ /* "pywrapfst.pyx":4279
* 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, 4341, __pyx_L1_error)
+ __PYX_ERR(0, 4279, __pyx_L1_error)
}
__pyx_v_k = ((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_key(__pyx_v_self, 0);
- /* "pywrapfst.pyx":4342
+ /* "pywrapfst.pyx":4280
* raise StopIteration
* cdef string k = self.get_key()
* cdef _Fst 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, 4342, __pyx_L1_error)
+ __PYX_ERR(0, 4280, __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, 4342, __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, 4280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_f = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":4343
+ /* "pywrapfst.pyx":4281
* cdef string k = self.get_key()
* cdef _Fst 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, 4343, __pyx_L1_error)
+ __PYX_ERR(0, 4281, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":4344
+ /* "pywrapfst.pyx":4282
* cdef _Fst 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, 4344, __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, 4282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4344, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4282, __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":4338
+ /* "pywrapfst.pyx":4276
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4346
+/* "pywrapfst.pyx":4284
* 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, 4346, __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, 4284, __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, 4346, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4284, __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, 4346, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4284, __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, 4346, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4284, __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":4352
+ /* "pywrapfst.pyx":4290
* Returns a string indicating the arc type.
* """
* return self._reader.get().ArcType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
- __PYX_ERR(0, 4352, __pyx_L1_error)
+ __PYX_ERR(0, 4290, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":4346
+ /* "pywrapfst.pyx":4284
* 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, 4346, __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, 4284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4354
+/* "pywrapfst.pyx":4292
* 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, 4354, __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, 4292, __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, 4354, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4292, __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, 4354, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4292, __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, 4354, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4292, __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":4363
+ /* "pywrapfst.pyx":4301
* 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, 4363, __pyx_L1_error)
+ __PYX_ERR(0, 4301, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":4354
+ /* "pywrapfst.pyx":4292
* 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, 4354, __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, 4292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4365
+/* "pywrapfst.pyx":4303
* 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, 4365, __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, 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_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, 4365, __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, 4365, __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_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4365, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && 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":4374
+ /* "pywrapfst.pyx":4312
* 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, 4374, __pyx_L1_error)
+ __PYX_ERR(0, 4312, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->Error();
goto __pyx_L0;
- /* "pywrapfst.pyx":4365
+ /* "pywrapfst.pyx":4303
* 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, 4365, __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, 4303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4376
+/* "pywrapfst.pyx":4314
* 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, 4376, __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, 4314, __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, 4376, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4314, __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, 4376, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4314, __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, 4376, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4314, __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":4377
+ /* "pywrapfst.pyx":4315
*
* 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, 4377, __pyx_L1_error)
+ __PYX_ERR(0, 4315, __pyx_L1_error)
}
__pyx_r = fst::GetFarTypeString(__pyx_v_self->_reader.get()->Type());
goto __pyx_L0;
- /* "pywrapfst.pyx":4376
+ /* "pywrapfst.pyx":4314
* 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, 4376, __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, 4314, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4379
+/* "pywrapfst.pyx":4317
* 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, 4379, __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, 4317, __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, 4379, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4317, __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, 4379, __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, 4317, __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, 4379, __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, 4317, __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, 4379, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4317, __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, 4379, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4317, __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, 4379, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4317, __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":4392
+ /* "pywrapfst.pyx":4330
* 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, 4392, __pyx_L1_error)
+ __PYX_ERR(0, 4330, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4392, __pyx_L1_error)
+ __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4330, __pyx_L1_error)
__pyx_r = __pyx_v_self->_reader.get()->Find(__pyx_t_7);
goto __pyx_L0;
- /* "pywrapfst.pyx":4379
+ /* "pywrapfst.pyx":4317
* 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, 4379, __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, 4317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4394
+/* "pywrapfst.pyx":4332
* 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, 4394, __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, 4332, __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, 4394, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4332, __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, 4394, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4332, __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, 4394, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 4332, __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":4403
+ /* "pywrapfst.pyx":4341
* A copy of the FST at the current position.
* """
* return _init_XFst(new fst.FstClass( # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "pywrapfst.pyx":4404
+ /* "pywrapfst.pyx":4342
* """
* return _init_XFst(new fst.FstClass(
* deref(self._reader.get().GetFstClass()))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
- __PYX_ERR(0, 4404, __pyx_L1_error)
+ __PYX_ERR(0, 4342, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4403
+ /* "pywrapfst.pyx":4341
* A copy of the FST at the current position.
* """
* return _init_XFst(new fst.FstClass( # <<<<<<<<<<<<<<
* deref(self._reader.get().GetFstClass())))
*
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(new fst::script::FstClass((*__pyx_v_self->_reader.get()->GetFstClass())))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4403, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(new fst::script::FstClass((*__pyx_v_self->_reader.get()->GetFstClass())))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4341, __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":4394
+ /* "pywrapfst.pyx":4332
* 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, 4394, __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, 4332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4406
+/* "pywrapfst.pyx":4344
* deref(self._reader.get().GetFstClass())))
*
* 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, 4406, __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, 4344, __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, 4406, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4344, __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, 4406, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4344, __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, 4406, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4344, __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":4415
+ /* "pywrapfst.pyx":4353
* 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, 4415, __pyx_L1_error)
+ __PYX_ERR(0, 4353, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->GetKey();
goto __pyx_L0;
- /* "pywrapfst.pyx":4406
+ /* "pywrapfst.pyx":4344
* deref(self._reader.get().GetFstClass())))
*
* cpdef string get_key(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("get_key", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_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, 4406, __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, 4344, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4417
+/* "pywrapfst.pyx":4355
* 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, 4417, __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, 4355, __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, 4417, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4355, __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, 4417, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4355, __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":4423
+ /* "pywrapfst.pyx":4361
* Advances the iterator.
* """
* 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, 4423, __pyx_L1_error)
+ __PYX_ERR(0, 4361, __pyx_L1_error)
}
__pyx_v_self->_reader.get()->Next();
- /* "pywrapfst.pyx":4417
+ /* "pywrapfst.pyx":4355
* 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, 4417, __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, 4355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4425
+/* "pywrapfst.pyx":4363
* 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, 4425, __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, 4363, __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, 4425, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4363, __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, 4425, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4363, __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":4431
+ /* "pywrapfst.pyx":4369
* Resets the iterator to the initial position.
* """
* self._reader.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
- __PYX_ERR(0, 4431, __pyx_L1_error)
+ __PYX_ERR(0, 4369, __pyx_L1_error)
}
__pyx_v_self->_reader.get()->Reset();
- /* "pywrapfst.pyx":4425
+ /* "pywrapfst.pyx":4363
* 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, 4425, __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, 4363, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4434
+/* "pywrapfst.pyx":4372
*
* # Dictionary-like access by combining `find` and `get_fst`.
* def __getitem__(self, key): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "pywrapfst.pyx":4435
+ /* "pywrapfst.pyx":4373
* # 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, 4435, __pyx_L1_error)
+ __PYX_ERR(0, 4373, __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":4436
+ /* "pywrapfst.pyx":4374
* 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, 4436, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4374, __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, 4436, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4374, __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, 4436, __pyx_L1_error)
+ __PYX_ERR(0, 4374, __pyx_L1_error)
- /* "pywrapfst.pyx":4435
+ /* "pywrapfst.pyx":4373
* # Dictionary-like access by combining `find` and `get_fst`.
* def __getitem__(self, key):
* if not self.find(key): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4437
+ /* "pywrapfst.pyx":4375
* 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, 4437, __pyx_L1_error)
+ __PYX_ERR(0, 4375, __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, 4437, __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, 4375, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4434
+ /* "pywrapfst.pyx":4372
*
* # Dictionary-like access by combining `find` and `get_fst`.
* def __getitem__(self, key): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4460
+/* "pywrapfst.pyx":4398
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":4461
+ /* "pywrapfst.pyx":4399
*
* 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, 4461, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4462
+ /* "pywrapfst.pyx":4400
* 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, 4462, __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, 4400, __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, 4462, __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, 4400, __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, 4462, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4400, __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, 4462, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4400, __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, 4462, __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, 4400, __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, 4462, __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, 4400, __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, 4462, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4400, __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, 4462, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4400, __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, 4461, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4399, __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, 4461, __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, 4399, __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, 4461, __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, 4399, __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, 4461, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4399, __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, 4461, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4399, __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, 4461, __pyx_L1_error)
+ __PYX_ERR(0, 4399, __pyx_L1_error)
- /* "pywrapfst.pyx":4460
+ /* "pywrapfst.pyx":4398
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4464
+/* "pywrapfst.pyx":4402
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __repr__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":4465
+ /* "pywrapfst.pyx":4403
*
* 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, 4465, __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, 4403, __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, 4465, __pyx_L1_error)
+ __PYX_ERR(0, 4403, __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, 4465, __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, 4403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4465, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4403, __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, 4465, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4403, __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, 4465, __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, 4403, __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, 4465, __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, 4403, __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, 4465, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4403, __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, 4465, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4403, __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":4464
+ /* "pywrapfst.pyx":4402
* "Cannot construct {}".format(self.__class__.__name__))
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4468
+/* "pywrapfst.pyx":4406
*
* @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, 4468, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 4406, __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, 4468, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4406, __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":4489
+ /* "pywrapfst.pyx":4427
* 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, 4489, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_far_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4427, __pyx_L1_error)
__pyx_v_ft = fst::script::GetFarType(__pyx_t_1);
- /* "pywrapfst.pyx":4491
+ /* "pywrapfst.pyx":4429
* 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, 4491, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4491, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4429, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4429, __pyx_L1_error)
- /* "pywrapfst.pyx":4490
+ /* "pywrapfst.pyx":4428
* """
* 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":4492
+ /* "pywrapfst.pyx":4430
* 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":4493
+ /* "pywrapfst.pyx":4431
* 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, 4493, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4431, __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, 4493, __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, 4431, __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, 4493, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_filename); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4431, __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, 4493, __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, 4431, __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, 4493, __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, 4431, __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, 4493, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4431, __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, 4493, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4431, __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, 4493, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4431, __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, 4493, __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, 4431, __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, 4493, __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, 4431, __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, 4493, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4431, __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, 4493, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4431, __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, 4493, __pyx_L1_error)
+ __PYX_ERR(0, 4431, __pyx_L1_error)
- /* "pywrapfst.pyx":4492
+ /* "pywrapfst.pyx":4430
* cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
* tostring(filename), tostring(arc_type), ft)
* if tfar == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4494
+ /* "pywrapfst.pyx":4432
* 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, 4494, __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, 4432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst_FarWriter)))) __PYX_ERR(0, 4494, __pyx_L1_error)
+ if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst_FarWriter)))) __PYX_ERR(0, 4432, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "pywrapfst.pyx":4495
+ /* "pywrapfst.pyx":4433
* 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, 4495, __pyx_L1_error)
+ __PYX_ERR(0, 4433, __pyx_L1_error)
}
__pyx_v_result->_writer.reset(__pyx_v_tfar);
- /* "pywrapfst.pyx":4496
+ /* "pywrapfst.pyx":4434
* cdef FarWriter result = FarWriter.__new__(FarWriter)
* result._writer.reset(tfar)
* return result # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "pywrapfst.pyx":4468
+ /* "pywrapfst.pyx":4406
*
* @classmethod
* def create(cls, filename, arc_type=b"standard", far_type=b"default"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4500
+/* "pywrapfst.pyx":4438
* # 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":4501
+ /* "pywrapfst.pyx":4439
* # 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, 4501, __pyx_L1_error)
+ __PYX_ERR(0, 4439, __pyx_L1_error)
}
__pyx_v_self->_writer.reset();
- /* "pywrapfst.pyx":4500
+ /* "pywrapfst.pyx":4438
* # 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":4503
+/* "pywrapfst.pyx":4441
* 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, 4503, __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, 4441, __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, 4503, __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, 4441, __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, 4503, __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, 4441, __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, 4503, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4441, __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, 4503, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4441, __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":4522
+ /* "pywrapfst.pyx":4460
* # 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, 4522, __pyx_L1_error)
+ __PYX_ERR(0, 4460, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4522, __pyx_L1_error)
+ __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4460, __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, 4522, __pyx_L1_error)
+ __PYX_ERR(0, 4460, __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":4523
+ /* "pywrapfst.pyx":4461
* # 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, 4523, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4523, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4461, __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, 4523, __pyx_L1_error)
+ __PYX_ERR(0, 4461, __pyx_L1_error)
- /* "pywrapfst.pyx":4522
+ /* "pywrapfst.pyx":4460
* # 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":4525
+ /* "pywrapfst.pyx":4463
* 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, 4525, __pyx_L1_error)
+ __PYX_ERR(0, 4463, __pyx_L1_error)
}
__pyx_t_8 = (__pyx_v_self->_writer.get()->Error() != 0);
if (__pyx_t_8) {
- /* "pywrapfst.pyx":4526
+ /* "pywrapfst.pyx":4464
* # 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, 4526, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4526, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4464, __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, 4526, __pyx_L1_error)
+ __PYX_ERR(0, 4464, __pyx_L1_error)
- /* "pywrapfst.pyx":4525
+ /* "pywrapfst.pyx":4463
* raise FstOpError("Incompatible or invalid arc type")
* # An error here usually indicates a key out of order.
* if self._writer.get().Error(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4503
+ /* "pywrapfst.pyx":4441
* 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, 4503, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 4441, __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, 4503, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 4441, __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, 4503, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4441, __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, 4503, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4441, __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, 4503, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4503, __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, 4441, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4441, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4528
+/* "pywrapfst.pyx":4466
* 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, 4528, __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, 4466, __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, 4528, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4466, __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, 4528, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4466, __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, 4528, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4466, __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":4534
+ /* "pywrapfst.pyx":4472
* Returns a string indicating the arc type.
* """
* return self._writer.get().ArcType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_writer");
- __PYX_ERR(0, 4534, __pyx_L1_error)
+ __PYX_ERR(0, 4472, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_writer.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":4528
+ /* "pywrapfst.pyx":4466
* 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, 4528, __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, 4466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4536
+/* "pywrapfst.pyx":4474
* 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, 4536, __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, 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_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, 4536, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4474, __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, 4536, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4474, __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, 4536, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4474, __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":4545
+ /* "pywrapfst.pyx":4483
* 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, 4545, __pyx_L1_error)
+ __PYX_ERR(0, 4483, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_writer.get()->Error();
goto __pyx_L0;
- /* "pywrapfst.pyx":4536
+ /* "pywrapfst.pyx":4474
* 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, 4536, __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, 4474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4547
+/* "pywrapfst.pyx":4485
* 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, 4547, __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, 4485, __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, 4547, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4485, __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, 4547, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4485, __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, 4547, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4485, __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":4553
+ /* "pywrapfst.pyx":4491
* Returns a string indicating the FAR type.
* """
* return fst.GetFarTypeString(self._writer.get().Type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_writer");
- __PYX_ERR(0, 4553, __pyx_L1_error)
+ __PYX_ERR(0, 4491, __pyx_L1_error)
}
__pyx_r = fst::GetFarTypeString(__pyx_v_self->_writer.get()->Type());
goto __pyx_L0;
- /* "pywrapfst.pyx":4547
+ /* "pywrapfst.pyx":4485
* 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, 4547, __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, 4485, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4556
+/* "pywrapfst.pyx":4494
*
* # 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, 4556, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst), __pyx_ptype_9pywrapfst__Fst, 1, "fst", 0))) __PYX_ERR(0, 4494, __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":4557
+ /* "pywrapfst.pyx":4495
* # 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, 4557, __pyx_L1_error)
+ __PYX_ERR(0, 4495, __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, 4557, __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, 4495, __pyx_L1_error)
- /* "pywrapfst.pyx":4556
+ /* "pywrapfst.pyx":4494
*
* # Dictionary-like assignment.
* def __setitem__(self, key, _Fst fst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4572
+/* "pywrapfst.pyx":4510
*
* @atexit.register
* def _reset_fst_error_fatal(): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_57_reset_fst_error_fatal(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyMethodDef __pyx_mdef_9pywrapfst_57_reset_fst_error_fatal = {"_reset_fst_error_fatal", (PyCFunction)__pyx_pw_9pywrapfst_57_reset_fst_error_fatal, METH_NOARGS, 0};
-static PyObject *__pyx_pw_9pywrapfst_57_reset_fst_error_fatal(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_55_reset_fst_error_fatal(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_9pywrapfst_55_reset_fst_error_fatal = {"_reset_fst_error_fatal", (PyCFunction)__pyx_pw_9pywrapfst_55_reset_fst_error_fatal, METH_NOARGS, 0};
+static PyObject *__pyx_pw_9pywrapfst_55_reset_fst_error_fatal(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_reset_fst_error_fatal (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_56_reset_fst_error_fatal(__pyx_self);
+ __pyx_r = __pyx_pf_9pywrapfst_54_reset_fst_error_fatal(__pyx_self);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_56_reset_fst_error_fatal(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_pf_9pywrapfst_54_reset_fst_error_fatal(CYTHON_UNUSED PyObject *__pyx_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
bool __pyx_t_2;
__Pyx_RefNannySetupContext("_reset_fst_error_fatal", 0);
- /* "pywrapfst.pyx":4573
+ /* "pywrapfst.pyx":4511
* @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, 4573, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_fst_error_fatal_old); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4511, __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, 4573, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4511, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
FLAGS_fst_error_fatal = __pyx_t_2;
- /* "pywrapfst.pyx":4572
+ /* "pywrapfst.pyx":4510
*
* @atexit.register
* def _reset_fst_error_fatal(): # <<<<<<<<<<<<<<
{"randgen", (PyCFunction)__pyx_pw_9pywrapfst_41randgen, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_40randgen},
{"replace", (PyCFunction)__pyx_pw_9pywrapfst_43replace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_42replace},
{"reverse", (PyCFunction)__pyx_pw_9pywrapfst_45reverse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_44reverse},
- {"rmepsilon", (PyCFunction)__pyx_pw_9pywrapfst_47rmepsilon, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_46rmepsilon},
- {"shortestpath", (PyCFunction)__pyx_pw_9pywrapfst_51shortestpath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_50shortestpath},
- {"statemap", (PyCFunction)__pyx_pw_9pywrapfst_53statemap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_52statemap},
- {"synchronize", (PyCFunction)__pyx_pw_9pywrapfst_55synchronize, METH_O, __pyx_doc_9pywrapfst_54synchronize},
+ {"shortestpath", (PyCFunction)__pyx_pw_9pywrapfst_49shortestpath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_48shortestpath},
+ {"statemap", (PyCFunction)__pyx_pw_9pywrapfst_51statemap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_50statemap},
+ {"synchronize", (PyCFunction)__pyx_pw_9pywrapfst_53synchronize, METH_O, __pyx_doc_9pywrapfst_52synchronize},
{0, 0, 0, 0}
};
{&__pyx_n_s_EXPANDED, __pyx_k_EXPANDED, sizeof(__pyx_k_EXPANDED), 0, 0, 1, 1},
{&__pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_k_EXTRINSIC_PROPERTIES, sizeof(__pyx_k_EXTRINSIC_PROPERTIES), 0, 0, 1, 1},
{&__pyx_kp_s_EncodeMapper_at_0x_x, __pyx_k_EncodeMapper_at_0x_x, sizeof(__pyx_k_EncodeMapper_at_0x_x), 0, 0, 1, 0},
- {&__pyx_kp_s_Equivalence_test_encountered_err, __pyx_k_Equivalence_test_encountered_err, sizeof(__pyx_k_Equivalence_test_encountered_err), 0, 0, 1, 0},
{&__pyx_n_s_FST_PROPERTIES, __pyx_k_FST_PROPERTIES, sizeof(__pyx_k_FST_PROPERTIES), 0, 0, 1, 1},
{&__pyx_kp_s_FarReader_at_0x_x, __pyx_k_FarReader_at_0x_x, sizeof(__pyx_k_FarReader_at_0x_x), 0, 0, 1, 0},
{&__pyx_kp_s_FarWriter_at_0x_x, __pyx_k_FarWriter_at_0x_x, sizeof(__pyx_k_FarWriter_at_0x_x), 0, 0, 1, 0},
{&__pyx_n_s_NO_LABEL, __pyx_k_NO_LABEL, sizeof(__pyx_k_NO_LABEL), 0, 0, 1, 1},
{&__pyx_n_s_NO_O_EPSILONS, __pyx_k_NO_O_EPSILONS, sizeof(__pyx_k_NO_O_EPSILONS), 0, 0, 1, 1},
{&__pyx_n_s_NO_STATE_ID, __pyx_k_NO_STATE_ID, sizeof(__pyx_k_NO_STATE_ID), 0, 0, 1, 1},
+ {&__pyx_n_s_NO_SYMBOL, __pyx_k_NO_SYMBOL, sizeof(__pyx_k_NO_SYMBOL), 0, 0, 1, 1},
{&__pyx_n_s_NULL_PROPERTIES, __pyx_k_NULL_PROPERTIES, sizeof(__pyx_k_NULL_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_NoWeight, __pyx_k_NoWeight, sizeof(__pyx_k_NoWeight), 0, 0, 1, 1},
{&__pyx_kp_s_No_new_SymbolTables_specified, __pyx_k_No_new_SymbolTables_specified, sizeof(__pyx_k_No_new_SymbolTables_specified), 0, 0, 1, 0},
{&__pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_k_POS_TRINARY_PROPERTIES, sizeof(__pyx_k_POS_TRINARY_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_Popen, __pyx_k_Popen, sizeof(__pyx_k_Popen), 0, 0, 1, 1},
{&__pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_k_RM_SUPERFINAL_PROPERTIES, sizeof(__pyx_k_RM_SUPERFINAL_PROPERTIES), 0, 0, 1, 1},
- {&__pyx_kp_s_Random_equivalence_test_encounte, __pyx_k_Random_equivalence_test_encounte, sizeof(__pyx_k_Random_equivalence_test_encounte), 0, 0, 1, 0},
{&__pyx_kp_s_Read_failed_r, __pyx_k_Read_failed_r, sizeof(__pyx_k_Read_failed_r), 0, 0, 1, 0},
{&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
{&__pyx_n_s_SET_ARC_PROPERTIES, __pyx_k_SET_ARC_PROPERTIES, sizeof(__pyx_k_SET_ARC_PROPERTIES), 0, 0, 1, 1},
{&__pyx_kp_s_Weight_type_not_found, __pyx_k_Weight_type_not_found, sizeof(__pyx_k_Weight_type_not_found), 0, 0, 1, 0},
{&__pyx_kp_s_Write_failed_r, __pyx_k_Write_failed_r, sizeof(__pyx_k_Write_failed_r), 0, 0, 1, 0},
{&__pyx_n_s_Zero, __pyx_k_Zero, sizeof(__pyx_k_Zero), 0, 0, 1, 1},
- {&__pyx_kp_b__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 0, 0},
+ {&__pyx_kp_b__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 0, 0},
{&__pyx_n_s_acceptor, __pyx_k_acceptor, sizeof(__pyx_k_acceptor), 0, 0, 1, 1},
{&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
{&__pyx_n_s_add_state, __pyx_k_add_state, sizeof(__pyx_k_add_state), 0, 0, 1, 1},
{&__pyx_n_s_input_table, __pyx_k_input_table, sizeof(__pyx_k_input_table), 0, 0, 1, 1},
{&__pyx_n_s_ipairs, __pyx_k_ipairs, sizeof(__pyx_k_ipairs), 0, 0, 1, 1},
{&__pyx_n_s_isymbols, __pyx_k_isymbols, sizeof(__pyx_k_isymbols), 0, 0, 1, 1},
- {&__pyx_n_s_it, __pyx_k_it, sizeof(__pyx_k_it), 0, 0, 1, 1},
+ {&__pyx_n_s_kNoSymbol, __pyx_k_kNoSymbol, sizeof(__pyx_k_kNoSymbol), 0, 0, 1, 1},
{&__pyx_n_s_keep_isymbols, __pyx_k_keep_isymbols, sizeof(__pyx_k_keep_isymbols), 0, 0, 1, 1},
{&__pyx_n_s_keep_osymbols, __pyx_k_keep_osymbols, sizeof(__pyx_k_keep_osymbols), 0, 0, 1, 1},
{&__pyx_n_s_keep_state_numbering, __pyx_k_keep_state_numbering, sizeof(__pyx_k_keep_state_numbering), 0, 0, 1, 1},
{&__pyx_n_s_push_weights, __pyx_k_push_weights, sizeof(__pyx_k_push_weights), 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_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 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_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},
{0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 121, __pyx_L1_error)
- __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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 126, __pyx_L1_error)
+ __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 136, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 141, __pyx_L1_error)
+ __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 146, __pyx_L1_error)
__pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 2749, __pyx_L1_error)
__pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 2769, __pyx_L1_error)
- __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 365, __pyx_L1_error)
- __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 435, __pyx_L1_error)
- __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 741, __pyx_L1_error)
- __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 1156, __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, 440, __pyx_L1_error)
+ __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 1149, __pyx_L1_error)
+ __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 4374, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "pywrapfst.pyx":383
+ /* "pywrapfst.pyx":388
* cdef void _check_weight(self) except *:
* if self.type() == b"none":
* raise FstArgError("Weight type not found") # <<<<<<<<<<<<<<
* if self.to_string() == b"BadNumber":
* raise FstBadWeightError("Invalid weight")
*/
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Weight_type_not_found); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 383, __pyx_L1_error)
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Weight_type_not_found); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
- /* "pywrapfst.pyx":385
+ /* "pywrapfst.pyx":390
* raise FstArgError("Weight type not found")
* if self.to_string() == b"BadNumber":
* raise FstBadWeightError("Invalid weight") # <<<<<<<<<<<<<<
*
* cpdef Weight copy(self):
*/
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Invalid_weight); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 385, __pyx_L1_error)
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Invalid_weight); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
- /* "pywrapfst.pyx":637
+ /* "pywrapfst.pyx":642
* tostring(weight_type))))
* if result._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Weight_type_not_found); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 637, __pyx_L1_error)
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Weight_type_not_found); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 642, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "pywrapfst.pyx":646
+ /* "pywrapfst.pyx":651
* fst.WeightClass.One(tostring(weight_type))))
* if result._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Weight_type_not_found); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 646, __pyx_L1_error)
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Weight_type_not_found); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "pywrapfst.pyx":1411
+ /* "pywrapfst.pyx":1404
* 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__6 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1411, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__6);
- __Pyx_GIVEREF(__pyx_tuple__6);
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1404, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
- /* "pywrapfst.pyx":1586
+ /* "pywrapfst.pyx":1579
* cdef size_t result = self._fst.get().NumArcs(state)
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1586, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__7);
- __Pyx_GIVEREF(__pyx_tuple__7);
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1579, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
- /* "pywrapfst.pyx":1608
+ /* "pywrapfst.pyx":1601
* cdef size_t result = self._fst.get().NumInputEpsilons(state)
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1608, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__8);
- __Pyx_GIVEREF(__pyx_tuple__8);
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1601, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
- /* "pywrapfst.pyx":1630
+ /* "pywrapfst.pyx":1623
* cdef size_t result = self._fst.get().NumOutputEpsilons(state)
* if result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1630, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__9);
- __Pyx_GIVEREF(__pyx_tuple__9);
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1623, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
- /* "pywrapfst.pyx":1794
+ /* "pywrapfst.pyx":1787
* """
* 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__10 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1794, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__10);
- __Pyx_GIVEREF(__pyx_tuple__10);
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 1787, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__11);
+ __Pyx_GIVEREF(__pyx_tuple__11);
- /* "pywrapfst.pyx":1798
+ /* "pywrapfst.pyx":1791
* 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__11 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 1798, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__11);
- __Pyx_GIVEREF(__pyx_tuple__11);
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1791, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_GIVEREF(__pyx_tuple__12);
- /* "pywrapfst.pyx":1800
+ /* "pywrapfst.pyx":1793
* 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__12 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight_t); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1800, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__12);
- __Pyx_GIVEREF(__pyx_tuple__12);
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight_t); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 1793, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__13);
+ __Pyx_GIVEREF(__pyx_tuple__13);
- /* "pywrapfst.pyx":1965
+ /* "pywrapfst.pyx":1958
* 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__13 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 1965, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__13);
- __Pyx_GIVEREF(__pyx_tuple__13);
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1958, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__14);
+ __Pyx_GIVEREF(__pyx_tuple__14);
- /* "pywrapfst.pyx":1995
+ /* "pywrapfst.pyx":1988
* 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__14 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1995, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__14);
- __Pyx_GIVEREF(__pyx_tuple__14);
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1988, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__15);
+ __Pyx_GIVEREF(__pyx_tuple__15);
- /* "pywrapfst.pyx":2264
+ /* "pywrapfst.pyx":2257
* _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__23 = PyTuple_Pack(1, __pyx_kp_s_No_relabeling_pairs_specified); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 2264, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__23);
- __Pyx_GIVEREF(__pyx_tuple__23);
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_No_relabeling_pairs_specified); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 2257, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
- /* "pywrapfst.pyx":2303
+ /* "pywrapfst.pyx":2296
* 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__24 = PyTuple_Pack(1, __pyx_kp_s_No_new_SymbolTables_specified); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 2303, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__24);
- __Pyx_GIVEREF(__pyx_tuple__24);
+ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_No_new_SymbolTables_specified); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 2296, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_GIVEREF(__pyx_tuple__25);
- /* "pywrapfst.pyx":2371
+ /* "pywrapfst.pyx":2364
* 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__25 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 2371, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__25);
- __Pyx_GIVEREF(__pyx_tuple__25);
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 2364, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__26);
+ __Pyx_GIVEREF(__pyx_tuple__26);
- /* "pywrapfst.pyx":2494
+ /* "pywrapfst.pyx":2491
* 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__30 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 2494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__30);
- __Pyx_GIVEREF(__pyx_tuple__30);
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2491, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__31);
+ __Pyx_GIVEREF(__pyx_tuple__31);
- /* "pywrapfst.pyx":2498
+ /* "pywrapfst.pyx":2495
* weight)
* if not self._mfst.get().SetFinal(state, wc):
* raise FstOpError("Incompatible or invalid weight") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2498, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__31);
- __Pyx_GIVEREF(__pyx_tuple__31);
+ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2495, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__32);
+ __Pyx_GIVEREF(__pyx_tuple__32);
/* "pywrapfst.pyx":2595
* cdef void _set_start(self, int64 state) except *:
* self._check_mutating_imethod()
*
*/
- __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2595, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__32);
- __Pyx_GIVEREF(__pyx_tuple__32);
+ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 2595, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__33);
+ __Pyx_GIVEREF(__pyx_tuple__33);
/* "pywrapfst.pyx":2621
* # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
* self._check_mutating_imethod()
*
*/
- __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Cannot_topsort_cyclic_FST); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 2621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__33);
- __Pyx_GIVEREF(__pyx_tuple__33);
+ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Cannot_topsort_cyclic_FST); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2621, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__34);
+ __Pyx_GIVEREF(__pyx_tuple__34);
/* "pywrapfst.pyx":2690
* cdef _Fst _init_Fst(FstClass_ptr tfst):
* cdef _Fst ofst = _Fst.__new__(_Fst)
* ofst._fst.reset(<FstClass_ptr> tfst)
*/
- __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2690, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__34);
- __Pyx_GIVEREF(__pyx_tuple__34);
+ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2690, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__35);
+ __Pyx_GIVEREF(__pyx_tuple__35);
/* "pywrapfst.pyx":2698
* cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
* cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
* ofst._fst.reset(<MutableFstClass_ptr> tfst)
*/
- __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2698, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__35);
- __Pyx_GIVEREF(__pyx_tuple__35);
+ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 2698, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__36);
+ __Pyx_GIVEREF(__pyx_tuple__36);
- /* "pywrapfst.pyx":2986
+ /* "pywrapfst.pyx":2991
* 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__36 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 2986, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__36);
- __Pyx_GIVEREF(__pyx_tuple__36);
+ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 2991, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__37);
+ __Pyx_GIVEREF(__pyx_tuple__37);
- /* "pywrapfst.pyx":3098
+ /* "pywrapfst.pyx":3103
* 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__37 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 3098, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__37);
- __Pyx_GIVEREF(__pyx_tuple__37);
-
- /* "pywrapfst.pyx":3600
- * addr(error))
- * if error:
- * raise FstOpError("Equivalence test encountered error") # <<<<<<<<<<<<<<
- * return result
- *
- */
- __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_Equivalence_test_encountered_err); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 3600, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__46);
- __Pyx_GIVEREF(__pyx_tuple__46);
-
- /* "pywrapfst.pyx":3800
- * addr(error))
- * if error:
- * raise FstOpError("Random equivalence test encountered error") # <<<<<<<<<<<<<<
- * return result
- *
- */
- __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_Random_equivalence_test_encounte); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 3800, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__53);
- __Pyx_GIVEREF(__pyx_tuple__53);
+ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 3103, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__38);
+ __Pyx_GIVEREF(__pyx_tuple__38);
- /* "pywrapfst.pyx":4257
+ /* "pywrapfst.pyx":4195
* self._sstrm.reset(new stringstream())
* if tfst.get() == NULL:
* raise FstOpError("Compilation failed") # <<<<<<<<<<<<<<
* return _init_XFst(tfst.release())
*
*/
- __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_Compilation_failed); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 4257, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__65);
- __Pyx_GIVEREF(__pyx_tuple__65);
+ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_Compilation_failed); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 4195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__62);
+ __Pyx_GIVEREF(__pyx_tuple__62);
- /* "pywrapfst.pyx":4523
+ /* "pywrapfst.pyx":4461
* # 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__66 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_arc_type); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 4523, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__66);
- __Pyx_GIVEREF(__pyx_tuple__66);
+ __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_arc_type); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 4461, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__63);
+ __Pyx_GIVEREF(__pyx_tuple__63);
- /* "pywrapfst.pyx":4526
+ /* "pywrapfst.pyx":4464
* # 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__67 = PyTuple_Pack(1, __pyx_kp_s_Key_out_of_order); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 4526, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__67);
- __Pyx_GIVEREF(__pyx_tuple__67);
+ __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_Key_out_of_order); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 4464, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__64);
+ __Pyx_GIVEREF(__pyx_tuple__64);
- /* "pywrapfst.pyx":455
+ /* "pywrapfst.pyx":460
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* plus(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, 455, __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_plus, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 455, __pyx_L1_error)
+ __pyx_tuple__65 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 460, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__65);
+ __Pyx_GIVEREF(__pyx_tuple__65);
+ __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_plus, 460, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 460, __pyx_L1_error)
- /* "pywrapfst.pyx":487
+ /* "pywrapfst.pyx":492
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* times(lhs, rhs)
*/
- __pyx_tuple__70 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 487, __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_times, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 487, __pyx_L1_error)
+ __pyx_tuple__67 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 492, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__67);
+ __Pyx_GIVEREF(__pyx_tuple__67);
+ __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_times, 492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 492, __pyx_L1_error)
- /* "pywrapfst.pyx":519
+ /* "pywrapfst.pyx":524
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* divide(lhs, rhs)
*/
- __pyx_tuple__72 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 519, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__72);
- __Pyx_GIVEREF(__pyx_tuple__72);
- __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 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_divide, 519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 519, __pyx_L1_error)
+ __pyx_tuple__69 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 524, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__69);
+ __Pyx_GIVEREF(__pyx_tuple__69);
+ __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_divide, 524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 524, __pyx_L1_error)
- /* "pywrapfst.pyx":552
+ /* "pywrapfst.pyx":557
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
* """
* power(lhs, rhs)
*/
- __pyx_tuple__74 = PyTuple_Pack(3, __pyx_n_s_w, __pyx_n_s_n, __pyx_n_s_result); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 552, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__74);
- __Pyx_GIVEREF(__pyx_tuple__74);
- __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_power, 552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 552, __pyx_L1_error)
+ __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_w, __pyx_n_s_n, __pyx_n_s_result); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 557, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__71);
+ __Pyx_GIVEREF(__pyx_tuple__71);
+ __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_power, 557, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 557, __pyx_L1_error)
/* "pywrapfst.pyx":2766
* """
* return _create_Fst(arc_type)
*
*/
- __pyx_tuple__76 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_arc_type); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 2766, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__76);
- __Pyx_GIVEREF(__pyx_tuple__76);
- __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_new, 2766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 2766, __pyx_L1_error)
- __pyx_tuple__78 = PyTuple_Pack(1, ((PyObject*)__pyx_n_b_standard)); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 2766, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__78);
- __Pyx_GIVEREF(__pyx_tuple__78);
+ __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_arc_type); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 2766, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__73);
+ __Pyx_GIVEREF(__pyx_tuple__73);
+ __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_new, 2766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 2766, __pyx_L1_error)
+ __pyx_tuple__75 = PyTuple_Pack(1, ((PyObject*)__pyx_n_b_standard)); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 2766, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__75);
+ __Pyx_GIVEREF(__pyx_tuple__75);
/* "pywrapfst.pyx":2770
*
* """
* read(filename, fst_type=None)
*/
- __pyx_tuple__79 = PyTuple_Pack(2, __pyx_n_s_filename, __pyx_n_s_fst_type); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 2770, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__79);
- __Pyx_GIVEREF(__pyx_tuple__79);
- __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_read, 2770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 2770, __pyx_L1_error)
- __pyx_tuple__81 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 2770, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__81);
- __Pyx_GIVEREF(__pyx_tuple__81);
+ __pyx_tuple__76 = PyTuple_Pack(2, __pyx_n_s_filename, __pyx_n_s_fst_type); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 2770, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__76);
+ __Pyx_GIVEREF(__pyx_tuple__76);
+ __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_read, 2770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 2770, __pyx_L1_error)
+ __pyx_tuple__78 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 2770, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__78);
+ __Pyx_GIVEREF(__pyx_tuple__78);
/* "pywrapfst.pyx":2791
*
* """
* read_from_string(fst_string, fst_type=None)
*/
- __pyx_tuple__82 = PyTuple_Pack(2, __pyx_n_s_fst_string, __pyx_n_s_fst_type); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 2791, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__82);
- __Pyx_GIVEREF(__pyx_tuple__82);
- __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_read_from_string, 2791, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 2791, __pyx_L1_error)
- __pyx_tuple__84 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 2791, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__84);
- __Pyx_GIVEREF(__pyx_tuple__84);
+ __pyx_tuple__79 = PyTuple_Pack(2, __pyx_n_s_fst_string, __pyx_n_s_fst_type); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 2791, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__79);
+ __Pyx_GIVEREF(__pyx_tuple__79);
+ __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_read_from_string, 2791, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 2791, __pyx_L1_error)
+ __pyx_tuple__81 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 2791, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__81);
+ __Pyx_GIVEREF(__pyx_tuple__81);
- /* "pywrapfst.pyx":4005
+ /* "pywrapfst.pyx":3954
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_tuple__85 = 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__85)) __PYX_ERR(0, 4005, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__85);
- __Pyx_GIVEREF(__pyx_tuple__85);
- __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_shortestdistance, 4005, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 4005, __pyx_L1_error)
+ __pyx_tuple__82 = PyTuple_Pack(8, __pyx_n_s_ifst, __pyx_n_s_delta, __pyx_n_s_nstate, __pyx_n_s_queue_type, __pyx_n_s_reverse, __pyx_n_s_distance, __pyx_n_s_weight_type, __pyx_n_s_weight); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 3954, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__82);
+ __Pyx_GIVEREF(__pyx_tuple__82);
+ __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_shortestdistance, 3954, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 3954, __pyx_L1_error)
- /* "pywrapfst.pyx":4572
+ /* "pywrapfst.pyx":4510
*
* @atexit.register
* def _reset_fst_error_fatal(): # <<<<<<<<<<<<<<
* fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
*
*/
- __pyx_codeobj__87 = (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, 4572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 4572, __pyx_L1_error)
+ __pyx_codeobj__84 = (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, 4510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 4510, __pyx_L1_error)
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
static int __Pyx_InitGlobals(void) {
if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
__pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global init code ---*/
/*--- Variable export code ---*/
+ if (__Pyx_ExportVoidPtr(__pyx_n_s_kNoSymbol, (void *)&__pyx_v_9pywrapfst_kNoSymbol, "__pyx_t_10basictypes_int64") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Function export code ---*/
if (__Pyx_ExportFunction("tostring", (void (*)(void))__pyx_f_9pywrapfst_tostring, "std::string (PyObject *, struct __pyx_opt_args_9pywrapfst_tostring *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("weighttostring", (void (*)(void))__pyx_f_9pywrapfst_weighttostring, "std::string (PyObject *, struct __pyx_opt_args_9pywrapfst_weighttostring *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("randgen", (void (*)(void))__pyx_f_9pywrapfst_randgen, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_randgen *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("replace", (void (*)(void))__pyx_f_9pywrapfst_replace, "struct __pyx_obj_9pywrapfst__MutableFst *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_replace *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("reverse", (void (*)(void))__pyx_f_9pywrapfst_reverse, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_reverse *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- if (__Pyx_ExportFunction("rmepsilon", (void (*)(void))__pyx_f_9pywrapfst_rmepsilon, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_rmepsilon *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_shortestdistance", (void (*)(void))__pyx_f_9pywrapfst__shortestdistance, "std::vector<fst::script::WeightClass> *(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("shortestpath", (void (*)(void))__pyx_f_9pywrapfst_shortestpath, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_shortestpath *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("statemap", (void (*)(void))__pyx_f_9pywrapfst_statemap, "struct __pyx_obj_9pywrapfst__Fst *(struct __pyx_obj_9pywrapfst__Fst *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __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, 343, __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, 343, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "Weight", (PyObject *)&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 343, __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, 674, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 679, __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, 674, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_SymbolTable", (PyObject *)&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 674, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__SymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 679, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_SymbolTable", (PyObject *)&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 679, __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, 851, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 843, __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, 851, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_EncodeMapperSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 851, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__EncodeMapperSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 843, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_EncodeMapperSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 843, __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, 871, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 863, __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, 871, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_FstSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 871, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__FstSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 863, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_FstSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 863, __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, 890, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 882, __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, 890, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_MutableSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 890, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 882, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_MutableSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 882, __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, 941, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 934, __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, 941, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_MutableFstSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 941, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableFstSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 934, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_MutableFstSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 934, __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, 952, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 945, __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, 952, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "SymbolTable", (PyObject *)&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 952, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_SymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 945, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "SymbolTable", (PyObject *)&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 945, __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, 1135, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1128, __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, 1135, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "SymbolTableIterator", (PyObject *)&__pyx_type_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1135, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_SymbolTableIterator.tp_dict, __pyx_vtabptr_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1128, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "SymbolTableIterator", (PyObject *)&__pyx_type_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1128, __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, 1210, __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, 1210, __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, 1210, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "EncodeMapper", (PyObject *)&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1210, __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.write_to_string = (std::string (*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_write_to_string;
- if (PyType_Ready(&__pyx_type_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1373, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1366, __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, 1373, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_Fst", (PyObject *)&__pyx_type_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1373, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__Fst.tp_dict, __pyx_vtabptr_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1366, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_Fst", (PyObject *)&__pyx_type_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1366, __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, 1778, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1771, __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, 1778, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "_MutableFst", (PyObject *)&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1778, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableFst.tp_dict, __pyx_vtabptr_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1771, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "_MutableFst", (PyObject *)&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1771, __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, 2905, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2910, __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, 2905, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "Arc", (PyObject *)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2905, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Arc.tp_dict, __pyx_vtabptr_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2910, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "Arc", (PyObject *)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2910, __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, 2973, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2978, __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, 2973, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "ArcIterator", (PyObject *)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2973, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_ArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2978, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "ArcIterator", (PyObject *)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2978, __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, 3084, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3089, __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, 3084, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "MutableArcIterator", (PyObject *)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3084, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_MutableArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3089, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "MutableArcIterator", (PyObject *)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3089, __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, 3198, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3203, __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, 3198, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "StateIterator", (PyObject *)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3198, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_StateIterator.tp_dict, __pyx_vtabptr_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3203, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "StateIterator", (PyObject *)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3203, __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, 4155, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4093, __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, 4155, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "Compiler", (PyObject *)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4155, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Compiler.tp_dict, __pyx_vtabptr_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4093, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "Compiler", (PyObject *)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4093, __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, 4282, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4220, __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, 4282, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "FarReader", (PyObject *)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4282, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarReader.tp_dict, __pyx_vtabptr_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4220, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "FarReader", (PyObject *)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4220, __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, 4440, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4378, __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, 4440, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "FarWriter", (PyObject *)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4440, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarWriter.tp_dict, __pyx_vtabptr_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4378, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "FarWriter", (PyObject *)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4378, __pyx_L1_error)
__pyx_ptype_9pywrapfst_FarWriter = &__pyx_type_9pywrapfst_FarWriter;
/*--- Type import code ---*/
/*--- Variable import code ---*/
if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":116
+ /* "pywrapfst.pyx":115
+ * # TODO(kbg): Figure out how to access static class variables so I don't have
+ * # to do it this way.
+ * kNoSymbol = -1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_9pywrapfst_kNoSymbol = -1L;
+
+ /* "pywrapfst.pyx":121
*
*
* class FstError(Exception): # <<<<<<<<<<<<<<
*
* pass
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
__Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstError, __pyx_n_s_FstError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstError, __pyx_n_s_FstError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstError, __pyx_t_4) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstError, __pyx_t_4) < 0) __PYX_ERR(0, 121, __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_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":121
+ /* "pywrapfst.pyx":126
*
*
* class FstArgError(FstError, ValueError): # <<<<<<<<<<<<<<
*
* pass
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_builtin_ValueError);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_ValueError);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstArgError, __pyx_n_s_FstArgError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstArgError, __pyx_n_s_FstArgError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstArgError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstArgError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstArgError, __pyx_t_4) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstArgError, __pyx_t_4) < 0) __PYX_ERR(0, 126, __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":126
+ /* "pywrapfst.pyx":131
*
*
* class FstBadWeightError(FstError, ValueError): # <<<<<<<<<<<<<<
*
* pass
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_builtin_ValueError);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_ValueError);
__pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstBadWeightError, __pyx_n_s_FstBadWeightError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstBadWeightError, __pyx_n_s_FstBadWeightError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstBadWeightError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstBadWeightError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstBadWeightError, __pyx_t_4) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstBadWeightError, __pyx_t_4) < 0) __PYX_ERR(0, 131, __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_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":131
+ /* "pywrapfst.pyx":136
*
*
* class FstDeletedConstructorError(FstError, RuntimeError): # <<<<<<<<<<<<<<
*
* pass
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_builtin_RuntimeError);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_RuntimeError);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstDeletedConstructorError, __pyx_n_s_FstDeletedConstructorError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstDeletedConstructorError, __pyx_n_s_FstDeletedConstructorError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstDeletedConstructorError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstDeletedConstructorError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstDeletedConstructorError, __pyx_t_4) < 0) __PYX_ERR(0, 131, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstDeletedConstructorError, __pyx_t_4) < 0) __PYX_ERR(0, 136, __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":136
+ /* "pywrapfst.pyx":141
*
*
* class FstIndexError(FstError, IndexError): # <<<<<<<<<<<<<<
*
* pass
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_builtin_IndexError);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_IndexError);
__pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstIndexError, __pyx_n_s_FstIndexError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstIndexError, __pyx_n_s_FstIndexError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstIndexError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstIndexError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIndexError, __pyx_t_4) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIndexError, __pyx_t_4) < 0) __PYX_ERR(0, 141, __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_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":141
+ /* "pywrapfst.pyx":146
*
*
* class FstIOError(FstError, IOError): # <<<<<<<<<<<<<<
*
* pass
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_builtin_IOError);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_IOError);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstIOError, __pyx_n_s_FstIOError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstIOError, __pyx_n_s_FstIOError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstIOError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstIOError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIOError, __pyx_t_4) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIOError, __pyx_t_4) < 0) __PYX_ERR(0, 146, __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":146
+ /* "pywrapfst.pyx":151
*
*
* class FstOpError(FstError, RuntimeError): # <<<<<<<<<<<<<<
*
* pass
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_builtin_RuntimeError);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_RuntimeError);
__pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstOpError, __pyx_n_s_FstOpError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstOpError, __pyx_n_s_FstOpError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstOpError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstOpError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstOpError, __pyx_t_4) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstOpError, __pyx_t_4) < 0) __PYX_ERR(0, 151, __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_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":402
+ /* "pywrapfst.pyx":407
*
* @classmethod
* def Zero(cls, weight_type): # <<<<<<<<<<<<<<
* """
* Weight.Zero(weight_type)
*/
- __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_Zero); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_Zero); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":401
- * # the C part out-of-class and then call it from within.
+ /* "pywrapfst.pyx":406
+ * # C++ part out-of-class and then call it from within.
*
* @classmethod # <<<<<<<<<<<<<<
* def Zero(cls, weight_type):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __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_Zero, __pyx_t_2) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_Zero, __pyx_t_2) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Weight);
- /* "pywrapfst.pyx":411
+ /* "pywrapfst.pyx":416
*
* @classmethod
* def One(cls, weight_type): # <<<<<<<<<<<<<<
* """
* Weight.One(weight_type)
*/
- __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_One); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_One); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":410
+ /* "pywrapfst.pyx":415
* return _Weight_Zero(weight_type)
*
* @classmethod # <<<<<<<<<<<<<<
* def One(cls, weight_type):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __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_One, __pyx_t_1) < 0) __PYX_ERR(0, 411, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_One, __pyx_t_1) < 0) __PYX_ERR(0, 416, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Weight);
- /* "pywrapfst.pyx":420
+ /* "pywrapfst.pyx":425
*
* @classmethod
* def NoWeight(cls, weight_type): # <<<<<<<<<<<<<<
* """
* Weight.NoWeight(weight_type)
*/
- __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_NoWeight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_NoWeight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":419
+ /* "pywrapfst.pyx":424
* return _Weight_One(weight_type)
*
* @classmethod # <<<<<<<<<<<<<<
* def NoWeight(cls, weight_type):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __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_NoWeight, __pyx_t_2) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_NoWeight, __pyx_t_2) < 0) __PYX_ERR(0, 425, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Weight);
- /* "pywrapfst.pyx":455
+ /* "pywrapfst.pyx":460
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* plus(lhs, rhs)
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_1plus, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error)
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_1plus, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_plus, __pyx_t_2) < 0) __PYX_ERR(0, 455, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_plus, __pyx_t_2) < 0) __PYX_ERR(0, 460, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":487
+ /* "pywrapfst.pyx":492
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* times(lhs, rhs)
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_3times, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error)
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_3times, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_times, __pyx_t_2) < 0) __PYX_ERR(0, 487, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_times, __pyx_t_2) < 0) __PYX_ERR(0, 492, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":519
+ /* "pywrapfst.pyx":524
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* divide(lhs, rhs)
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_5divide, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error)
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_5divide, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_divide, __pyx_t_2) < 0) __PYX_ERR(0, 519, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_divide, __pyx_t_2) < 0) __PYX_ERR(0, 524, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":552
+ /* "pywrapfst.pyx":557
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
* """
* power(lhs, rhs)
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_7power, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error)
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_7power, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_power, __pyx_t_2) < 0) __PYX_ERR(0, 552, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_power, __pyx_t_2) < 0) __PYX_ERR(0, 557, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":977
+ /* "pywrapfst.pyx":893
+ * """
+ *
+ * cpdef int64 add_symbol(self, symbol, int64 key=kNoSymbol): # <<<<<<<<<<<<<<
+ * """
+ * add_symbol(self, symbol, key=NO_SYMBOL)
+ */
+ __pyx_k__5 = __pyx_v_9pywrapfst_kNoSymbol;
+ __pyx_k__5 = __pyx_v_9pywrapfst_kNoSymbol;
+
+ /* "pywrapfst.pyx":970
*
* @classmethod
* def read(cls, filename): # <<<<<<<<<<<<<<
* """
* SymbolTable.read(filename)
*/
- __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":976
+ /* "pywrapfst.pyx":969
* self._smart_table.reset(self._table)
*
* @classmethod # <<<<<<<<<<<<<<
* def read(cls, filename):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __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, __pyx_t_1) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read, __pyx_t_1) < 0) __PYX_ERR(0, 970, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":999
+ /* "pywrapfst.pyx":992
*
* @classmethod
* def read_text(cls, filename, bool allow_negative_labels=False): # <<<<<<<<<<<<<<
* """
* SymbolTable.read_text(filename)
*/
- __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":998
+ /* "pywrapfst.pyx":991
* return _init_SymbolTable(tsyms)
*
* @classmethod # <<<<<<<<<<<<<<
* def read_text(cls, filename, bool allow_negative_labels=False):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 991, __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_text, __pyx_t_2) < 0) __PYX_ERR(0, 999, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_text, __pyx_t_2) < 0) __PYX_ERR(0, 992, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":1026
+ /* "pywrapfst.pyx":1019
*
* @classmethod
* def read_fst(cls, filename, bool input_table): # <<<<<<<<<<<<<<
* """
* SymbolTable.read_fst(filename, input_table)
*/
- __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_fst); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_fst); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1019, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":1025
+ /* "pywrapfst.pyx":1018
* return _init_SymbolTable(tsyms)
*
* @classmethod # <<<<<<<<<<<<<<
* def read_fst(cls, filename, bool input_table):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __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_fst, __pyx_t_1) < 0) __PYX_ERR(0, 1026, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_fst, __pyx_t_1) < 0) __PYX_ERR(0, 1019, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":2068
+ /* "pywrapfst.pyx":2061
* return self
*
* cdef void _minimize(self, float delta=fst.kDelta, # <<<<<<<<<<<<<<
* bool allow_nondet=False) except *:
* # This runs in-place when the second argument is null.
*/
- __pyx_k__15 = fst::kDelta;
+ __pyx_k__16 = fst::kDelta;
- /* "pywrapfst.pyx":2074
+ /* "pywrapfst.pyx":2067
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
* """
* minimize(self, delta=0.0009765625, allow_nondet=False)
*/
- __pyx_k__16 = fst::kDelta;
+ __pyx_k__17 = fst::kDelta;
- /* "pywrapfst.pyx":2174
+ /* "pywrapfst.pyx":2167
* return self
*
* cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* weight=None) except *:
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
*/
- __pyx_k__17 = fst::kDelta;
- __pyx_k__18 = fst::kNoStateId;
+ __pyx_k__18 = fst::kDelta;
+ __pyx_k__19 = fst::kNoStateId;
- /* "pywrapfst.pyx":2183
+ /* "pywrapfst.pyx":2176
*
* def prune(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
* weight=None):
*/
- __pyx_k__19 = fst::kDelta;
+ __pyx_k__20 = fst::kDelta;
- /* "pywrapfst.pyx":2184
+ /* "pywrapfst.pyx":2177
* def prune(self,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* weight=None):
* """
*/
- __pyx_k__20 = fst::kNoStateId;
+ __pyx_k__21 = fst::kNoStateId;
- /* "pywrapfst.pyx":2211
+ /* "pywrapfst.pyx":2204
*
* cdef void _push(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* bool remove_total_weight=False,
* bool to_final=False) except *:
*/
- __pyx_k__21 = fst::kDelta;
+ __pyx_k__22 = fst::kDelta;
- /* "pywrapfst.pyx":2219
+ /* "pywrapfst.pyx":2212
*
* def push(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* bool remove_total_weight=False,
* bool to_final=False):
*/
- __pyx_k__22 = fst::kDelta;
-
- /* "pywrapfst.pyx":2454
- * cdef void _rmepsilon(self,
- * bool connect=True,
- * float delta=fst.kDelta, # <<<<<<<<<<<<<<
- * int64 nstate=fst.kNoStateId,
- * weight=None) except *:
- */
- __pyx_k__26 = fst::kDelta;
+ __pyx_k__23 = fst::kDelta;
- /* "pywrapfst.pyx":2455
+ /* "pywrapfst.pyx":2449
* bool connect=True,
- * float delta=fst.kDelta,
+ * weight=None,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * weight=None) except *:
- * # Threshold is set to semiring Zero (no pruning) if weight unspecified.
+ * float delta=fst.kDelta) except *:
+ * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
*/
__pyx_k__27 = fst::kNoStateId;
- /* "pywrapfst.pyx":2465
- * def rmepsilon(self,
- * bool connect=True,
- * float delta=fst.kDelta, # <<<<<<<<<<<<<<
- * int64 nstate=fst.kNoStateId,
- * weight=None):
+ /* "pywrapfst.pyx":2450
+ * weight=None,
+ * int64 nstate=fst.kNoStateId,
+ * float delta=fst.kDelta) except *: # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
+ * weight)
*/
__pyx_k__28 = fst::kDelta;
- /* "pywrapfst.pyx":2466
+ /* "pywrapfst.pyx":2463
* bool connect=True,
- * float delta=fst.kDelta,
+ * weight=None,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * weight=None):
+ * float delta=fst.kDelta):
* """
*/
__pyx_k__29 = fst::kNoStateId;
+ /* "pywrapfst.pyx":2464
+ * weight=None,
+ * int64 nstate=fst.kNoStateId,
+ * float delta=fst.kDelta): # <<<<<<<<<<<<<<
+ * """
+ * rmepsilon(self, queue_type="auto", connect=True, weight=None,
+ */
+ __pyx_k__30 = fst::kDelta;
+
/* "pywrapfst.pyx":2749
*
*
* 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__77)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2766, __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__74)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2766, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__78);
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__75);
if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_t_4) < 0) __PYX_ERR(0, 2766, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
* """
* 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__80)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2770, __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__77)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2770, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__81);
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__78);
/* "pywrapfst.pyx":2769
* return _create_Fst(arc_type)
* """
* 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__83)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2791, __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__80)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2791, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__84);
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__81);
/* "pywrapfst.pyx":2790
* return _read_Fst(filename, fst_type)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2815
+ /* "pywrapfst.pyx":2817
+ *
*
- * ## FST constants
* NO_LABEL = fst.kNoLabel # <<<<<<<<<<<<<<
* NO_STATE_ID = fst.kNoStateId
- *
+ * # TODO(kbg): Figure out how to access static class variables so I don't have
*/
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(fst::kNoLabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2815, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(fst::kNoLabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2817, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_LABEL, __pyx_t_1) < 0) __PYX_ERR(0, 2815, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_LABEL, __pyx_t_1) < 0) __PYX_ERR(0, 2817, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2816
- * ## FST constants
+ /* "pywrapfst.pyx":2818
+ *
* NO_LABEL = fst.kNoLabel
* NO_STATE_ID = fst.kNoStateId # <<<<<<<<<<<<<<
+ * # TODO(kbg): Figure out how to access static class variables so I don't have
+ * # to do it this way.
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(fst::kNoStateId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2818, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_STATE_ID, __pyx_t_1) < 0) __PYX_ERR(0, 2818, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "pywrapfst.pyx":2821
+ * # TODO(kbg): Figure out how to access static class variables so I don't have
+ * # to do it this way.
+ * NO_SYMBOL = kNoSymbol # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(fst::kNoStateId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_9pywrapfst_kNoSymbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_STATE_ID, __pyx_t_1) < 0) __PYX_ERR(0, 2816, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_SYMBOL, __pyx_t_1) < 0) __PYX_ERR(0, 2821, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2822
+ /* "pywrapfst.pyx":2827
*
*
* EXPANDED = fst.kExpanded # <<<<<<<<<<<<<<
* MUTABLE = fst.kMutable
* ERROR = fst.kError
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2822, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2827, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXPANDED, __pyx_t_1) < 0) __PYX_ERR(0, 2822, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXPANDED, __pyx_t_1) < 0) __PYX_ERR(0, 2827, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2823
+ /* "pywrapfst.pyx":2828
*
* EXPANDED = fst.kExpanded
* MUTABLE = fst.kMutable # <<<<<<<<<<<<<<
* ERROR = fst.kError
* ACCEPTOR = fst.kAcceptor
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2823, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2828, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_MUTABLE, __pyx_t_1) < 0) __PYX_ERR(0, 2823, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MUTABLE, __pyx_t_1) < 0) __PYX_ERR(0, 2828, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2824
+ /* "pywrapfst.pyx":2829
* EXPANDED = fst.kExpanded
* MUTABLE = fst.kMutable
* ERROR = fst.kError # <<<<<<<<<<<<<<
* ACCEPTOR = fst.kAcceptor
* NOT_ACCEPTOR = fst.kNotAcceptor
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2829, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_1) < 0) __PYX_ERR(0, 2824, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_1) < 0) __PYX_ERR(0, 2829, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2825
+ /* "pywrapfst.pyx":2830
* MUTABLE = fst.kMutable
* ERROR = fst.kError
* ACCEPTOR = fst.kAcceptor # <<<<<<<<<<<<<<
* NOT_ACCEPTOR = fst.kNotAcceptor
* I_DETERMINISTIC = fst.kIDeterministic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2825, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2830, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCEPTOR, __pyx_t_1) < 0) __PYX_ERR(0, 2825, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCEPTOR, __pyx_t_1) < 0) __PYX_ERR(0, 2830, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2826
+ /* "pywrapfst.pyx":2831
* ERROR = fst.kError
* ACCEPTOR = fst.kAcceptor
* NOT_ACCEPTOR = fst.kNotAcceptor # <<<<<<<<<<<<<<
* I_DETERMINISTIC = fst.kIDeterministic
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2826, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2831, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_1) < 0) __PYX_ERR(0, 2826, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_1) < 0) __PYX_ERR(0, 2831, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2827
+ /* "pywrapfst.pyx":2832
* ACCEPTOR = fst.kAcceptor
* NOT_ACCEPTOR = fst.kNotAcceptor
* I_DETERMINISTIC = fst.kIDeterministic # <<<<<<<<<<<<<<
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
* O_DETERMINISTIC = fst.kODeterministic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2827, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2832, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2827, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2832, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2828
+ /* "pywrapfst.pyx":2833
* NOT_ACCEPTOR = fst.kNotAcceptor
* I_DETERMINISTIC = fst.kIDeterministic
* NON_I_DETERMINISTIC = fst.kNonIDeterministic # <<<<<<<<<<<<<<
* O_DETERMINISTIC = fst.kODeterministic
* NON_O_DETERMINISTIC = fst.kNonODeterministic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2828, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2828, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2833, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2829
+ /* "pywrapfst.pyx":2834
* I_DETERMINISTIC = fst.kIDeterministic
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
* O_DETERMINISTIC = fst.kODeterministic # <<<<<<<<<<<<<<
* NON_O_DETERMINISTIC = fst.kNonODeterministic
* EPSILONS = fst.kEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2829, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2834, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2829, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2834, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2830
+ /* "pywrapfst.pyx":2835
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
* O_DETERMINISTIC = fst.kODeterministic
* NON_O_DETERMINISTIC = fst.kNonODeterministic # <<<<<<<<<<<<<<
* EPSILONS = fst.kEpsilons
* NO_EPSILONS = fst.kNoEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2830, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2835, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2830, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2835, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2831
+ /* "pywrapfst.pyx":2836
* O_DETERMINISTIC = fst.kODeterministic
* NON_O_DETERMINISTIC = fst.kNonODeterministic
* EPSILONS = fst.kEpsilons # <<<<<<<<<<<<<<
* NO_EPSILONS = fst.kNoEpsilons
* I_EPSILONS = fst.kIEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2831, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2836, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2831, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2836, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2832
+ /* "pywrapfst.pyx":2837
* NON_O_DETERMINISTIC = fst.kNonODeterministic
* EPSILONS = fst.kEpsilons
* NO_EPSILONS = fst.kNoEpsilons # <<<<<<<<<<<<<<
* I_EPSILONS = fst.kIEpsilons
* NO_I_EPSILONS = fst.kNoIEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2832, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2837, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2832, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2837, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2833
+ /* "pywrapfst.pyx":2838
* EPSILONS = fst.kEpsilons
* NO_EPSILONS = fst.kNoEpsilons
* I_EPSILONS = fst.kIEpsilons # <<<<<<<<<<<<<<
* NO_I_EPSILONS = fst.kNoIEpsilons
* O_EPSILONS = fst.kOEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2833, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2838, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2833, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2838, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2834
+ /* "pywrapfst.pyx":2839
* NO_EPSILONS = fst.kNoEpsilons
* I_EPSILONS = fst.kIEpsilons
* NO_I_EPSILONS = fst.kNoIEpsilons # <<<<<<<<<<<<<<
* O_EPSILONS = fst.kOEpsilons
* NO_O_EPSILONS = fst.kNoOEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2834, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2839, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_I_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2834, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_I_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2839, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2835
+ /* "pywrapfst.pyx":2840
* I_EPSILONS = fst.kIEpsilons
* NO_I_EPSILONS = fst.kNoIEpsilons
* O_EPSILONS = fst.kOEpsilons # <<<<<<<<<<<<<<
* NO_O_EPSILONS = fst.kNoOEpsilons
* I_LABEL_SORTED = fst.kILabelSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2835, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2840, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2835, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2840, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2836
+ /* "pywrapfst.pyx":2841
* NO_I_EPSILONS = fst.kNoIEpsilons
* O_EPSILONS = fst.kOEpsilons
* NO_O_EPSILONS = fst.kNoOEpsilons # <<<<<<<<<<<<<<
* I_LABEL_SORTED = fst.kILabelSorted
* NOT_I_LABEL_SORTED = fst.kNotILabelSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2836, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2841, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_O_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2836, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_O_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2841, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2837
+ /* "pywrapfst.pyx":2842
* O_EPSILONS = fst.kOEpsilons
* NO_O_EPSILONS = fst.kNoOEpsilons
* I_LABEL_SORTED = fst.kILabelSorted # <<<<<<<<<<<<<<
* NOT_I_LABEL_SORTED = fst.kNotILabelSorted
* O_LABEL_SORTED = fst.kOLabelSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2837, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2837, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2842, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2838
+ /* "pywrapfst.pyx":2843
* NO_O_EPSILONS = fst.kNoOEpsilons
* I_LABEL_SORTED = fst.kILabelSorted
* NOT_I_LABEL_SORTED = fst.kNotILabelSorted # <<<<<<<<<<<<<<
* O_LABEL_SORTED = fst.kOLabelSorted
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2838, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2843, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2838, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2843, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2839
+ /* "pywrapfst.pyx":2844
* I_LABEL_SORTED = fst.kILabelSorted
* NOT_I_LABEL_SORTED = fst.kNotILabelSorted
* O_LABEL_SORTED = fst.kOLabelSorted # <<<<<<<<<<<<<<
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
* WEIGHTED = fst.kWeighted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2839, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2839, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2844, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2840
+ /* "pywrapfst.pyx":2845
* NOT_I_LABEL_SORTED = fst.kNotILabelSorted
* O_LABEL_SORTED = fst.kOLabelSorted
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted # <<<<<<<<<<<<<<
* WEIGHTED = fst.kWeighted
* UNWEIGHTED = fst.kUnweighted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2840, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2840, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2845, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2841
+ /* "pywrapfst.pyx":2846
* O_LABEL_SORTED = fst.kOLabelSorted
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
* WEIGHTED = fst.kWeighted # <<<<<<<<<<<<<<
* UNWEIGHTED = fst.kUnweighted
* CYCLIC = fst.kCyclic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2841, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2846, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED, __pyx_t_1) < 0) __PYX_ERR(0, 2841, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED, __pyx_t_1) < 0) __PYX_ERR(0, 2846, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2842
+ /* "pywrapfst.pyx":2847
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
* WEIGHTED = fst.kWeighted
* UNWEIGHTED = fst.kUnweighted # <<<<<<<<<<<<<<
* CYCLIC = fst.kCyclic
* ACYCLIC = fst.kAcyclic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2842, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2847, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED, __pyx_t_1) < 0) __PYX_ERR(0, 2842, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED, __pyx_t_1) < 0) __PYX_ERR(0, 2847, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2843
+ /* "pywrapfst.pyx":2848
* WEIGHTED = fst.kWeighted
* UNWEIGHTED = fst.kUnweighted
* CYCLIC = fst.kCyclic # <<<<<<<<<<<<<<
* ACYCLIC = fst.kAcyclic
* INITIAL_CYCLIC = fst.kInitialCyclic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2843, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2848, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_CYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2843, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2848, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2844
+ /* "pywrapfst.pyx":2849
* UNWEIGHTED = fst.kUnweighted
* CYCLIC = fst.kCyclic
* ACYCLIC = fst.kAcyclic # <<<<<<<<<<<<<<
* INITIAL_CYCLIC = fst.kInitialCyclic
* INITIAL_ACYCLIC = fst.kInitialAcyclic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2844, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2849, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2844, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2849, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2845
+ /* "pywrapfst.pyx":2850
* CYCLIC = fst.kCyclic
* ACYCLIC = fst.kAcyclic
* INITIAL_CYCLIC = fst.kInitialCyclic # <<<<<<<<<<<<<<
* INITIAL_ACYCLIC = fst.kInitialAcyclic
* TOP_SORTED = fst.kTopSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2845, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2850, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2845, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2850, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2846
+ /* "pywrapfst.pyx":2851
* ACYCLIC = fst.kAcyclic
* INITIAL_CYCLIC = fst.kInitialCyclic
* INITIAL_ACYCLIC = fst.kInitialAcyclic # <<<<<<<<<<<<<<
* TOP_SORTED = fst.kTopSorted
* NOT_TOP_SORTED = fst.kNotTopSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2846, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2851, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2846, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2851, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2847
+ /* "pywrapfst.pyx":2852
* INITIAL_CYCLIC = fst.kInitialCyclic
* INITIAL_ACYCLIC = fst.kInitialAcyclic
* TOP_SORTED = fst.kTopSorted # <<<<<<<<<<<<<<
* NOT_TOP_SORTED = fst.kNotTopSorted
* ACCESSIBLE = fst.kAccessible
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2847, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2852, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOP_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2847, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOP_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2852, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2848
+ /* "pywrapfst.pyx":2853
* INITIAL_ACYCLIC = fst.kInitialAcyclic
* TOP_SORTED = fst.kTopSorted
* NOT_TOP_SORTED = fst.kNotTopSorted # <<<<<<<<<<<<<<
* ACCESSIBLE = fst.kAccessible
* NOT_ACCESSIBLE = fst.kNotAccessible
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2848, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2853, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2848, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2853, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2849
+ /* "pywrapfst.pyx":2854
* TOP_SORTED = fst.kTopSorted
* NOT_TOP_SORTED = fst.kNotTopSorted
* ACCESSIBLE = fst.kAccessible # <<<<<<<<<<<<<<
* NOT_ACCESSIBLE = fst.kNotAccessible
* COACCESSIBLE = fst.kCoAccessible
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2849, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2854, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2849, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2854, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2850
+ /* "pywrapfst.pyx":2855
* NOT_TOP_SORTED = fst.kNotTopSorted
* ACCESSIBLE = fst.kAccessible
* NOT_ACCESSIBLE = fst.kNotAccessible # <<<<<<<<<<<<<<
* COACCESSIBLE = fst.kCoAccessible
* NOT_COACCESSIBLE = fst.kNotCoAccessible
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2850, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2855, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2850, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2855, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2851
+ /* "pywrapfst.pyx":2856
* ACCESSIBLE = fst.kAccessible
* NOT_ACCESSIBLE = fst.kNotAccessible
* COACCESSIBLE = fst.kCoAccessible # <<<<<<<<<<<<<<
* NOT_COACCESSIBLE = fst.kNotCoAccessible
* STRING = fst.kString
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2851, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2856, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2851, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_COACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2856, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2852
+ /* "pywrapfst.pyx":2857
* NOT_ACCESSIBLE = fst.kNotAccessible
* COACCESSIBLE = fst.kCoAccessible
* NOT_COACCESSIBLE = fst.kNotCoAccessible # <<<<<<<<<<<<<<
* STRING = fst.kString
* NOT_STRING = fst.kNotString
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2852, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2857, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2852, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2857, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2853
+ /* "pywrapfst.pyx":2858
* COACCESSIBLE = fst.kCoAccessible
* NOT_COACCESSIBLE = fst.kNotCoAccessible
* STRING = fst.kString # <<<<<<<<<<<<<<
* NOT_STRING = fst.kNotString
* WEIGHTED_CYCLES = fst.kWeightedCycles
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2853, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_1) < 0) __PYX_ERR(0, 2853, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_1) < 0) __PYX_ERR(0, 2858, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2854
+ /* "pywrapfst.pyx":2859
* NOT_COACCESSIBLE = fst.kNotCoAccessible
* STRING = fst.kString
* NOT_STRING = fst.kNotString # <<<<<<<<<<<<<<
* WEIGHTED_CYCLES = fst.kWeightedCycles
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2854, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_STRING, __pyx_t_1) < 0) __PYX_ERR(0, 2854, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_STRING, __pyx_t_1) < 0) __PYX_ERR(0, 2859, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2855
+ /* "pywrapfst.pyx":2860
* STRING = fst.kString
* NOT_STRING = fst.kNotString
* WEIGHTED_CYCLES = fst.kWeightedCycles # <<<<<<<<<<<<<<
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
* NULL_PROPERTIES = fst.kNullProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2855, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2860, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_1) < 0) __PYX_ERR(0, 2855, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_1) < 0) __PYX_ERR(0, 2860, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2856
+ /* "pywrapfst.pyx":2861
* NOT_STRING = fst.kNotString
* WEIGHTED_CYCLES = fst.kWeightedCycles
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles # <<<<<<<<<<<<<<
* NULL_PROPERTIES = fst.kNullProperties
* COPY_PROPERTIES = fst.kCopyProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2856, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2861, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_1) < 0) __PYX_ERR(0, 2856, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_1) < 0) __PYX_ERR(0, 2861, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2857
+ /* "pywrapfst.pyx":2862
* WEIGHTED_CYCLES = fst.kWeightedCycles
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
* NULL_PROPERTIES = fst.kNullProperties # <<<<<<<<<<<<<<
* COPY_PROPERTIES = fst.kCopyProperties
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2857, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2862, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2857, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2862, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2858
+ /* "pywrapfst.pyx":2863
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
* NULL_PROPERTIES = fst.kNullProperties
* COPY_PROPERTIES = fst.kCopyProperties # <<<<<<<<<<<<<<
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2863, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COPY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2858, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_COPY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2863, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2859
+ /* "pywrapfst.pyx":2864
* NULL_PROPERTIES = fst.kNullProperties
* COPY_PROPERTIES = fst.kCopyProperties
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties # <<<<<<<<<<<<<<
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
* SET_START_PROPERTIES = fst.kSetStartProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2859, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2864, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2859, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2864, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2860
+ /* "pywrapfst.pyx":2865
* COPY_PROPERTIES = fst.kCopyProperties
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties # <<<<<<<<<<<<<<
* SET_START_PROPERTIES = fst.kSetStartProperties
* SET_FINAL_PROPERTIES = fst.kSetFinalProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2860, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2865, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2860, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2865, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2861
+ /* "pywrapfst.pyx":2866
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
* SET_START_PROPERTIES = fst.kSetStartProperties # <<<<<<<<<<<<<<
* SET_FINAL_PROPERTIES = fst.kSetFinalProperties
* ADD_STATE_PROPERTIES = fst.kAddStateProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2861, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2866, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2861, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2866, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2862
+ /* "pywrapfst.pyx":2867
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
* SET_START_PROPERTIES = fst.kSetStartProperties
* SET_FINAL_PROPERTIES = fst.kSetFinalProperties # <<<<<<<<<<<<<<
* ADD_STATE_PROPERTIES = fst.kAddStateProperties
* ADD_ARC_PROPERTIES = fst.kAddArcProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2862, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2867, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2862, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2867, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2863
+ /* "pywrapfst.pyx":2868
* SET_START_PROPERTIES = fst.kSetStartProperties
* SET_FINAL_PROPERTIES = fst.kSetFinalProperties
* ADD_STATE_PROPERTIES = fst.kAddStateProperties # <<<<<<<<<<<<<<
* ADD_ARC_PROPERTIES = fst.kAddArcProperties
* SET_ARC_PROPERTIES = fst.kSetArcProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2863, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2868, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2863, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2868, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2864
+ /* "pywrapfst.pyx":2869
* SET_FINAL_PROPERTIES = fst.kSetFinalProperties
* ADD_STATE_PROPERTIES = fst.kAddStateProperties
* ADD_ARC_PROPERTIES = fst.kAddArcProperties # <<<<<<<<<<<<<<
* SET_ARC_PROPERTIES = fst.kSetArcProperties
* DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2864, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2869, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2864, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2869, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2865
+ /* "pywrapfst.pyx":2870
* ADD_STATE_PROPERTIES = fst.kAddStateProperties
* ADD_ARC_PROPERTIES = fst.kAddArcProperties
* SET_ARC_PROPERTIES = fst.kSetArcProperties # <<<<<<<<<<<<<<
* DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
* DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2865, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2870, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2865, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2870, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2866
+ /* "pywrapfst.pyx":2871
* ADD_ARC_PROPERTIES = fst.kAddArcProperties
* SET_ARC_PROPERTIES = fst.kSetArcProperties
* DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties # <<<<<<<<<<<<<<
* DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
* STATE_SORT_PROPERTIES = fst.kStateSortProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2866, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2871, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2866, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2871, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2867
+ /* "pywrapfst.pyx":2872
* SET_ARC_PROPERTIES = fst.kSetArcProperties
* DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
* DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties # <<<<<<<<<<<<<<
* STATE_SORT_PROPERTIES = fst.kStateSortProperties
* ARC_SORT_PROPERTIES = fst.kArcSortProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2867, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2872, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2867, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2872, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2868
+ /* "pywrapfst.pyx":2873
* DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
* DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
* STATE_SORT_PROPERTIES = fst.kStateSortProperties # <<<<<<<<<<<<<<
* ARC_SORT_PROPERTIES = fst.kArcSortProperties
* I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2868, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2873, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2868, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2873, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2869
+ /* "pywrapfst.pyx":2874
* DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
* STATE_SORT_PROPERTIES = fst.kStateSortProperties
* ARC_SORT_PROPERTIES = fst.kArcSortProperties # <<<<<<<<<<<<<<
* I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
* O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2869, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2869, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2874, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2870
+ /* "pywrapfst.pyx":2875
* STATE_SORT_PROPERTIES = fst.kStateSortProperties
* ARC_SORT_PROPERTIES = fst.kArcSortProperties
* I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties # <<<<<<<<<<<<<<
* O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
* WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2870, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2875, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2870, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2875, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2871
+ /* "pywrapfst.pyx":2876
* ARC_SORT_PROPERTIES = fst.kArcSortProperties
* I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
* O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties # <<<<<<<<<<<<<<
* WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
* ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2871, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2876, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2871, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2876, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2872
+ /* "pywrapfst.pyx":2877
* I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
* O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
* WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties # <<<<<<<<<<<<<<
* ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
* RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2872, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2877, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2872, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2877, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2873
+ /* "pywrapfst.pyx":2878
* O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
* WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
* ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties # <<<<<<<<<<<<<<
* RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
* BINARY_PROPERTIES = fst.kBinaryProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2873, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2878, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2873, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2878, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2874
+ /* "pywrapfst.pyx":2879
* WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
* ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
* RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties # <<<<<<<<<<<<<<
* BINARY_PROPERTIES = fst.kBinaryProperties
* TRINARY_PROPERTIES = fst.kTrinaryProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2874, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2879, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2875
+ /* "pywrapfst.pyx":2880
* ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
* RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
* BINARY_PROPERTIES = fst.kBinaryProperties # <<<<<<<<<<<<<<
* TRINARY_PROPERTIES = fst.kTrinaryProperties
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2875, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2880, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2875, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2880, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2876
+ /* "pywrapfst.pyx":2881
* RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
* BINARY_PROPERTIES = fst.kBinaryProperties
* TRINARY_PROPERTIES = fst.kTrinaryProperties # <<<<<<<<<<<<<<
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2876, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2881, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2876, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2881, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2877
+ /* "pywrapfst.pyx":2882
* BINARY_PROPERTIES = fst.kBinaryProperties
* TRINARY_PROPERTIES = fst.kTrinaryProperties
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties # <<<<<<<<<<<<<<
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
* FST_PROPERTIES = fst.kFstProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2877, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2882, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2877, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2882, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2878
+ /* "pywrapfst.pyx":2883
* TRINARY_PROPERTIES = fst.kTrinaryProperties
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties # <<<<<<<<<<<<<<
* FST_PROPERTIES = fst.kFstProperties
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2878, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2883, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2878, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2883, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2879
+ /* "pywrapfst.pyx":2884
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
* FST_PROPERTIES = fst.kFstProperties # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2884, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FST_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2879, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FST_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2884, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2885
+ /* "pywrapfst.pyx":2890
*
*
* ARC_I_LABEL_VALUE = fst.kArcILabelValue # <<<<<<<<<<<<<<
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcILabelValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2885, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcILabelValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2890, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_I_LABEL_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2885, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_I_LABEL_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2890, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2886
+ /* "pywrapfst.pyx":2891
*
* ARC_I_LABEL_VALUE = fst.kArcILabelValue
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue # <<<<<<<<<<<<<<
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcOLabelValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2886, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcOLabelValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2891, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_O_LABEL_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2886, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_O_LABEL_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2891, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2887
+ /* "pywrapfst.pyx":2892
* ARC_I_LABEL_VALUE = fst.kArcILabelValue
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue
* ARC_WEIGHT_VALUE = fst.kArcWeightValue # <<<<<<<<<<<<<<
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
* ARC_NO_CACHE = fst.kArcNoCache
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcWeightValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcWeightValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2892, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_WEIGHT_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2887, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_WEIGHT_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2892, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2888
+ /* "pywrapfst.pyx":2893
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue # <<<<<<<<<<<<<<
* ARC_NO_CACHE = fst.kArcNoCache
* ARC_VALUE_FLAGS = fst.kArcValueFlags
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcNextStateValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2888, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcNextStateValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2893, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NEXT_STATE_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2888, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NEXT_STATE_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2893, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2889
+ /* "pywrapfst.pyx":2894
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
* ARC_NO_CACHE = fst.kArcNoCache # <<<<<<<<<<<<<<
* ARC_VALUE_FLAGS = fst.kArcValueFlags
* ARC_FLAGS = fst.kArcFlags
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcNoCache); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2889, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcNoCache); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2894, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NO_CACHE, __pyx_t_1) < 0) __PYX_ERR(0, 2889, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NO_CACHE, __pyx_t_1) < 0) __PYX_ERR(0, 2894, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2890
+ /* "pywrapfst.pyx":2895
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
* ARC_NO_CACHE = fst.kArcNoCache
* ARC_VALUE_FLAGS = fst.kArcValueFlags # <<<<<<<<<<<<<<
* ARC_FLAGS = fst.kArcFlags
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcValueFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2890, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcValueFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2895, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_VALUE_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2890, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_VALUE_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2895, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2891
+ /* "pywrapfst.pyx":2896
* ARC_NO_CACHE = fst.kArcNoCache
* ARC_VALUE_FLAGS = fst.kArcValueFlags
* ARC_FLAGS = fst.kArcFlags # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2891, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2896, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2891, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2896, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2897
+ /* "pywrapfst.pyx":2902
*
*
* ENCODE_LABELS = fst.kEncodeLabels # <<<<<<<<<<<<<<
* ENCODE_WEIGHTS = fst.kEncodeWeights
* ENCODE_FLAGS = fst.kEncodeFlags
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeLabels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2897, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeLabels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2902, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_LABELS, __pyx_t_1) < 0) __PYX_ERR(0, 2897, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_LABELS, __pyx_t_1) < 0) __PYX_ERR(0, 2902, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2898
+ /* "pywrapfst.pyx":2903
*
* ENCODE_LABELS = fst.kEncodeLabels
* ENCODE_WEIGHTS = fst.kEncodeWeights # <<<<<<<<<<<<<<
* ENCODE_FLAGS = fst.kEncodeFlags
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeWeights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2898, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeWeights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2903, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_WEIGHTS, __pyx_t_1) < 0) __PYX_ERR(0, 2898, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_WEIGHTS, __pyx_t_1) < 0) __PYX_ERR(0, 2903, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2899
+ /* "pywrapfst.pyx":2904
* ENCODE_LABELS = fst.kEncodeLabels
* ENCODE_WEIGHTS = fst.kEncodeWeights
* ENCODE_FLAGS = fst.kEncodeFlags # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2899, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2904, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2899, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2904, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":3266
+ /* "pywrapfst.pyx":3271
*
* cdef _Fst _map(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* map_type=b"identity",
* weight=None):
*/
- __pyx_k__38 = fst::kDelta;
+ __pyx_k__39 = fst::kDelta;
- /* "pywrapfst.pyx":3279
+ /* "pywrapfst.pyx":3284
*
* cpdef _Fst arcmap(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* map_type=b"identity",
* weight=None):
*/
- __pyx_k__39 = fst::kDelta;
+ __pyx_k__40 = fst::kDelta;
- /* "pywrapfst.pyx":3278
+ /* "pywrapfst.pyx":3283
*
*
* cpdef _Fst arcmap(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
* map_type=b"identity",
*/
- __pyx_k__39 = fst::kDelta;
+ __pyx_k__40 = fst::kDelta;
- /* "pywrapfst.pyx":3386
+ /* "pywrapfst.pyx":3391
*
* cpdef _MutableFst determinize(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* det_type=b"functional",
* int64 nstate=fst.kNoStateId,
*/
- __pyx_k__40 = fst::kDelta;
+ __pyx_k__41 = fst::kDelta;
- /* "pywrapfst.pyx":3388
+ /* "pywrapfst.pyx":3393
* float delta=fst.kDelta,
* det_type=b"functional",
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* int64 subsequential_label=0,
* weight=None,
*/
- __pyx_k__41 = fst::kNoStateId;
+ __pyx_k__42 = fst::kNoStateId;
- /* "pywrapfst.pyx":3386
+ /* "pywrapfst.pyx":3391
*
* cpdef _MutableFst determinize(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* det_type=b"functional",
* int64 nstate=fst.kNoStateId,
*/
- __pyx_k__40 = fst::kDelta;
+ __pyx_k__41 = fst::kDelta;
- /* "pywrapfst.pyx":3388
+ /* "pywrapfst.pyx":3393
* float delta=fst.kDelta,
* det_type=b"functional",
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* int64 subsequential_label=0,
* weight=None,
*/
- __pyx_k__41 = fst::kNoStateId;
+ __pyx_k__42 = fst::kNoStateId;
- /* "pywrapfst.pyx":3479
+ /* "pywrapfst.pyx":3484
*
* cpdef _MutableFst disambiguate(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
*/
- __pyx_k__42 = fst::kDelta;
+ __pyx_k__43 = fst::kDelta;
- /* "pywrapfst.pyx":3480
+ /* "pywrapfst.pyx":3485
* cpdef _MutableFst disambiguate(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* int64 subsequential_label=0,
* weight=None):
*/
- __pyx_k__43 = fst::kNoStateId;
+ __pyx_k__44 = fst::kNoStateId;
- /* "pywrapfst.pyx":3479
+ /* "pywrapfst.pyx":3484
*
* cpdef _MutableFst disambiguate(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
*/
- __pyx_k__42 = fst::kDelta;
+ __pyx_k__43 = fst::kDelta;
- /* "pywrapfst.pyx":3480
+ /* "pywrapfst.pyx":3485
* cpdef _MutableFst disambiguate(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* int64 subsequential_label=0,
* weight=None):
*/
- __pyx_k__43 = fst::kNoStateId;
+ __pyx_k__44 = fst::kNoStateId;
- /* "pywrapfst.pyx":3550
+ /* "pywrapfst.pyx":3555
*
*
* cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
* """
* equal(ifst1, ifst2, delta=0.0009765625)
*/
- __pyx_k__44 = fst::kDelta;
- __pyx_k__44 = fst::kDelta;
+ __pyx_k__45 = fst::kDelta;
+ __pyx_k__45 = fst::kDelta;
- /* "pywrapfst.pyx":3573
+ /* "pywrapfst.pyx":3578
*
*
* cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *: # <<<<<<<<<<<<<<
* """
* equivalent(ifst1, ifst2, delta=0.0009765625)
*/
- __pyx_k__45 = fst::kDelta;
- __pyx_k__45 = fst::kDelta;
+ __pyx_k__46 = fst::kDelta;
+ __pyx_k__46 = fst::kDelta;
- /* "pywrapfst.pyx":3637
+ /* "pywrapfst.pyx":3634
*
*
* cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
__pyx_k__47 = fst::kDelta;
__pyx_k__47 = fst::kDelta;
- /* "pywrapfst.pyx":3664
+ /* "pywrapfst.pyx":3661
*
* cpdef _MutableFst prune(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__48 = fst::kDelta;
- /* "pywrapfst.pyx":3665
+ /* "pywrapfst.pyx":3662
* cpdef _MutableFst prune(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__49 = fst::kNoStateId;
- /* "pywrapfst.pyx":3664
+ /* "pywrapfst.pyx":3661
*
* cpdef _MutableFst prune(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__48 = fst::kDelta;
- /* "pywrapfst.pyx":3665
+ /* "pywrapfst.pyx":3662
* cpdef _MutableFst prune(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__49 = fst::kNoStateId;
- /* "pywrapfst.pyx":3697
+ /* "pywrapfst.pyx":3694
*
* cpdef _MutableFst push(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__50 = fst::kDelta;
- /* "pywrapfst.pyx":3696
+ /* "pywrapfst.pyx":3693
*
*
* cpdef _MutableFst push(_Fst ifst, # <<<<<<<<<<<<<<
*/
__pyx_k__50 = fst::kDelta;
- /* "pywrapfst.pyx":3753
+ /* "pywrapfst.pyx":3750
* _Fst ifst2,
* int32 npath=1,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__51 = fst::kDelta;
- /* "pywrapfst.pyx":3756
+ /* "pywrapfst.pyx":3753
* time_t seed=0,
* select=b"uniform",
* int32 max_length=INT32_MAX) except *: # <<<<<<<<<<<<<<
*/
__pyx_k__52 = INT32_MAX;
- /* "pywrapfst.pyx":3753
+ /* "pywrapfst.pyx":3750
* _Fst ifst2,
* int32 npath=1,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__51 = fst::kDelta;
- /* "pywrapfst.pyx":3756
+ /* "pywrapfst.pyx":3753
* time_t seed=0,
* select=b"uniform",
* int32 max_length=INT32_MAX) except *: # <<<<<<<<<<<<<<
*/
__pyx_k__52 = INT32_MAX;
- /* "pywrapfst.pyx":3808
+ /* "pywrapfst.pyx":3797
* time_t seed=0,
* select=b"uniform",
* int32 max_length=INT32_MAX, # <<<<<<<<<<<<<<
* bool weighted=False,
* bool remove_total_weight=False):
*/
- __pyx_k__54 = INT32_MAX;
+ __pyx_k__53 = INT32_MAX;
- /* "pywrapfst.pyx":3804
+ /* "pywrapfst.pyx":3793
*
*
* cpdef _MutableFst randgen(_Fst ifst, # <<<<<<<<<<<<<<
* int32 npath=1,
* time_t seed=0,
*/
- __pyx_k__54 = INT32_MAX;
-
- /* "pywrapfst.pyx":3944
- * cpdef _MutableFst rmepsilon(_Fst ifst,
- * bool connect=True,
- * float delta=fst.kDelta, # <<<<<<<<<<<<<<
- * int64 nstate=fst.kNoStateId,
- * queue_type=b"auto",
- */
- __pyx_k__55 = fst::kDelta;
-
- /* "pywrapfst.pyx":3945
- * bool connect=True,
- * float delta=fst.kDelta,
- * int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * queue_type=b"auto",
- * bool reverse=False,
- */
- __pyx_k__56 = fst::kNoStateId;
-
- /* "pywrapfst.pyx":3944
- * cpdef _MutableFst rmepsilon(_Fst ifst,
- * bool connect=True,
- * float delta=fst.kDelta, # <<<<<<<<<<<<<<
- * int64 nstate=fst.kNoStateId,
- * queue_type=b"auto",
- */
- __pyx_k__55 = fst::kDelta;
-
- /* "pywrapfst.pyx":3945
- * bool connect=True,
- * float delta=fst.kDelta,
- * int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * queue_type=b"auto",
- * bool reverse=False,
- */
- __pyx_k__56 = fst::kNoStateId;
+ __pyx_k__53 = INT32_MAX;
- /* "pywrapfst.pyx":3986
+ /* "pywrapfst.pyx":3935
*
* cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,
* float delta=fst.kDelta, int64 nstate=fst.kNoStateId, queue_type=b"auto", # <<<<<<<<<<<<<<
* bool reverse=False) except *:
* cdef unique_ptr[vector[fst.WeightClass]] distance
*/
- __pyx_k__57 = fst::kDelta;
- __pyx_k__58 = fst::kNoStateId;
+ __pyx_k__54 = fst::kDelta;
+ __pyx_k__55 = fst::kNoStateId;
- /* "pywrapfst.pyx":4006
+ /* "pywrapfst.pyx":3955
*
* def shortestdistance(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
* queue_type=b"auto",
*/
- __pyx_k__59 = fst::kDelta;
+ __pyx_k__56 = fst::kDelta;
- /* "pywrapfst.pyx":4007
+ /* "pywrapfst.pyx":3956
* def shortestdistance(_Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* queue_type=b"auto",
* bool reverse=False):
*/
- __pyx_k__60 = fst::kNoStateId;
+ __pyx_k__57 = fst::kNoStateId;
- /* "pywrapfst.pyx":4005
+ /* "pywrapfst.pyx":3954
*
*
* def shortestdistance(_Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_49shortestdistance, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4005, __pyx_L1_error)
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_47shortestdistance, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3954, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_1) < 0) __PYX_ERR(0, 4005, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_1) < 0) __PYX_ERR(0, 3954, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":4051
+ /* "pywrapfst.pyx":3992
*
* cpdef _MutableFst shortestpath(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_k__61 = fst::kDelta;
+ __pyx_k__58 = fst::kDelta;
- /* "pywrapfst.pyx":4053
+ /* "pywrapfst.pyx":3994
* float delta=fst.kDelta,
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* queue_type=b"auto",
* bool unique=False,
*/
- __pyx_k__62 = fst::kNoStateId;
+ __pyx_k__59 = fst::kNoStateId;
- /* "pywrapfst.pyx":4051
+ /* "pywrapfst.pyx":3992
*
* cpdef _MutableFst shortestpath(_Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_k__61 = fst::kDelta;
+ __pyx_k__58 = fst::kDelta;
- /* "pywrapfst.pyx":4053
+ /* "pywrapfst.pyx":3994
* float delta=fst.kDelta,
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* queue_type=b"auto",
* bool unique=False,
*/
- __pyx_k__62 = fst::kNoStateId;
+ __pyx_k__59 = fst::kNoStateId;
- /* "pywrapfst.pyx":4207
+ /* "pywrapfst.pyx":4145
*
* 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, 4207, __pyx_L1_error)
- __pyx_k__63 = __pyx_t_6;
+ __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_vector); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4145, __pyx_L1_error)
+ __pyx_k__60 = __pyx_t_6;
- /* "pywrapfst.pyx":4208
+ /* "pywrapfst.pyx":4146
* 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, 4208, __pyx_L1_error)
- __pyx_k__64 = __pyx_t_6;
+ __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_standard); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4146, __pyx_L1_error)
+ __pyx_k__61 = __pyx_t_6;
- /* "pywrapfst.pyx":4306
+ /* "pywrapfst.pyx":4244
*
* @classmethod
* def open(cls, *filenames): # <<<<<<<<<<<<<<
* """
* FarReader.open(*filenames)
*/
- __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4306, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":4305
+ /* "pywrapfst.pyx":4243
* return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self))
*
* @classmethod # <<<<<<<<<<<<<<
* def open(cls, *filenames):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4305, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarReader->tp_dict, __pyx_n_s_open, __pyx_t_2) < 0) __PYX_ERR(0, 4306, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarReader->tp_dict, __pyx_n_s_open, __pyx_t_2) < 0) __PYX_ERR(0, 4244, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_FarReader);
- /* "pywrapfst.pyx":4468
+ /* "pywrapfst.pyx":4406
*
* @classmethod
* def create(cls, filename, arc_type=b"standard", far_type=b"default"): # <<<<<<<<<<<<<<
* """
* FarWriter.
*/
- __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4468, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4467
+ /* "pywrapfst.pyx":4405
* return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(self))
*
* @classmethod # <<<<<<<<<<<<<<
* def create(cls, filename, arc_type=b"standard", far_type=b"default"):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4467, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarWriter->tp_dict, __pyx_n_s_create, __pyx_t_1) < 0) __PYX_ERR(0, 4468, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarWriter->tp_dict, __pyx_n_s_create, __pyx_t_1) < 0) __PYX_ERR(0, 4406, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_FarWriter);
- /* "pywrapfst.pyx":4567
+ /* "pywrapfst.pyx":4505
*
*
* _fst_error_fatal_old = fst.FLAGS_fst_error_fatal # <<<<<<<<<<<<<<
* fst.FLAGS_fst_error_fatal = False
*
*/
- __pyx_t_1 = __Pyx_PyBool_FromLong(FLAGS_fst_error_fatal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4567, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(FLAGS_fst_error_fatal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4505, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_fst_error_fatal_old, __pyx_t_1) < 0) __PYX_ERR(0, 4567, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_fst_error_fatal_old, __pyx_t_1) < 0) __PYX_ERR(0, 4505, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":4568
+ /* "pywrapfst.pyx":4506
*
* _fst_error_fatal_old = fst.FLAGS_fst_error_fatal
* fst.FLAGS_fst_error_fatal = False # <<<<<<<<<<<<<<
*/
FLAGS_fst_error_fatal = 0;
- /* "pywrapfst.pyx":4571
+ /* "pywrapfst.pyx":4509
*
*
* @atexit.register # <<<<<<<<<<<<<<
* def _reset_fst_error_fatal():
* fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_atexit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4571, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_atexit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4571, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":4572
+ /* "pywrapfst.pyx":4510
*
* @atexit.register
* def _reset_fst_error_fatal(): # <<<<<<<<<<<<<<
* fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
*
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_57_reset_fst_error_fatal, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4572, __pyx_L1_error)
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_55_reset_fst_error_fatal, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4510, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4571, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4509, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4571, __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, 4509, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4571, __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, 4509, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else
#endif
{
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4571, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4509, __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_2);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4571, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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_1) < 0) __PYX_ERR(0, 4572, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_reset_fst_error_fatal, __pyx_t_1) < 0) __PYX_ERR(0, 4510, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "pywrapfst.pyx":1
return 0;
}
-/* PyIntBinop */
- #if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
- if (op1 == op2) {
- Py_RETURN_TRUE;
- }
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long a = PyInt_AS_LONG(op1);
- if (a == b) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS
- if (likely(PyLong_CheckExact(op1))) {
- const long b = intval;
- long a;
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- a = likely(size) ? digits[0] : 0;
- if (size == -1) a = -a;
- } else {
- switch (size) {
- case -2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case 2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case -3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case 3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case -4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case 4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
- default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
- #else
- default: Py_RETURN_FALSE;
- #endif
- }
- }
- if (a == b) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
- }
- #endif
- if (PyFloat_CheckExact(op1)) {
- const long b = intval;
- double a = PyFloat_AS_DOUBLE(op1);
- if ((double)a == (double)b) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
- }
- return PyObject_RichCompare(op1, op2, Py_EQ);
-}
-#endif
-
/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
return -1;
}
-/* BytesEquals */
- static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
- return PyObject_RichCompareBool(s1, s2, equals);
-#else
- if (s1 == s2) {
- return (equals == Py_EQ);
- } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
- const char *ps1, *ps2;
- Py_ssize_t length = PyBytes_GET_SIZE(s1);
- if (length != PyBytes_GET_SIZE(s2))
- return (equals == Py_NE);
- ps1 = PyBytes_AS_STRING(s1);
- ps2 = PyBytes_AS_STRING(s2);
- if (ps1[0] != ps2[0]) {
- return (equals == Py_NE);
- } else if (length == 1) {
- return (equals == Py_EQ);
- } else {
- int result = memcmp(ps1, ps2, (size_t)length);
- return (equals == Py_EQ) ? (result == 0) : (result != 0);
- }
- } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
- return (equals == Py_NE);
- } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
- return (equals == Py_NE);
- } else {
- int result;
- PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
- if (!py_result)
- return -1;
- result = __Pyx_PyObject_IsTrue(py_result);
- Py_DECREF(py_result);
- return result;
- }
-#endif
-}
-
/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
return 0;
}
+/* VoidPtrExport */
+ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
+ PyObject *d;
+ PyObject *cobj = 0;
+ d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi);
+ Py_XINCREF(d);
+ if (!d) {
+ d = PyDict_New();
+ if (!d)
+ goto bad;
+ if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0)
+ goto bad;
+ }
+#if PY_VERSION_HEX >= 0x02070000
+ cobj = PyCapsule_New(p, sig, 0);
+#else
+ cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0);
+#endif
+ if (!cobj)
+ goto bad;
+ if (PyDict_SetItem(d, name, cobj) < 0)
+ goto bad;
+ Py_DECREF(cobj);
+ Py_DECREF(d);
+ return 0;
+bad:
+ Py_XDECREF(cobj);
+ Py_XDECREF(d);
+ return -1;
+}
+
/* FunctionExport */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
PyObject *d = 0;