-/* Generated by Cython 0.29.20 */
+/* Generated by Cython 0.29.21 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
#error Cython requires Python 2.6+ or Python 3.3+.
#else
-#define CYTHON_ABI "0_29_20"
-#define CYTHON_HEX_VERSION 0x001D14F0
+#define CYTHON_ABI "0_29_21"
+#define CYTHON_HEX_VERSION 0x001D15F0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
+ #else
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
+ #endif
#else
#define CYTHON_PEP393_ENABLED 0
#define PyUnicode_1BYTE_KIND 1
#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
- #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
#else
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
*/
typedef fst::script::EncodeMapperClass *__pyx_t_9pywrapfst_EncodeMapperClass_ptr;
-/* "pywrapfst.pxd":243
+/* "pywrapfst.pxd":241
*
*
* ctypedef fst.FstClass * FstClass_ptr # <<<<<<<<<<<<<<
*/
typedef fst::script::FstClass *__pyx_t_9pywrapfst_FstClass_ptr;
-/* "pywrapfst.pxd":244
+/* "pywrapfst.pxd":242
*
* ctypedef fst.FstClass * FstClass_ptr
* ctypedef const fst.FstClass * const_FstClass_ptr # <<<<<<<<<<<<<<
*/
typedef fst::script::FstClass const *__pyx_t_9pywrapfst_const_FstClass_ptr;
-/* "pywrapfst.pxd":245
+/* "pywrapfst.pxd":243
* ctypedef fst.FstClass * FstClass_ptr
* ctypedef const fst.FstClass * const_FstClass_ptr
* ctypedef fst.MutableFstClass * MutableFstClass_ptr # <<<<<<<<<<<<<<
*/
typedef fst::script::MutableFstClass *__pyx_t_9pywrapfst_MutableFstClass_ptr;
-/* "pywrapfst.pxd":246
+/* "pywrapfst.pxd":244
* ctypedef const fst.FstClass * const_FstClass_ptr
* ctypedef fst.MutableFstClass * MutableFstClass_ptr
* ctypedef fst.VectorFstClass * VectorFstClass_ptr # <<<<<<<<<<<<<<
*/
typedef fst::script::VectorFstClass *__pyx_t_9pywrapfst_VectorFstClass_ptr;
-/* "pywrapfst.pxd":262
+/* "pywrapfst.pxd":260
* cpdef Fst copy(self)
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
bool show_weight_one;
};
-/* "pywrapfst.pxd":294
+/* "pywrapfst.pxd":292
* cpdef _FstSymbolTableView output_symbols(self)
*
* cpdef string print(self, # <<<<<<<<<<<<<<
PyObject *missing_sym;
};
-/* "pywrapfst.pxd":329
+/* "pywrapfst.pxd":325
* cpdef void add_states(self, size_t)
*
* cdef void _arcsort(self, sort_type=?) except * # <<<<<<<<<<<<<<
PyObject *sort_type;
};
-/* "pywrapfst.pxd":331
+/* "pywrapfst.pxd":327
* cdef void _arcsort(self, sort_type=?) except *
*
* cdef void _closure(self, bool closure_plus=?) # <<<<<<<<<<<<<<
bool closure_plus;
};
-/* "pywrapfst.pxd":339
+/* "pywrapfst.pxd":335
* cdef void _decode(self, EncodeMapper) except *
*
* cdef void _delete_arcs(self, int64 state, size_t n=?) except * # <<<<<<<<<<<<<<
size_t n;
};
-/* "pywrapfst.pxd":341
+/* "pywrapfst.pxd":337
* cdef void _delete_arcs(self, int64 state, size_t n=?) except *
*
* cdef void _delete_states(self, states=?) except * # <<<<<<<<<<<<<<
PyObject *states;
};
-/* "pywrapfst.pxd":347
+/* "pywrapfst.pxd":343
* cdef void _invert(self)
*
* cdef void _minimize(self, float delta=?, bool allow_nondet=?) except * # <<<<<<<<<<<<<<
bool allow_nondet;
};
-/* "pywrapfst.pxd":355
+/* "pywrapfst.pxd":351
* cdef void _project(self, project_type) except *
*
* cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except * # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":357
+/* "pywrapfst.pxd":353
* cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except *
*
* cdef void _push(self, # <<<<<<<<<<<<<<
bool to_final;
};
-/* "pywrapfst.pxd":362
+/* "pywrapfst.pxd":358
* bool to_final=?)
*
* cdef void _relabel_pairs(self, ipairs=?, opairs=?) except * # <<<<<<<<<<<<<<
PyObject *opairs;
};
-/* "pywrapfst.pxd":364
+/* "pywrapfst.pxd":360
* cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *
*
* cdef void _relabel_tables(self, # <<<<<<<<<<<<<<
bool attach_new_osymbols;
};
-/* "pywrapfst.pxd":378
+/* "pywrapfst.pxd":374
* cdef void _reserve_states(self, int64 n)
*
* cdef void _reweight(self, potentials, bool to_final=?) except * # <<<<<<<<<<<<<<
bool to_final;
};
-/* "pywrapfst.pxd":380
+/* "pywrapfst.pxd":376
* cdef void _reweight(self, potentials, bool to_final=?) except *
*
* cdef void _rmepsilon(self, # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":387
+/* "pywrapfst.pxd":383
* float delta=?) except *
*
* cdef void _set_final(self, int64 state, weight=?) except * # <<<<<<<<<<<<<<
*
- * cdef void _set_properties(self, uint64 props, uint64 mask)
+ * cdef void _set_start(self, int64 state) except *
*/
struct __pyx_opt_args_9pywrapfst_10MutableFst__set_final {
int __pyx_n;
PyObject *weight;
};
-/* "pywrapfst.pxd":495
+/* "pywrapfst.pxd":489
*
*
* cdef Fst _map(Fst ifst, float delta=?, map_type=?, double power=?, weight=?) # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":497
+/* "pywrapfst.pxd":491
* cdef Fst _map(Fst ifst, float delta=?, map_type=?, double power=?, weight=?)
*
* cpdef Fst arcmap(Fst ifst, float delta=?, map_type=?, double power=?, weight=?) # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":499
+/* "pywrapfst.pxd":493
* cpdef Fst arcmap(Fst ifst, float delta=?, map_type=?, double power=?, weight=?)
*
* cpdef MutableFst compose(Fst ifst1, # <<<<<<<<<<<<<<
bool connect;
};
-/* "pywrapfst.pxd":504
+/* "pywrapfst.pxd":498
* bool connect=?)
*
* cpdef Fst convert(Fst ifst, fst_type=?) # <<<<<<<<<<<<<<
PyObject *fst_type;
};
-/* "pywrapfst.pxd":506
+/* "pywrapfst.pxd":500
* cpdef Fst convert(Fst ifst, fst_type=?)
*
* cpdef MutableFst determinize(Fst ifst, # <<<<<<<<<<<<<<
bool increment_subsequential_label;
};
-/* "pywrapfst.pxd":514
+/* "pywrapfst.pxd":508
* bool increment_subsequential_label=?)
*
* cpdef MutableFst difference(Fst ifst1, # <<<<<<<<<<<<<<
bool connect;
};
-/* "pywrapfst.pxd":519
+/* "pywrapfst.pxd":513
* bool connect=?)
*
* cpdef MutableFst disambiguate(Fst ifst, # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":525
+/* "pywrapfst.pxd":519
* weight=?)
*
* cpdef MutableFst epsnormalize(Fst ifst, bool eps_norm_output=?) # <<<<<<<<<<<<<<
bool eps_norm_output;
};
-/* "pywrapfst.pxd":527
+/* "pywrapfst.pxd":521
* cpdef MutableFst epsnormalize(Fst ifst, bool eps_norm_output=?)
*
* cpdef bool equal(Fst ifst1, Fst ifst2, float delta=?) # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":529
+/* "pywrapfst.pxd":523
* cpdef bool equal(Fst ifst1, Fst ifst2, float delta=?)
*
* cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=?) except * # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":531
+/* "pywrapfst.pxd":525
* cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=?) except *
*
* cpdef MutableFst intersect(Fst ifst1, # <<<<<<<<<<<<<<
bool connect;
};
-/* "pywrapfst.pxd":536
+/* "pywrapfst.pxd":530
* bool connect=?)
*
* cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=?) # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":538
+/* "pywrapfst.pxd":532
* cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=?)
*
* cpdef MutableFst prune(Fst ifst, # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":543
+/* "pywrapfst.pxd":537
* weight=?)
*
* cpdef MutableFst push(Fst ifst, # <<<<<<<<<<<<<<
bool to_final;
};
-/* "pywrapfst.pxd":551
+/* "pywrapfst.pxd":545
* bool to_final=?)
*
* cpdef bool randequivalent(Fst ifst1, # <<<<<<<<<<<<<<
uint64 seed;
};
-/* "pywrapfst.pxd":559
+/* "pywrapfst.pxd":553
* uint64 seed=?) except *
*
* cpdef MutableFst randgen(Fst ifst, # <<<<<<<<<<<<<<
uint64 seed;
};
-/* "pywrapfst.pxd":567
+/* "pywrapfst.pxd":561
* uint64 seed=?)
*
* cpdef MutableFst replace(pairs, # <<<<<<<<<<<<<<
int64 return_label;
};
-/* "pywrapfst.pxd":573
+/* "pywrapfst.pxd":567
* int64 return_label=?)
*
* cpdef MutableFst reverse(Fst ifst, bool require_superinitial=?) # <<<<<<<<<<<<<<
bool require_superinitial;
};
-/* "pywrapfst.pxd":575
+/* "pywrapfst.pxd":569
* cpdef MutableFst reverse(Fst ifst, bool require_superinitial=?)
*
* cdef void _shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
bool reverse;
};
-/* "pywrapfst.pxd":582
+/* "pywrapfst.pxd":576
* bool reverse=?) except *
*
* cpdef MutableFst shortestpath(Fst ifst, # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":249
+/* "pywrapfst.pxd":247
*
*
* cdef class Fst(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":317
+/* "pywrapfst.pxd":313
*
*
* cdef class MutableFst(Fst): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":400
+/* "pywrapfst.pxd":394
*
*
* cdef class VectorFst(MutableFst): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":422
+/* "pywrapfst.pxd":416
*
*
* cdef class Arc(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":432
+/* "pywrapfst.pxd":426
*
*
* cdef class ArcIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":454
+/* "pywrapfst.pxd":448
*
*
* cdef class MutableArcIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":478
+/* "pywrapfst.pxd":472
*
*
* cdef class StateIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":598
+/* "pywrapfst.pxd":592
*
*
* cdef class Compiler(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":619
+/* "pywrapfst.pxd":613
* # FarReader.
*
* cdef class FarReader(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":644
+/* "pywrapfst.pxd":638
* # FarWriter.
*
* cdef class FarWriter(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pyx":3266
+/* "pywrapfst.pyx":3271
*
* # Magic method used to get a Pythonic Iterator API out of the C++ API.
* def __iter__(self): # <<<<<<<<<<<<<<
-/* "pywrapfst.pyx":403
+/* "pywrapfst.pyx":404
*
*
* cdef class Weight: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Weight *__pyx_vtabptr_9pywrapfst_Weight;
-/* "pywrapfst.pyx":730
+/* "pywrapfst.pyx":731
*
*
* cdef class SymbolTableView: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *__pyx_vtabptr_9pywrapfst_SymbolTableView;
-/* "pywrapfst.pyx":933
+/* "pywrapfst.pyx":934
*
*
* cdef class _EncodeMapperSymbolTableView(SymbolTableView): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTableView *__pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTableView;
-/* "pywrapfst.pyx":957
+/* "pywrapfst.pyx":958
*
*
* cdef class _FstSymbolTableView(SymbolTableView): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__FstSymbolTableView *__pyx_vtabptr_9pywrapfst__FstSymbolTableView;
-/* "pywrapfst.pyx":980
+/* "pywrapfst.pyx":981
*
*
* cdef class _MutableSymbolTable(SymbolTableView): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
-/* "pywrapfst.pyx":1052
+/* "pywrapfst.pyx":1053
*
*
* cdef class _MutableFstSymbolTableView(_MutableSymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTableView *__pyx_vtabptr_9pywrapfst__MutableFstSymbolTableView;
-/* "pywrapfst.pyx":1067
+/* "pywrapfst.pyx":1068
*
*
* cdef class SymbolTable(_MutableSymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_SymbolTable *__pyx_vtabptr_9pywrapfst_SymbolTable;
-/* "pywrapfst.pyx":1295
+/* "pywrapfst.pyx":1296
*
*
* cdef class EncodeMapper: # <<<<<<<<<<<<<<
std::string (*arc_type)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
std::string (*weight_type)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
uint8 (*flags)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
- uint64 (*properties)(struct __pyx_obj_9pywrapfst_EncodeMapper *, uint64, int __pyx_skip_dispatch);
void (*write)(struct __pyx_obj_9pywrapfst_EncodeMapper *, PyObject *, int __pyx_skip_dispatch);
PyObject *(*write_to_string)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *(*input_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
static struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *__pyx_vtabptr_9pywrapfst_EncodeMapper;
-/* "pywrapfst.pyx":1561
+/* "pywrapfst.pyx":1563
*
*
* cdef class Fst: # <<<<<<<<<<<<<<
size_t (*num_output_epsilons)(struct __pyx_obj_9pywrapfst_Fst *, int64, int __pyx_skip_dispatch);
struct __pyx_obj_9pywrapfst__FstSymbolTableView *(*output_symbols)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch);
std::string (*print)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_print *__pyx_optional_args);
- uint64 (*properties)(struct __pyx_obj_9pywrapfst_Fst *, uint64, bool, int __pyx_skip_dispatch);
int64 (*start)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch);
struct __pyx_obj_9pywrapfst_StateIterator *(*states)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch);
bool (*verify)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch);
static struct __pyx_vtabstruct_9pywrapfst_Fst *__pyx_vtabptr_9pywrapfst_Fst;
-/* "pywrapfst.pyx":2026
+/* "pywrapfst.pyx":2028
*
*
* cdef class MutableFst(Fst): # <<<<<<<<<<<<<<
void (*_reweight)(struct __pyx_obj_9pywrapfst_MutableFst *, PyObject *, struct __pyx_opt_args_9pywrapfst_10MutableFst__reweight *__pyx_optional_args);
void (*_rmepsilon)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__rmepsilon *__pyx_optional_args);
void (*_set_final)(struct __pyx_obj_9pywrapfst_MutableFst *, int64, struct __pyx_opt_args_9pywrapfst_10MutableFst__set_final *__pyx_optional_args);
- void (*_set_properties)(struct __pyx_obj_9pywrapfst_MutableFst *, uint64, uint64);
void (*_set_start)(struct __pyx_obj_9pywrapfst_MutableFst *, int64);
void (*_set_input_symbols)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst_SymbolTableView *);
void (*_set_output_symbols)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst_SymbolTableView *);
static struct __pyx_vtabstruct_9pywrapfst_MutableFst *__pyx_vtabptr_9pywrapfst_MutableFst;
-/* "pywrapfst.pyx":2891
+/* "pywrapfst.pyx":2890
*
*
* cdef class VectorFst(MutableFst): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_VectorFst *__pyx_vtabptr_9pywrapfst_VectorFst;
-/* "pywrapfst.pyx":3068
+/* "pywrapfst.pyx":3073
*
*
* cdef class Arc: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Arc *__pyx_vtabptr_9pywrapfst_Arc;
-/* "pywrapfst.pyx":3135
+/* "pywrapfst.pyx":3140
*
*
* cdef class ArcIterator: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_ArcIterator *__pyx_vtabptr_9pywrapfst_ArcIterator;
-/* "pywrapfst.pyx":3246
+/* "pywrapfst.pyx":3251
*
*
* cdef class MutableArcIterator: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *__pyx_vtabptr_9pywrapfst_MutableArcIterator;
-/* "pywrapfst.pyx":3366
+/* "pywrapfst.pyx":3371
*
*
* cdef class StateIterator: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_StateIterator *__pyx_vtabptr_9pywrapfst_StateIterator;
-/* "pywrapfst.pyx":4275
+/* "pywrapfst.pyx":4280
*
*
* cdef class Compiler: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Compiler *__pyx_vtabptr_9pywrapfst_Compiler;
-/* "pywrapfst.pyx":4412
+/* "pywrapfst.pyx":4417
*
*
* cdef class FarReader: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_FarReader *__pyx_vtabptr_9pywrapfst_FarReader;
-/* "pywrapfst.pyx":4567
+/* "pywrapfst.pyx":4572
*
*
* cdef class FarWriter: # <<<<<<<<<<<<<<
#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);
+/* SetNameInClass.proto */
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
+#define __Pyx_SetNameInClass(ns, name, value)\
+ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
+#elif CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_SetNameInClass(ns, name, value)\
+ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
+#else
+#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
+#endif
+
+/* PyObjectGetMethod.proto */
+static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
+
+/* PyObjectCallMethod0.proto */
+static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
+
+/* RaiseNoneIterError.proto */
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+
+/* UnpackTupleError.proto */
+static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
+
+/* UnpackTuple2.proto */
+#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
+ (likely(is_tuple || PyTuple_Check(tuple)) ?\
+ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
+ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
+ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
+ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
+static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
+ PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
+static int __Pyx_unpack_tuple2_generic(
+ PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
+
+/* dict_iter.proto */
+static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
+ Py_ssize_t* p_orig_length, int* p_is_dict);
+static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
+ PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
+
+/* GetAttr.proto */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+
+/* Globals.proto */
+static PyObject* __Pyx_Globals(void);
+
/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *);
/* CIntFromPy.proto */
-static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *);
-
-/* CIntFromPy.proto */
static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *);
/* CIntFromPy.proto */
+static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *);
+
+/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
/* CIntFromPy.proto */
/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
-/* PyObjectGetMethod.proto */
-static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
-
/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
static std::string __pyx_f_9pywrapfst_12EncodeMapper_arc_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_12EncodeMapper_weight_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static uint8 __pyx_f_9pywrapfst_12EncodeMapper_flags(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
-static uint64 __pyx_f_9pywrapfst_12EncodeMapper_properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, uint64 __pyx_v_mask, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_12EncodeMapper_write(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_9pywrapfst_12EncodeMapper_write_to_string(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_9pywrapfst_12EncodeMapper_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_3Fst_num_output_epsilons(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_f_9pywrapfst_3Fst_output_symbols(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_3Fst_print(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_print *__pyx_optional_args); /* proto*/
-static uint64 __pyx_f_9pywrapfst_3Fst_properties(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, uint64 __pyx_v_mask, bool __pyx_v_test, int __pyx_skip_dispatch); /* proto*/
static int64 __pyx_f_9pywrapfst_3Fst_start(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst_StateIterator *__pyx_f_9pywrapfst_3Fst_states(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_3Fst_verify(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__set_final(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, struct __pyx_opt_args_9pywrapfst_10MutableFst__set_final *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__set_input_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__set_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto*/
-static void __pyx_f_9pywrapfst_10MutableFst__set_properties(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, uint64 __pyx_v_props, uint64 __pyx_v_mask); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__set_start(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__topsort(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto*/
static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst_3Arc_copy(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static enum fst::QueueType __pyx_f_9pywrapfst__get_queue_type(std::string const &); /*proto*/
static enum fst::script::RandArcSelection __pyx_f_9pywrapfst__get_rand_arc_selection(std::string const &); /*proto*/
static enum fst::ReplaceLabelType __pyx_f_9pywrapfst__get_replace_label_type(std::string const &, bool); /*proto*/
-static fst::script::WeightClass __pyx_f_9pywrapfst__get_WeightClass_or_One(std::string const &, PyObject *); /*proto*/
-static fst::script::WeightClass __pyx_f_9pywrapfst__get_WeightClass_or_Zero(std::string const &, PyObject *); /*proto*/
-static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__Zero(PyObject *); /*proto*/
-static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__One(PyObject *); /*proto*/
-static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__NoWeight(PyObject *); /*proto*/
+static fst::script::WeightClass __pyx_f_9pywrapfst__get_WeightClass_or_one(std::string const &, PyObject *); /*proto*/
+static fst::script::WeightClass __pyx_f_9pywrapfst__get_WeightClass_or_zero(std::string const &, PyObject *); /*proto*/
+static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__zero(PyObject *); /*proto*/
+static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__one(PyObject *); /*proto*/
+static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__no_weight(PyObject *); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__plus(struct __pyx_obj_9pywrapfst_Weight *, struct __pyx_obj_9pywrapfst_Weight *); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__times(struct __pyx_obj_9pywrapfst_Weight *, struct __pyx_obj_9pywrapfst_Weight *); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__divide(struct __pyx_obj_9pywrapfst_Weight *, struct __pyx_obj_9pywrapfst_Weight *); /*proto*/
static const char __pyx_k_os[] = "os";
static const char __pyx_k_Arc[] = "Arc";
static const char __pyx_k_Fst[] = "Fst";
-static const char __pyx_k_One[] = "One";
static const char __pyx_k__11[] = "";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_arc[] = "arc";
static const char __pyx_k_dot[] = "dot";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_lhs[] = "lhs";
+static const char __pyx_k_one[] = "one";
static const char __pyx_k_rhs[] = "rhs";
static const char __pyx_k_sys[] = "sys";
+static const char __pyx_k_Flag[] = "Flag";
static const char __pyx_k_PIPE[] = "PIPE";
static const char __pyx_k_Tsvg[] = "-Tsvg";
-static const char __pyx_k_Zero[] = "Zero";
static const char __pyx_k_arcs[] = "arcs";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_auto[] = "auto";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_done[] = "done";
static const char __pyx_k_draw[] = "draw";
+static const char __pyx_k_enum[] = "enum";
static const char __pyx_k_find[] = "find";
static const char __pyx_k_ifst[] = "ifst";
static const char __pyx_k_iter[] = "__iter__";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_test[] = "test";
static const char __pyx_k_type[] = "type";
+static const char __pyx_k_zero[] = "zero";
static const char __pyx_k_ERROR[] = "ERROR";
static const char __pyx_k_Popen[] = "Popen";
static const char __pyx_k_at_0x[] = " at 0x";
static const char __pyx_k_ifst1[] = "ifst1";
static const char __pyx_k_ifst2[] = "ifst2";
static const char __pyx_k_input[] = "input";
+static const char __pyx_k_items[] = "items";
static const char __pyx_k_npath[] = "npath";
static const char __pyx_k_pairs[] = "pairs";
static const char __pyx_k_power[] = "power";
static const char __pyx_k_get_fst[] = "get_fst";
static const char __pyx_k_get_key[] = "get_key";
static const char __pyx_k_logging[] = "logging";
+static const char __pyx_k_members[] = "__members__";
static const char __pyx_k_neither[] = "neither";
static const char __pyx_k_nodesep[] = "nodesep";
static const char __pyx_k_numbers[] = "numbers";
static const char __pyx_k_FstError[] = "FstError";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_NO_LABEL[] = "NO_LABEL";
-static const char __pyx_k_NoWeight[] = "NoWeight";
static const char __pyx_k_SortType[] = "SortType";
static const char __pyx_k_WEIGHTED[] = "WEIGHTED";
static const char __pyx_k_Weight_2[] = "Weight";
static const char __pyx_k_add_table[] = "add_table";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_nextstate[] = "nextstate";
+static const char __pyx_k_no_weight[] = "no_weight";
static const char __pyx_k_nshortest[] = "nshortest";
static const char __pyx_k_precision[] = "precision";
static const char __pyx_k_pywrapfst[] = "<pywrapfst>";
static const char __pyx_k_max_length[] = "max_length";
static const char __pyx_k_num_states[] = "num_states";
static const char __pyx_k_potentials[] = "potentials";
-static const char __pyx_k_properties[] = "properties";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_queue_type[] = "queue_type";
static const char __pyx_k_subprocess[] = "subprocess";
static const char __pyx_k_Conversion_to[] = "Conversion to ";
static const char __pyx_k_ENCODE_LABELS[] = "ENCODE_LABELS";
static const char __pyx_k_FstIndexError[] = "FstIndexError";
+static const char __pyx_k_FstProperties[] = "FstProperties";
static const char __pyx_k_NO_I_EPSILONS[] = "NO_I_EPSILONS";
static const char __pyx_k_NO_O_EPSILONS[] = "NO_O_EPSILONS";
static const char __pyx_k_StateIterator[] = "StateIterator";
static PyObject *__pyx_n_s_FarType;
static PyObject *__pyx_n_s_FarWriter;
static PyObject *__pyx_kp_u_FarWriter_at_0x;
+static PyObject *__pyx_n_s_Flag;
static PyObject *__pyx_n_s_Fst;
static PyObject *__pyx_n_s_FstArgError;
static PyObject *__pyx_n_s_FstBadWeightError;
static PyObject *__pyx_n_s_FstIOError;
static PyObject *__pyx_n_s_FstIndexError;
static PyObject *__pyx_n_s_FstOpError;
+static PyObject *__pyx_n_s_FstProperties;
static PyObject *__pyx_n_s_FstSymbolTableView;
static PyObject *__pyx_kp_u_Fst_SymbolTableView;
static PyObject *__pyx_kp_u_Fst_at_0x;
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_u_No_new_SymbolTables_specified;
static PyObject *__pyx_kp_u_No_relabeling_pairs_specified;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_s_O_EPSILONS;
static PyObject *__pyx_n_s_O_LABEL_INVARIANT_PROPERTIES;
static PyObject *__pyx_n_s_O_LABEL_SORTED;
-static PyObject *__pyx_n_s_One;
static PyObject *__pyx_kp_u_Open_failed;
static PyObject *__pyx_kp_u_Operation_failed;
static PyObject *__pyx_n_s_PIPE;
static PyObject *__pyx_kp_u_Weight_type_not_found;
static PyObject *__pyx_kp_u_Write_failed;
static PyObject *__pyx_kp_u_Write_to_string_failed;
-static PyObject *__pyx_n_s_Zero;
static PyObject *__pyx_kp_u__11;
static PyObject *__pyx_kp_u__2;
static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_n_s_draw;
static PyObject *__pyx_n_s_encode_labels;
static PyObject *__pyx_n_s_encode_weights;
+static PyObject *__pyx_n_s_enum;
static PyObject *__pyx_n_s_eps_norm_output;
static PyObject *__pyx_n_s_epsilon_on_replace;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_input_table;
static PyObject *__pyx_n_s_ipairs;
static PyObject *__pyx_n_s_isymbols;
+static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_iter;
static PyObject *__pyx_n_s_keep_isymbols;
static PyObject *__pyx_n_s_keep_osymbols;
static PyObject *__pyx_n_s_mask;
static PyObject *__pyx_n_s_max_length;
static PyObject *__pyx_n_s_member;
+static PyObject *__pyx_n_s_members;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_missing_sym;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_next;
static PyObject *__pyx_n_s_nextstate;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
+static PyObject *__pyx_n_s_no_weight;
static PyObject *__pyx_n_s_nodesep;
static PyObject *__pyx_n_s_npath;
static PyObject *__pyx_n_s_nshortest;
static PyObject *__pyx_n_s_olabel;
static PyObject *__pyx_n_s_old_isymbols;
static PyObject *__pyx_n_s_old_osymbols;
+static PyObject *__pyx_n_s_one;
static PyObject *__pyx_n_s_opairs;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_precision;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
-static PyObject *__pyx_n_s_properties;
static PyObject *__pyx_n_s_props;
static PyObject *__pyx_n_s_push_labels;
static PyObject *__pyx_n_s_push_weights;
static PyObject *__pyx_n_s_write_text;
static PyObject *__pyx_n_s_write_to_string;
static PyObject *__pyx_n_u_x;
+static PyObject *__pyx_n_s_zero;
static PyObject *__pyx_pf_9pywrapfst_6Weight___repr__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_2__str__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_4__float__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_6Weight_6__init__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, PyObject *__pyx_v_weight_type, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_8copy(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
-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_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_14no_weight(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_16__eq__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w2); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_18__ne__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w2); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_20to_string(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_8arc_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_10weight_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_12flags(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_14properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, uint64 __pyx_v_mask); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_14properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_16read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_18read_from_string(PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_20write(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_28num_output_epsilons(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_30output_symbols(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_32print(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_show_weight_one, PyObject *__pyx_v_missing_sym); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_3Fst_34properties(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, uint64 __pyx_v_mask, bool __pyx_v_test); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_3Fst_34properties(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_mask, bool __pyx_v_test); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_36read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_38read_from_string(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_40start(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_52set_final(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_54set_input_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_56set_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_10MutableFst_58set_properties(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, uint64 __pyx_v_props, uint64 __pyx_v_mask); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_10MutableFst_58set_properties(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_props, PyObject *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_60set_start(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_62topsort(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_64union(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_fsts2); /* proto */
static PyObject *__pyx_codeobj__70;
/* Late includes */
-/* "pywrapfst.pyx":174
+/* "pywrapfst.pyx":175
*
*
* cdef string tostring(data) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("tostring", 0);
- /* "pywrapfst.pyx":193
+ /* "pywrapfst.pyx":194
* """
* # A Python string can be implicitly cast to a C++ string.
* if isinstance(data, str): # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":194
+ /* "pywrapfst.pyx":195
* # A Python string can be implicitly cast to a C++ string.
* if isinstance(data, str):
* return data # <<<<<<<<<<<<<<
* raise TypeError(f"Expected {str.__name__} but received "
* f"{type(data).__name__}: {data!r}")
*/
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
- /* "pywrapfst.pyx":193
+ /* "pywrapfst.pyx":194
* """
* # A Python string can be implicitly cast to a C++ string.
* if isinstance(data, str): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":195
+ /* "pywrapfst.pyx":196
* if isinstance(data, str):
* return data
* raise TypeError(f"Expected {str.__name__} but received " # <<<<<<<<<<<<<<
* f"{type(data).__name__}: {data!r}")
*
*/
- __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = 0;
__pyx_t_6 = 127;
__pyx_t_5 += 9;
__Pyx_GIVEREF(__pyx_kp_u_Expected);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Expected);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyUnicode_Type)), __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyUnicode_Type)), __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6;
__Pyx_GIVEREF(__pyx_kp_u_but_received);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_but_received);
- /* "pywrapfst.pyx":196
+ /* "pywrapfst.pyx":197
* return data
* raise TypeError(f"Expected {str.__name__} but received "
* f"{type(data).__name__}: {data!r}") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
__pyx_t_5 += 2;
__Pyx_GIVEREF(__pyx_kp_u_);
PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_);
- __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_data), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_data), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
__pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_7);
__pyx_t_7 = 0;
- /* "pywrapfst.pyx":195
+ /* "pywrapfst.pyx":196
* if isinstance(data, str):
* return data
* raise TypeError(f"Expected {str.__name__} but received " # <<<<<<<<<<<<<<
* f"{type(data).__name__}: {data!r}")
*
*/
- __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 6, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 6, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 195, __pyx_L1_error)
+ __PYX_ERR(0, 196, __pyx_L1_error)
- /* "pywrapfst.pyx":174
+ /* "pywrapfst.pyx":175
*
*
* cdef string tostring(data) except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":199
+/* "pywrapfst.pyx":200
*
*
* cdef string weight_tostring(data) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("weight_tostring", 0);
- /* "pywrapfst.pyx":221
+ /* "pywrapfst.pyx":222
* """
* # A Python string can be implicitly cast to a C++ string.
* if isinstance(data, str): # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":222
+ /* "pywrapfst.pyx":223
* # A Python string can be implicitly cast to a C++ string.
* if isinstance(data, str):
* return data # <<<<<<<<<<<<<<
* elif isinstance(data, numbers.Number):
* return str(data)
*/
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
- /* "pywrapfst.pyx":221
+ /* "pywrapfst.pyx":222
* """
* # A Python string can be implicitly cast to a C++ string.
* if isinstance(data, str): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":223
+ /* "pywrapfst.pyx":224
* if isinstance(data, str):
* return data
* elif isinstance(data, numbers.Number): # <<<<<<<<<<<<<<
* return str(data)
* raise TypeError(f"Expected {str.__name__} but received "
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numbers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numbers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __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, 223, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Number); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = PyObject_IsInstance(__pyx_v_data, __pyx_t_5); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 223, __pyx_L1_error)
+ __pyx_t_2 = PyObject_IsInstance(__pyx_v_data, __pyx_t_5); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 224, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":224
+ /* "pywrapfst.pyx":225
* return data
* elif isinstance(data, numbers.Number):
* return str(data) # <<<<<<<<<<<<<<
* raise TypeError(f"Expected {str.__name__} but received "
* f"{type(data).__name__}: {data!r}")
*/
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_3;
goto __pyx_L0;
- /* "pywrapfst.pyx":223
+ /* "pywrapfst.pyx":224
* if isinstance(data, str):
* return data
* elif isinstance(data, numbers.Number): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":225
+ /* "pywrapfst.pyx":226
* elif isinstance(data, numbers.Number):
* return str(data)
* raise TypeError(f"Expected {str.__name__} but received " # <<<<<<<<<<<<<<
* f"{type(data).__name__}: {data!r}")
*
*/
- __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = 0;
__pyx_t_7 = 127;
__pyx_t_6 += 9;
__Pyx_GIVEREF(__pyx_kp_u_Expected);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Expected);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyUnicode_Type)), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyUnicode_Type)), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 225, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
__Pyx_GIVEREF(__pyx_kp_u_but_received);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_but_received);
- /* "pywrapfst.pyx":226
+ /* "pywrapfst.pyx":227
* return str(data)
* raise TypeError(f"Expected {str.__name__} but received "
* f"{type(data).__name__}: {data!r}") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 226, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 227, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
__pyx_t_6 += 2;
__Pyx_GIVEREF(__pyx_kp_u_);
PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u_);
- __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_data), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_data), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
__pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_4);
__pyx_t_4 = 0;
- /* "pywrapfst.pyx":225
+ /* "pywrapfst.pyx":226
* elif isinstance(data, numbers.Number):
* return str(data)
* raise TypeError(f"Expected {str.__name__} but received " # <<<<<<<<<<<<<<
* f"{type(data).__name__}: {data!r}")
*
*/
- __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_5, 6, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_5, 6, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __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, 225, __pyx_L1_error)
+ __PYX_ERR(0, 226, __pyx_L1_error)
- /* "pywrapfst.pyx":199
+ /* "pywrapfst.pyx":200
*
*
* cdef string weight_tostring(data) except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":229
+/* "pywrapfst.pyx":230
*
*
* cdef string path_tostring(data) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("path_tostring", 0);
- /* "pywrapfst.pyx":230
+ /* "pywrapfst.pyx":231
*
* cdef string path_tostring(data) except *:
* return tostring(os.fspath(data)) # <<<<<<<<<<<<<<
*
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fspath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fspath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
}
__pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_data);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_4 = __pyx_f_9pywrapfst_tostring(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error)
+ __pyx_t_4 = __pyx_f_9pywrapfst_tostring(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
goto __pyx_L0;
- /* "pywrapfst.pyx":229
+ /* "pywrapfst.pyx":230
*
*
* cdef string path_tostring(data) except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":233
+/* "pywrapfst.pyx":234
*
*
* cdef fst.FarType _get_far_type(const string &far_type) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_far_type", 0);
- /* "pywrapfst.pyx":249
+ /* "pywrapfst.pyx":250
* """
* cdef fst.FarType _far_type
* if not fst.GetFarType(far_type, addr(_far_type)): # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(fst::script::GetFarType(__pyx_v_far_type, (&__pyx_v__far_type)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":250
+ /* "pywrapfst.pyx":251
* cdef fst.FarType _far_type
* if not fst.GetFarType(far_type, addr(_far_type)):
* raise FstArgError(f"Unknown FAR type: {far_type!r}") # <<<<<<<<<<<<<<
* return _far_type
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_far_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_far_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_FAR_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_FAR_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __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, 250, __pyx_L1_error)
+ __PYX_ERR(0, 251, __pyx_L1_error)
- /* "pywrapfst.pyx":249
+ /* "pywrapfst.pyx":250
* """
* cdef fst.FarType _far_type
* if not fst.GetFarType(far_type, addr(_far_type)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":251
+ /* "pywrapfst.pyx":252
* if not fst.GetFarType(far_type, addr(_far_type)):
* raise FstArgError(f"Unknown FAR type: {far_type!r}")
* return _far_type # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__far_type;
goto __pyx_L0;
- /* "pywrapfst.pyx":233
+ /* "pywrapfst.pyx":234
*
*
* cdef fst.FarType _get_far_type(const string &far_type) except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":254
+/* "pywrapfst.pyx":255
*
*
* cdef fst.ComposeFilter _get_compose_filter( # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_compose_filter", 0);
- /* "pywrapfst.pyx":276
+ /* "pywrapfst.pyx":277
* """
* cdef fst.ComposeFilter _compose_filter
* if not fst.GetComposeFilter(compose_filter, addr(_compose_filter)): # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(fst::script::GetComposeFilter(__pyx_v_compose_filter, (&__pyx_v__compose_filter)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":277
+ /* "pywrapfst.pyx":278
* cdef fst.ComposeFilter _compose_filter
* if not fst.GetComposeFilter(compose_filter, addr(_compose_filter)):
* raise FstArgError(f"Unknown compose filter type: {compose_filter!r}") # <<<<<<<<<<<<<<
* return _compose_filter
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_compose_filter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_compose_filter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_compose_filter_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_compose_filter_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __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, 277, __pyx_L1_error)
+ __PYX_ERR(0, 278, __pyx_L1_error)
- /* "pywrapfst.pyx":276
+ /* "pywrapfst.pyx":277
* """
* cdef fst.ComposeFilter _compose_filter
* if not fst.GetComposeFilter(compose_filter, addr(_compose_filter)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":278
+ /* "pywrapfst.pyx":279
* if not fst.GetComposeFilter(compose_filter, addr(_compose_filter)):
* raise FstArgError(f"Unknown compose filter type: {compose_filter!r}")
* return _compose_filter # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__compose_filter;
goto __pyx_L0;
- /* "pywrapfst.pyx":254
+ /* "pywrapfst.pyx":255
*
*
* cdef fst.ComposeFilter _get_compose_filter( # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":281
+/* "pywrapfst.pyx":282
*
*
* cdef fst.DeterminizeType _get_determinize_type(const string &det_type) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_determinize_type", 0);
- /* "pywrapfst.pyx":297
+ /* "pywrapfst.pyx":298
* """
* cdef fst.DeterminizeType _det_type
* if not fst.GetDeterminizeType(det_type, addr(_det_type)): # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(fst::script::GetDeterminizeType(__pyx_v_det_type, (&__pyx_v__det_type)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":298
+ /* "pywrapfst.pyx":299
* cdef fst.DeterminizeType _det_type
* if not fst.GetDeterminizeType(det_type, addr(_det_type)):
* raise FstArgError(f"Unknown determinization type: {det_type!r}") # <<<<<<<<<<<<<<
* return _det_type
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_det_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_det_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_determinization_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_determinization_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __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, 298, __pyx_L1_error)
+ __PYX_ERR(0, 299, __pyx_L1_error)
- /* "pywrapfst.pyx":297
+ /* "pywrapfst.pyx":298
* """
* cdef fst.DeterminizeType _det_type
* if not fst.GetDeterminizeType(det_type, addr(_det_type)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":299
+ /* "pywrapfst.pyx":300
* if not fst.GetDeterminizeType(det_type, addr(_det_type)):
* raise FstArgError(f"Unknown determinization type: {det_type!r}")
* return _det_type # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__det_type;
goto __pyx_L0;
- /* "pywrapfst.pyx":281
+ /* "pywrapfst.pyx":282
*
*
* cdef fst.DeterminizeType _get_determinize_type(const string &det_type) except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":302
+/* "pywrapfst.pyx":303
*
*
* cdef fst.ProjectType _get_project_type(const string &project_type) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_project_type", 0);
- /* "pywrapfst.pyx":318
+ /* "pywrapfst.pyx":319
* """
* cdef fst.ProjectType _project_type
* if not fst.GetProjectType(project_type, addr(_project_type)): # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(fst::script::GetProjectType(__pyx_v_project_type, (&__pyx_v__project_type)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":319
+ /* "pywrapfst.pyx":320
* cdef fst.ProjectType _project_type
* if not fst.GetProjectType(project_type, addr(_project_type)):
* raise FstArgError(f"Unknown projection type: {project_type!r}") # <<<<<<<<<<<<<<
* return _project_type
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_project_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_project_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_projection_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_projection_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __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, 319, __pyx_L1_error)
+ __PYX_ERR(0, 320, __pyx_L1_error)
- /* "pywrapfst.pyx":318
+ /* "pywrapfst.pyx":319
* """
* cdef fst.ProjectType _project_type
* if not fst.GetProjectType(project_type, addr(_project_type)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":320
+ /* "pywrapfst.pyx":321
* if not fst.GetProjectType(project_type, addr(_project_type)):
* raise FstArgError(f"Unknown projection type: {project_type!r}")
* return _project_type # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__project_type;
goto __pyx_L0;
- /* "pywrapfst.pyx":302
+ /* "pywrapfst.pyx":303
*
*
* cdef fst.ProjectType _get_project_type(const string &project_type) except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":323
+/* "pywrapfst.pyx":324
*
*
* cdef fst.QueueType _get_queue_type(const string &queue_type) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_queue_type", 0);
- /* "pywrapfst.pyx":342
+ /* "pywrapfst.pyx":343
* """
* cdef fst.QueueType _queue_type
* if not fst.GetQueueType(queue_type, addr(_queue_type)): # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(fst::script::GetQueueType(__pyx_v_queue_type, (&__pyx_v__queue_type)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":343
+ /* "pywrapfst.pyx":344
* cdef fst.QueueType _queue_type
* if not fst.GetQueueType(queue_type, addr(_queue_type)):
* raise FstArgError(f"Unknown queue type: {queue_type!r}") # <<<<<<<<<<<<<<
* return _queue_type
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_queue_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_queue_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 344, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_queue_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_queue_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __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, 343, __pyx_L1_error)
+ __PYX_ERR(0, 344, __pyx_L1_error)
- /* "pywrapfst.pyx":342
+ /* "pywrapfst.pyx":343
* """
* cdef fst.QueueType _queue_type
* if not fst.GetQueueType(queue_type, addr(_queue_type)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":344
+ /* "pywrapfst.pyx":345
* if not fst.GetQueueType(queue_type, addr(_queue_type)):
* raise FstArgError(f"Unknown queue type: {queue_type!r}")
* return _queue_type # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__queue_type;
goto __pyx_L0;
- /* "pywrapfst.pyx":323
+ /* "pywrapfst.pyx":324
*
*
* cdef fst.QueueType _get_queue_type(const string &queue_type) except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":347
+/* "pywrapfst.pyx":348
*
*
* cdef fst.RandArcSelection _get_rand_arc_selection( # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_rand_arc_selection", 0);
- /* "pywrapfst.pyx":367
+ /* "pywrapfst.pyx":368
* """
* cdef fst.RandArcSelection _select
* if not fst.GetRandArcSelection(select, addr(_select)): # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(fst::script::GetRandArcSelection(__pyx_v_select, (&__pyx_v__select)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":368
+ /* "pywrapfst.pyx":369
* cdef fst.RandArcSelection _select
* if not fst.GetRandArcSelection(select, addr(_select)):
* raise FstArgError(f"Unknown random arc selection type: {select!r}") # <<<<<<<<<<<<<<
* return _select
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_select); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_select); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_random_arc_selection_typ, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_random_arc_selection_typ, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __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, 368, __pyx_L1_error)
+ __PYX_ERR(0, 369, __pyx_L1_error)
- /* "pywrapfst.pyx":367
+ /* "pywrapfst.pyx":368
* """
* cdef fst.RandArcSelection _select
* if not fst.GetRandArcSelection(select, addr(_select)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":369
+ /* "pywrapfst.pyx":370
* if not fst.GetRandArcSelection(select, addr(_select)):
* raise FstArgError(f"Unknown random arc selection type: {select!r}")
* return _select # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__select;
goto __pyx_L0;
- /* "pywrapfst.pyx":347
+ /* "pywrapfst.pyx":348
*
*
* cdef fst.RandArcSelection _get_rand_arc_selection( # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":372
+/* "pywrapfst.pyx":373
*
*
* cdef fst.ReplaceLabelType _get_replace_label_type( # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_replace_label_type", 0);
- /* "pywrapfst.pyx":393
+ /* "pywrapfst.pyx":394
* """
* cdef fst.ReplaceLabelType _replace_label_type
* if not fst.GetReplaceLabelType(replace_label_type, # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(fst::script::GetReplaceLabelType(__pyx_v_replace_label_type, __pyx_v_epsilon_on_replace, (&__pyx_v__replace_label_type)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":396
+ /* "pywrapfst.pyx":397
* epsilon_on_replace,
* addr(_replace_label_type)):
* raise FstArgError(f"Unknown replace label type: {replace_label_type!r}") # <<<<<<<<<<<<<<
* return _replace_label_type
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_replace_label_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_replace_label_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_replace_label_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_replace_label_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __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, 396, __pyx_L1_error)
+ __PYX_ERR(0, 397, __pyx_L1_error)
- /* "pywrapfst.pyx":393
+ /* "pywrapfst.pyx":394
* """
* cdef fst.ReplaceLabelType _replace_label_type
* if not fst.GetReplaceLabelType(replace_label_type, # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":397
+ /* "pywrapfst.pyx":398
* addr(_replace_label_type)):
* raise FstArgError(f"Unknown replace label type: {replace_label_type!r}")
* return _replace_label_type # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__replace_label_type;
goto __pyx_L0;
- /* "pywrapfst.pyx":372
+ /* "pywrapfst.pyx":373
*
*
* cdef fst.ReplaceLabelType _get_replace_label_type( # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":423
+/* "pywrapfst.pyx":424
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":424
+ /* "pywrapfst.pyx":425
*
* def __repr__(self):
* return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>" # <<<<<<<<<<<<<<
* def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "type");
- __PYX_ERR(0, 424, __pyx_L1_error)
+ __PYX_ERR(0, 425, __pyx_L1_error)
}
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_Weight);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "to_string");
- __PYX_ERR(0, 424, __pyx_L1_error)
+ __PYX_ERR(0, 425, __pyx_L1_error)
}
- __pyx_t_4 = __pyx_convert_PyUnicode_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, 424, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_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, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__pyx_t_2 += 6;
__Pyx_GIVEREF(__pyx_kp_u_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_at_0x);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__3);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":423
+ /* "pywrapfst.pyx":424
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":426
+/* "pywrapfst.pyx":427
* return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
*
* def __str__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "pywrapfst.pyx":427
+ /* "pywrapfst.pyx":428
*
* 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 '%.30s'", "to_string");
- __PYX_ERR(0, 427, __pyx_L1_error)
+ __PYX_ERR(0, 428, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_convert_PyUnicode_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, 427, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_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, 428, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":426
+ /* "pywrapfst.pyx":427
* return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
*
* def __str__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":432
+/* "pywrapfst.pyx":433
* # ValueError when that is not appropriate.
*
* def __float__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__float__", 0);
- /* "pywrapfst.pyx":433
+ /* "pywrapfst.pyx":434
*
* 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 '%.30s'", "to_string");
- __PYX_ERR(0, 433, __pyx_L1_error)
+ __PYX_ERR(0, 434, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_convert_PyUnicode_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, 433, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_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, 434, __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, 433, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __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":432
+ /* "pywrapfst.pyx":433
* # ValueError when that is not appropriate.
*
* def __float__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":435
+/* "pywrapfst.pyx":436
* return float(self.to_string())
*
* def __init__(self, weight_type, weight): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 435, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 436, __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, 435, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 436, __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, 435, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 436, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Weight.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":436
+ /* "pywrapfst.pyx":437
*
* 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 '%.30s'", "_weight");
- __PYX_ERR(0, 436, __pyx_L1_error)
+ __PYX_ERR(0, 437, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error)
- /* "pywrapfst.pyx":437
+ /* "pywrapfst.pyx":438
* def __init__(self, weight_type, weight):
* self._weight.reset(new fst.WeightClass(tostring(weight_type),
* weight_tostring(weight))) # <<<<<<<<<<<<<<
* self._check_weight()
*
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error)
- /* "pywrapfst.pyx":436
+ /* "pywrapfst.pyx":437
*
* 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":438
+ /* "pywrapfst.pyx":439
* self._weight.reset(new fst.WeightClass(tostring(weight_type),
* weight_tostring(weight)))
* self._check_weight() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
- __PYX_ERR(0, 438, __pyx_L1_error)
+ __PYX_ERR(0, 439, __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, 438, __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, 439, __pyx_L1_error)
- /* "pywrapfst.pyx":435
+ /* "pywrapfst.pyx":436
* return float(self.to_string())
*
* def __init__(self, weight_type, weight): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":440
+/* "pywrapfst.pyx":441
* self._check_weight()
*
* cdef void _check_weight(self) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_check_weight", 0);
- /* "pywrapfst.pyx":441
+ /* "pywrapfst.pyx":442
*
* 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 '%.30s'", "type");
- __PYX_ERR(0, 441, __pyx_L1_error)
+ __PYX_ERR(0, 442, __pyx_L1_error)
}
__pyx_t_1 = ((((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->type(__pyx_v_self, 0) == ((char const *)"none")) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":442
+ /* "pywrapfst.pyx":443
* cdef void _check_weight(self) except *:
* if self.type() == b"none":
* raise FstArgError("Weight type not found") # <<<<<<<<<<<<<<
* if not self.member():
* raise FstBadWeightError("Invalid weight")
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Weight_type_not_found) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Weight_type_not_found);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __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, 442, __pyx_L1_error)
+ __PYX_ERR(0, 443, __pyx_L1_error)
- /* "pywrapfst.pyx":441
+ /* "pywrapfst.pyx":442
*
* cdef void _check_weight(self) except *:
* if self.type() == b"none": # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":443
+ /* "pywrapfst.pyx":444
* if self.type() == b"none":
* raise FstArgError("Weight type not found")
* if not self.member(): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "member");
- __PYX_ERR(0, 443, __pyx_L1_error)
+ __PYX_ERR(0, 444, __pyx_L1_error)
}
__pyx_t_1 = ((!(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->member(__pyx_v_self, 0) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":444
+ /* "pywrapfst.pyx":445
* raise FstArgError("Weight type not found")
* if not self.member():
* raise FstBadWeightError("Invalid weight") # <<<<<<<<<<<<<<
*
* cpdef Weight copy(self):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Invalid_weight) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Invalid_weight);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
+ 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_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 444, __pyx_L1_error)
+ __PYX_ERR(0, 445, __pyx_L1_error)
- /* "pywrapfst.pyx":443
+ /* "pywrapfst.pyx":444
* if self.type() == b"none":
* raise FstArgError("Weight type not found")
* if not self.member(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":440
+ /* "pywrapfst.pyx":441
* self._check_weight()
*
* cdef void _check_weight(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":446
+/* "pywrapfst.pyx":447
* raise FstBadWeightError("Invalid weight")
*
* cpdef Weight copy(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __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, 447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_6Weight_9copy)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __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, 446, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 447, __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;
#endif
}
- /* "pywrapfst.pyx":452
+ /* "pywrapfst.pyx":453
* Returns a copy of the Weight.
* """
* cdef Weight _weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* _weight._weight.reset(new fst.WeightClass(deref(self._weight)))
* return _weight
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":453
+ /* "pywrapfst.pyx":454
* """
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(deref(self._weight))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 453, __pyx_L1_error)
+ __PYX_ERR(0, 454, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 453, __pyx_L1_error)
+ __PYX_ERR(0, 454, __pyx_L1_error)
}
__pyx_v__weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_weight)));
- /* "pywrapfst.pyx":454
+ /* "pywrapfst.pyx":455
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(deref(self._weight)))
* return _weight # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":446
+ /* "pywrapfst.pyx":447
* raise FstBadWeightError("Invalid weight")
*
* cpdef Weight copy(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 446, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_6Weight_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":460
+/* "pywrapfst.pyx":461
*
* @classmethod
- * def Zero(cls, weight_type): # <<<<<<<<<<<<<<
+ * def zero(cls, weight_type): # <<<<<<<<<<<<<<
* """
- * Weight.Zero(weight_type)
+ * Weight.zero(weight_type)
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_6Weight_11Zero(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /*proto*/
-static char __pyx_doc_9pywrapfst_6Weight_10Zero[] = "\n Weight.Zero(weight_type)\n\n Constructs semiring zero.\n ";
-static PyObject *__pyx_pw_9pywrapfst_6Weight_11Zero(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
+static PyObject *__pyx_pw_9pywrapfst_6Weight_11zero(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /*proto*/
+static char __pyx_doc_9pywrapfst_6Weight_10zero[] = "\n Weight.zero(weight_type)\n\n Constructs semiring zero.\n ";
+static PyObject *__pyx_pw_9pywrapfst_6Weight_11zero(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("Zero (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_6Weight_10Zero(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_weight_type));
+ __Pyx_RefNannySetupContext("zero (wrapper)", 0);
+ __pyx_r = __pyx_pf_9pywrapfst_6Weight_10zero(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_weight_type));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_6Weight_10Zero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
+static PyObject *__pyx_pf_9pywrapfst_6Weight_10zero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("Zero", 0);
+ __Pyx_RefNannySetupContext("zero", 0);
- /* "pywrapfst.pyx":466
+ /* "pywrapfst.pyx":467
* Constructs semiring zero.
* """
- * return _Zero(weight_type) # <<<<<<<<<<<<<<
+ * return _zero(weight_type) # <<<<<<<<<<<<<<
*
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__Zero(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__zero(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":460
+ /* "pywrapfst.pyx":461
*
* @classmethod
- * def Zero(cls, weight_type): # <<<<<<<<<<<<<<
+ * def zero(cls, weight_type): # <<<<<<<<<<<<<<
* """
- * Weight.Zero(weight_type)
+ * Weight.zero(weight_type)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("pywrapfst.Weight.Zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.Weight.zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":469
+/* "pywrapfst.pyx":470
*
* @classmethod
- * def One(cls, weight_type): # <<<<<<<<<<<<<<
+ * def one(cls, weight_type): # <<<<<<<<<<<<<<
* """
- * Weight.One(weight_type)
+ * Weight.one(weight_type)
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_6Weight_13One(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /*proto*/
-static char __pyx_doc_9pywrapfst_6Weight_12One[] = "\n Weight.One(weight_type)\n\n Constructs semiring One.\n ";
-static PyObject *__pyx_pw_9pywrapfst_6Weight_13One(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
+static PyObject *__pyx_pw_9pywrapfst_6Weight_13one(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /*proto*/
+static char __pyx_doc_9pywrapfst_6Weight_12one[] = "\n Weight.one(weight_type)\n\n Constructs semiring One.\n ";
+static PyObject *__pyx_pw_9pywrapfst_6Weight_13one(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("One (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_6Weight_12One(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_weight_type));
+ __Pyx_RefNannySetupContext("one (wrapper)", 0);
+ __pyx_r = __pyx_pf_9pywrapfst_6Weight_12one(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_weight_type));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_6Weight_12One(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
+static PyObject *__pyx_pf_9pywrapfst_6Weight_12one(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("One", 0);
+ __Pyx_RefNannySetupContext("one", 0);
- /* "pywrapfst.pyx":475
+ /* "pywrapfst.pyx":476
* Constructs semiring One.
* """
- * return _One(weight_type) # <<<<<<<<<<<<<<
+ * return _one(weight_type) # <<<<<<<<<<<<<<
*
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__One(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__one(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":469
+ /* "pywrapfst.pyx":470
*
* @classmethod
- * def One(cls, weight_type): # <<<<<<<<<<<<<<
+ * def one(cls, weight_type): # <<<<<<<<<<<<<<
* """
- * Weight.One(weight_type)
+ * Weight.one(weight_type)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("pywrapfst.Weight.One", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.Weight.one", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":478
+/* "pywrapfst.pyx":479
*
* @classmethod
- * def NoWeight(cls, weight_type): # <<<<<<<<<<<<<<
+ * def no_weight(cls, weight_type): # <<<<<<<<<<<<<<
* """
- * Weight.NoWeight(weight_type)
+ * Weight.no_weight(weight_type)
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_6Weight_15NoWeight(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /*proto*/
-static char __pyx_doc_9pywrapfst_6Weight_14NoWeight[] = "\n Weight.NoWeight(weight_type)\n\n Constructs a non-member weight in the semiring.\n ";
-static PyObject *__pyx_pw_9pywrapfst_6Weight_15NoWeight(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
+static PyObject *__pyx_pw_9pywrapfst_6Weight_15no_weight(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /*proto*/
+static char __pyx_doc_9pywrapfst_6Weight_14no_weight[] = "\n Weight.no_weight(weight_type)\n\n Constructs a non-member weight in the semiring.\n ";
+static PyObject *__pyx_pw_9pywrapfst_6Weight_15no_weight(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("NoWeight (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_6Weight_14NoWeight(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_weight_type));
+ __Pyx_RefNannySetupContext("no_weight (wrapper)", 0);
+ __pyx_r = __pyx_pf_9pywrapfst_6Weight_14no_weight(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_weight_type));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_6Weight_14NoWeight(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
+static PyObject *__pyx_pf_9pywrapfst_6Weight_14no_weight(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("NoWeight", 0);
+ __Pyx_RefNannySetupContext("no_weight", 0);
- /* "pywrapfst.pyx":484
+ /* "pywrapfst.pyx":485
* Constructs a non-member weight in the semiring.
* """
- * return _NoWeight(weight_type) # <<<<<<<<<<<<<<
+ * return _no_weight(weight_type) # <<<<<<<<<<<<<<
*
* def __eq__(Weight w1, Weight w2):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__NoWeight(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__no_weight(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":478
+ /* "pywrapfst.pyx":479
*
* @classmethod
- * def NoWeight(cls, weight_type): # <<<<<<<<<<<<<<
+ * def no_weight(cls, weight_type): # <<<<<<<<<<<<<<
* """
- * Weight.NoWeight(weight_type)
+ * Weight.no_weight(weight_type)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("pywrapfst.Weight.NoWeight", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.Weight.no_weight", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":486
- * return _NoWeight(weight_type)
+/* "pywrapfst.pyx":487
+ * return _no_weight(weight_type)
*
* def __eq__(Weight w1, Weight w2): # <<<<<<<<<<<<<<
* return fst.Eq(deref(w1._weight), deref(w2._weight))
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_ptype_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 486, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_ptype_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 487, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_6Weight_16__eq__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_w1), ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_w2));
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__eq__", 0);
- /* "pywrapfst.pyx":487
+ /* "pywrapfst.pyx":488
*
* def __eq__(Weight w1, Weight w2):
* return fst.Eq(deref(w1._weight), deref(w2._weight)) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_w1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 487, __pyx_L1_error)
+ __PYX_ERR(0, 488, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_w2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 487, __pyx_L1_error)
+ __PYX_ERR(0, 488, __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, 487, __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, 488, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":486
- * return _NoWeight(weight_type)
+ /* "pywrapfst.pyx":487
+ * return _no_weight(weight_type)
*
* def __eq__(Weight w1, Weight w2): # <<<<<<<<<<<<<<
* return fst.Eq(deref(w1._weight), deref(w2._weight))
return __pyx_r;
}
-/* "pywrapfst.pyx":489
+/* "pywrapfst.pyx":490
* return fst.Eq(deref(w1._weight), deref(w2._weight))
*
* def __ne__(Weight w1, Weight w2): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__ne__ (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_ptype_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 489, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_ptype_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 490, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_6Weight_18__ne__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_w1), ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_w2));
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__ne__", 0);
- /* "pywrapfst.pyx":490
+ /* "pywrapfst.pyx":491
*
* def __ne__(Weight w1, Weight w2):
* return not w1 == w2 # <<<<<<<<<<<<<<
* cpdef string to_string(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_w1), ((PyObject *)__pyx_v_w2), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 490, __pyx_L1_error)
+ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_w1), ((PyObject *)__pyx_v_w2), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 491, __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, 490, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":489
+ /* "pywrapfst.pyx":490
* return fst.Eq(deref(w1._weight), deref(w2._weight))
*
* def __ne__(Weight w1, Weight w2): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":492
+/* "pywrapfst.pyx":493
* return not w1 == w2
*
* cpdef string to_string(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __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, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_6Weight_21to_string)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __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, 492, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 493, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":493
+ /* "pywrapfst.pyx":494
*
* 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 '%.30s'", "_weight");
- __PYX_ERR(0, 493, __pyx_L1_error)
+ __PYX_ERR(0, 494, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_weight.get()->ToString();
goto __pyx_L0;
- /* "pywrapfst.pyx":492
+ /* "pywrapfst.pyx":493
* return not w1 == w2
*
* cpdef string to_string(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("to_string", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_6Weight_to_string(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_6Weight_to_string(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":495
+/* "pywrapfst.pyx":496
* return self._weight.get().ToString()
*
* cpdef string type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __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, 496, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_6Weight_23type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __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, 495, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":500
+ /* "pywrapfst.pyx":501
* 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 '%.30s'", "_weight");
- __PYX_ERR(0, 500, __pyx_L1_error)
+ __PYX_ERR(0, 501, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_weight.get()->Type();
goto __pyx_L0;
- /* "pywrapfst.pyx":495
+ /* "pywrapfst.pyx":496
* return self._weight.get().ToString()
*
* cpdef string type(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_6Weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_6Weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":502
+/* "pywrapfst.pyx":503
* return self._weight.get().Type()
*
* cpdef bool member(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_member); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __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, 503, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_6Weight_25member)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __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, 502, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":503
+ /* "pywrapfst.pyx":504
*
* cpdef bool member(self):
* return self._weight.get().Member() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 503, __pyx_L1_error)
+ __PYX_ERR(0, 504, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_weight.get()->Member();
goto __pyx_L0;
- /* "pywrapfst.pyx":502
+ /* "pywrapfst.pyx":503
* return self._weight.get().Type()
*
* cpdef bool member(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("member", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_6Weight_member(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_6Weight_member(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":506
+/* "pywrapfst.pyx":507
*
*
* cdef Weight _plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_plus", 0);
- /* "pywrapfst.pyx":507
+ /* "pywrapfst.pyx":508
*
* cdef Weight _plus(Weight lhs, Weight rhs):
* cdef Weight _weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
* deref(rhs._weight))))
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":508
+ /* "pywrapfst.pyx":509
* cdef Weight _plus(Weight lhs, Weight rhs):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 508, __pyx_L1_error)
+ __PYX_ERR(0, 509, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 508, __pyx_L1_error)
+ __PYX_ERR(0, 509, __pyx_L1_error)
}
- /* "pywrapfst.pyx":509
+ /* "pywrapfst.pyx":510
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._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 '%.30s'", "_weight");
- __PYX_ERR(0, 509, __pyx_L1_error)
+ __PYX_ERR(0, 510, __pyx_L1_error)
}
- /* "pywrapfst.pyx":508
+ /* "pywrapfst.pyx":509
* cdef Weight _plus(Weight lhs, Weight rhs):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight), # <<<<<<<<<<<<<<
*/
__pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::Plus((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));
- /* "pywrapfst.pyx":510
+ /* "pywrapfst.pyx":511
* _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
* deref(rhs._weight))))
* return _weight # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":506
+ /* "pywrapfst.pyx":507
*
*
* cdef Weight _plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":513
+/* "pywrapfst.pyx":514
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, 1); __PYX_ERR(0, 513, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "plus") < 0)) __PYX_ERR(0, 513, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "plus") < 0)) __PYX_ERR(0, 514, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 513, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __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, 513, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 513, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 514, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 514, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_plus(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("plus", 0);
- /* "pywrapfst.pyx":533
+ /* "pywrapfst.pyx":534
* FstBadWeightError: invalid weight.
* """
* cdef Weight _weight = _plus(lhs, rhs) # <<<<<<<<<<<<<<
* _weight._check_weight()
* return _weight
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__plus(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __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, 534, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":534
+ /* "pywrapfst.pyx":535
* """
* cdef Weight _weight = _plus(lhs, rhs)
* _weight._check_weight() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
- __PYX_ERR(0, 534, __pyx_L1_error)
+ __PYX_ERR(0, 535, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->_check_weight(__pyx_v__weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->_check_weight(__pyx_v__weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L1_error)
- /* "pywrapfst.pyx":535
+ /* "pywrapfst.pyx":536
* cdef Weight _weight = _plus(lhs, rhs)
* _weight._check_weight()
* return _weight # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v__weight);
goto __pyx_L0;
- /* "pywrapfst.pyx":513
+ /* "pywrapfst.pyx":514
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":538
+/* "pywrapfst.pyx":539
*
*
* cdef Weight _times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_times", 0);
- /* "pywrapfst.pyx":539
+ /* "pywrapfst.pyx":540
*
* cdef Weight _times(Weight lhs, Weight rhs):
* cdef Weight _weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
* deref(rhs._weight))))
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":540
+ /* "pywrapfst.pyx":541
* cdef Weight _times(Weight lhs, Weight rhs):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 540, __pyx_L1_error)
+ __PYX_ERR(0, 541, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 540, __pyx_L1_error)
+ __PYX_ERR(0, 541, __pyx_L1_error)
}
- /* "pywrapfst.pyx":541
+ /* "pywrapfst.pyx":542
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._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 '%.30s'", "_weight");
- __PYX_ERR(0, 541, __pyx_L1_error)
+ __PYX_ERR(0, 542, __pyx_L1_error)
}
- /* "pywrapfst.pyx":540
+ /* "pywrapfst.pyx":541
* cdef Weight _times(Weight lhs, Weight rhs):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight), # <<<<<<<<<<<<<<
*/
__pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::Times((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));
- /* "pywrapfst.pyx":542
+ /* "pywrapfst.pyx":543
* _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
* deref(rhs._weight))))
* return _weight # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":538
+ /* "pywrapfst.pyx":539
*
*
* cdef Weight _times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":545
+/* "pywrapfst.pyx":546
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, 1); __PYX_ERR(0, 545, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, 1); __PYX_ERR(0, 546, __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, 545, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "times") < 0)) __PYX_ERR(0, 546, __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, 545, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 546, __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, 545, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 545, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 546, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 546, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_2times(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("times", 0);
- /* "pywrapfst.pyx":565
+ /* "pywrapfst.pyx":566
* FstBadWeightError: Invalid weight.
* """
* cdef Weight _weight = _times(lhs, rhs) # <<<<<<<<<<<<<<
* _weight._check_weight()
* return _weight
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__times(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __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, 566, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":566
+ /* "pywrapfst.pyx":567
* """
* cdef Weight _weight = _times(lhs, rhs)
* _weight._check_weight() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
- __PYX_ERR(0, 566, __pyx_L1_error)
+ __PYX_ERR(0, 567, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->_check_weight(__pyx_v__weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->_check_weight(__pyx_v__weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L1_error)
- /* "pywrapfst.pyx":567
+ /* "pywrapfst.pyx":568
* cdef Weight _weight = _times(lhs, rhs)
* _weight._check_weight()
* return _weight # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v__weight);
goto __pyx_L0;
- /* "pywrapfst.pyx":545
+ /* "pywrapfst.pyx":546
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":570
+/* "pywrapfst.pyx":571
*
*
* cdef Weight _divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_divide", 0);
- /* "pywrapfst.pyx":571
+ /* "pywrapfst.pyx":572
*
* cdef Weight _divide(Weight lhs, Weight rhs):
* cdef Weight _weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
* deref(rhs._weight))))
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":572
+ /* "pywrapfst.pyx":573
* cdef Weight _divide(Weight lhs, Weight rhs):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 572, __pyx_L1_error)
+ __PYX_ERR(0, 573, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 572, __pyx_L1_error)
+ __PYX_ERR(0, 573, __pyx_L1_error)
}
- /* "pywrapfst.pyx":573
+ /* "pywrapfst.pyx":574
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._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 '%.30s'", "_weight");
- __PYX_ERR(0, 573, __pyx_L1_error)
+ __PYX_ERR(0, 574, __pyx_L1_error)
}
- /* "pywrapfst.pyx":572
+ /* "pywrapfst.pyx":573
* cdef Weight _divide(Weight lhs, Weight rhs):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight), # <<<<<<<<<<<<<<
*/
__pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::Divide((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));
- /* "pywrapfst.pyx":574
+ /* "pywrapfst.pyx":575
* _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
* deref(rhs._weight))))
* return _weight # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":570
+ /* "pywrapfst.pyx":571
*
*
* cdef Weight _divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":577
+/* "pywrapfst.pyx":578
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, 1); __PYX_ERR(0, 577, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, 1); __PYX_ERR(0, 578, __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, 577, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "divide") < 0)) __PYX_ERR(0, 578, __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, 577, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 578, __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, 577, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 577, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 578, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 578, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_4divide(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("divide", 0);
- /* "pywrapfst.pyx":599
+ /* "pywrapfst.pyx":600
* FstBadWeightError: Invalid weight.
* """
* cdef Weight _weight = _divide(lhs, rhs) # <<<<<<<<<<<<<<
* _weight._check_weight()
* return _weight
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__divide(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __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, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":600
+ /* "pywrapfst.pyx":601
* """
* cdef Weight _weight = _divide(lhs, rhs)
* _weight._check_weight() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
- __PYX_ERR(0, 600, __pyx_L1_error)
+ __PYX_ERR(0, 601, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->_check_weight(__pyx_v__weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->_check_weight(__pyx_v__weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 601, __pyx_L1_error)
- /* "pywrapfst.pyx":601
+ /* "pywrapfst.pyx":602
* cdef Weight _weight = _divide(lhs, rhs)
* _weight._check_weight()
* return _weight # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v__weight);
goto __pyx_L0;
- /* "pywrapfst.pyx":577
+ /* "pywrapfst.pyx":578
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":604
+/* "pywrapfst.pyx":605
*
*
* cdef Weight _power(Weight w, size_t n): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_power", 0);
- /* "pywrapfst.pyx":605
+ /* "pywrapfst.pyx":606
*
* cdef Weight _power(Weight w, size_t n):
* cdef Weight _weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* _weight._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
* return _weight
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":606
+ /* "pywrapfst.pyx":607
* cdef Weight _power(Weight w, size_t n):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 606, __pyx_L1_error)
+ __PYX_ERR(0, 607, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_w) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 606, __pyx_L1_error)
+ __PYX_ERR(0, 607, __pyx_L1_error)
}
__pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::Power((*__pyx_v_w->_weight), __pyx_v_n)));
- /* "pywrapfst.pyx":607
+ /* "pywrapfst.pyx":608
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
* return _weight # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":604
+ /* "pywrapfst.pyx":605
*
*
* cdef Weight _power(Weight w, size_t n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":610
+/* "pywrapfst.pyx":611
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, 1); __PYX_ERR(0, 610, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, 1); __PYX_ERR(0, 611, __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, 610, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "power") < 0)) __PYX_ERR(0, 611, __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, 610, __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, 611, __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, 610, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 611, __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, 610, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_9pywrapfst_Weight, 1, "w", 0))) __PYX_ERR(0, 611, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_6power(__pyx_self, __pyx_v_w, __pyx_v_n);
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("power", 0);
- /* "pywrapfst.pyx":627
+ /* "pywrapfst.pyx":628
* FstBadWeightError: Invalid weight.
* """
* cdef Weight _weight = _power(w, n) # <<<<<<<<<<<<<<
* _weight._check_weight()
* return _weight
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__power(__pyx_v_w, __pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __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, 628, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":628
+ /* "pywrapfst.pyx":629
* """
* cdef Weight _weight = _power(w, n)
* _weight._check_weight() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
- __PYX_ERR(0, 628, __pyx_L1_error)
+ __PYX_ERR(0, 629, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->_check_weight(__pyx_v__weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 628, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->_check_weight(__pyx_v__weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 629, __pyx_L1_error)
- /* "pywrapfst.pyx":629
+ /* "pywrapfst.pyx":630
* cdef Weight _weight = _power(w, n)
* _weight._check_weight()
* return _weight # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v__weight);
goto __pyx_L0;
- /* "pywrapfst.pyx":610
+ /* "pywrapfst.pyx":611
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":632
+/* "pywrapfst.pyx":633
*
*
- * cdef fst.WeightClass _get_WeightClass_or_Zero(const string &weight_type, # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _get_WeightClass_or_zero(const string &weight_type, # <<<<<<<<<<<<<<
* weight) except *:
* """Converts weight string to a WeightClass.
*/
-static fst::script::WeightClass __pyx_f_9pywrapfst__get_WeightClass_or_Zero(std::string const &__pyx_v_weight_type, PyObject *__pyx_v_weight) {
+static fst::script::WeightClass __pyx_f_9pywrapfst__get_WeightClass_or_zero(std::string const &__pyx_v_weight_type, PyObject *__pyx_v_weight) {
fst::script::WeightClass __pyx_v__weight;
fst::script::WeightClass __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_get_WeightClass_or_Zero", 0);
+ __Pyx_RefNannySetupContext("_get_WeightClass_or_zero", 0);
- /* "pywrapfst.pyx":650
+ /* "pywrapfst.pyx":651
* """
* cdef fst.WeightClass _weight
* if weight is None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":651
+ /* "pywrapfst.pyx":652
* cdef fst.WeightClass _weight
* if weight is None:
* _weight = fst.WeightClass.Zero(weight_type) # <<<<<<<<<<<<<<
*/
__pyx_v__weight = fst::script::WeightClass::Zero(__pyx_v_weight_type);
- /* "pywrapfst.pyx":650
+ /* "pywrapfst.pyx":651
* """
* cdef fst.WeightClass _weight
* if weight is None: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":652
+ /* "pywrapfst.pyx":653
* if weight is None:
* _weight = fst.WeightClass.Zero(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":653
+ /* "pywrapfst.pyx":654
* _weight = fst.WeightClass.Zero(weight_type)
* elif isinstance(weight, Weight):
* _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(__pyx_v_weight == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 653, __pyx_L1_error)
+ __PYX_ERR(0, 654, __pyx_L1_error)
}
__pyx_v__weight = (*((fst::script::WeightClass *)((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));
- /* "pywrapfst.pyx":652
+ /* "pywrapfst.pyx":653
* if weight is None:
* _weight = fst.WeightClass.Zero(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":655
+ /* "pywrapfst.pyx":656
* _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
* else:
* _weight = fst.WeightClass(weight_type, weight_tostring(weight)) # <<<<<<<<<<<<<<
* raise FstBadWeightError(weight_tostring(weight))
*/
/*else*/ {
- __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 655, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L1_error)
__pyx_v__weight = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);
- /* "pywrapfst.pyx":656
+ /* "pywrapfst.pyx":657
* else:
* _weight = fst.WeightClass(weight_type, weight_tostring(weight))
* if not _weight.Member(): # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(__pyx_v__weight.Member() != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":657
+ /* "pywrapfst.pyx":658
* _weight = fst.WeightClass(weight_type, weight_tostring(weight))
* if not _weight.Member():
* raise FstBadWeightError(weight_tostring(weight)) # <<<<<<<<<<<<<<
* return _weight
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L1_error)
- __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 657, __pyx_L1_error)
+ __PYX_ERR(0, 658, __pyx_L1_error)
- /* "pywrapfst.pyx":656
+ /* "pywrapfst.pyx":657
* else:
* _weight = fst.WeightClass(weight_type, weight_tostring(weight))
* if not _weight.Member(): # <<<<<<<<<<<<<<
}
__pyx_L3:;
- /* "pywrapfst.pyx":658
+ /* "pywrapfst.pyx":659
* if not _weight.Member():
* raise FstBadWeightError(weight_tostring(weight))
* return _weight # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":632
+ /* "pywrapfst.pyx":633
*
*
- * cdef fst.WeightClass _get_WeightClass_or_Zero(const string &weight_type, # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _get_WeightClass_or_zero(const string &weight_type, # <<<<<<<<<<<<<<
* weight) except *:
* """Converts weight string to a WeightClass.
*/
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("pywrapfst._get_WeightClass_or_Zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst._get_WeightClass_or_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_pretend_to_initialize(&__pyx_r);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":661
+/* "pywrapfst.pyx":662
*
*
- * cdef fst.WeightClass _get_WeightClass_or_One(const string &weight_type, # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _get_WeightClass_or_one(const string &weight_type, # <<<<<<<<<<<<<<
* weight) except *:
* """Converts weight string to a WeightClass.
*/
-static fst::script::WeightClass __pyx_f_9pywrapfst__get_WeightClass_or_One(std::string const &__pyx_v_weight_type, PyObject *__pyx_v_weight) {
+static fst::script::WeightClass __pyx_f_9pywrapfst__get_WeightClass_or_one(std::string const &__pyx_v_weight_type, PyObject *__pyx_v_weight) {
fst::script::WeightClass __pyx_v__weight;
fst::script::WeightClass __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_get_WeightClass_or_One", 0);
+ __Pyx_RefNannySetupContext("_get_WeightClass_or_one", 0);
- /* "pywrapfst.pyx":679
+ /* "pywrapfst.pyx":680
* """
* cdef fst.WeightClass _weight
* if weight is None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":680
+ /* "pywrapfst.pyx":681
* cdef fst.WeightClass _weight
* if weight is None:
* _weight = fst.WeightClass.One(weight_type) # <<<<<<<<<<<<<<
*/
__pyx_v__weight = fst::script::WeightClass::One(__pyx_v_weight_type);
- /* "pywrapfst.pyx":679
+ /* "pywrapfst.pyx":680
* """
* cdef fst.WeightClass _weight
* if weight is None: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":681
+ /* "pywrapfst.pyx":682
* if weight is None:
* _weight = fst.WeightClass.One(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":682
+ /* "pywrapfst.pyx":683
* _weight = fst.WeightClass.One(weight_type)
* elif isinstance(weight, Weight):
* _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(__pyx_v_weight == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 682, __pyx_L1_error)
+ __PYX_ERR(0, 683, __pyx_L1_error)
}
__pyx_v__weight = (*((fst::script::WeightClass *)((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));
- /* "pywrapfst.pyx":681
+ /* "pywrapfst.pyx":682
* if weight is None:
* _weight = fst.WeightClass.One(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":684
+ /* "pywrapfst.pyx":685
* _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
* else:
* _weight = fst.WeightClass(weight_type, weight_tostring(weight)) # <<<<<<<<<<<<<<
* raise FstBadWeightError(weight_tostring(weight))
*/
/*else*/ {
- __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 684, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 685, __pyx_L1_error)
__pyx_v__weight = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);
- /* "pywrapfst.pyx":685
+ /* "pywrapfst.pyx":686
* else:
* _weight = fst.WeightClass(weight_type, weight_tostring(weight))
* if not _weight.Member(): # <<<<<<<<<<<<<<
__pyx_t_1 = ((!(__pyx_v__weight.Member() != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":686
+ /* "pywrapfst.pyx":687
* _weight = fst.WeightClass(weight_type, weight_tostring(weight))
* if not _weight.Member():
* raise FstBadWeightError(weight_tostring(weight)) # <<<<<<<<<<<<<<
* return _weight
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 687, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L1_error)
- __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 686, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 687, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 686, __pyx_L1_error)
+ __PYX_ERR(0, 687, __pyx_L1_error)
- /* "pywrapfst.pyx":685
+ /* "pywrapfst.pyx":686
* else:
* _weight = fst.WeightClass(weight_type, weight_tostring(weight))
* if not _weight.Member(): # <<<<<<<<<<<<<<
}
__pyx_L3:;
- /* "pywrapfst.pyx":687
+ /* "pywrapfst.pyx":688
* if not _weight.Member():
* raise FstBadWeightError(weight_tostring(weight))
* return _weight # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":661
+ /* "pywrapfst.pyx":662
*
*
- * cdef fst.WeightClass _get_WeightClass_or_One(const string &weight_type, # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _get_WeightClass_or_one(const string &weight_type, # <<<<<<<<<<<<<<
* weight) except *:
* """Converts weight string to a WeightClass.
*/
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("pywrapfst._get_WeightClass_or_One", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst._get_WeightClass_or_one", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_pretend_to_initialize(&__pyx_r);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":690
+/* "pywrapfst.pyx":691
*
*
- * cdef Weight _Zero(weight_type): # <<<<<<<<<<<<<<
+ * cdef Weight _zero(weight_type): # <<<<<<<<<<<<<<
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(
*/
-static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__Zero(PyObject *__pyx_v_weight_type) {
+static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__zero(PyObject *__pyx_v_weight_type) {
struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_Zero", 0);
+ __Pyx_RefNannySetupContext("_zero", 0);
- /* "pywrapfst.pyx":691
+ /* "pywrapfst.pyx":692
*
- * cdef Weight _Zero(weight_type):
+ * cdef Weight _zero(weight_type):
* cdef Weight _weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* _weight._weight.reset(
* new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":692
- * cdef Weight _Zero(weight_type):
+ /* "pywrapfst.pyx":693
+ * cdef Weight _zero(weight_type):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset( # <<<<<<<<<<<<<<
* new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 692, __pyx_L1_error)
+ __PYX_ERR(0, 693, __pyx_L1_error)
}
- /* "pywrapfst.pyx":693
+ /* "pywrapfst.pyx":694
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(
* new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type)))) # <<<<<<<<<<<<<<
* if _weight._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found")
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 693, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 694, __pyx_L1_error)
- /* "pywrapfst.pyx":692
- * cdef Weight _Zero(weight_type):
+ /* "pywrapfst.pyx":693
+ * cdef Weight _zero(weight_type):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset( # <<<<<<<<<<<<<<
* new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
*/
__pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::Zero(__pyx_t_2)));
- /* "pywrapfst.pyx":694
+ /* "pywrapfst.pyx":695
* _weight._weight.reset(
* new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
* if _weight._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 694, __pyx_L1_error)
+ __PYX_ERR(0, 695, __pyx_L1_error)
}
__pyx_t_3 = ((__pyx_v__weight->_weight.get()->Type() == ((char const *)"none")) != 0);
if (unlikely(__pyx_t_3)) {
- /* "pywrapfst.pyx":695
+ /* "pywrapfst.pyx":696
* new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
* if _weight._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found") # <<<<<<<<<<<<<<
* return _weight
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_Weight_type_not_found) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Weight_type_not_found);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 695, __pyx_L1_error)
+ __PYX_ERR(0, 696, __pyx_L1_error)
- /* "pywrapfst.pyx":694
+ /* "pywrapfst.pyx":695
* _weight._weight.reset(
* new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
* if _weight._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":696
+ /* "pywrapfst.pyx":697
* if _weight._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found")
* return _weight # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":690
+ /* "pywrapfst.pyx":691
*
*
- * cdef Weight _Zero(weight_type): # <<<<<<<<<<<<<<
+ * cdef Weight _zero(weight_type): # <<<<<<<<<<<<<<
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(
*/
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("pywrapfst._Zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst._zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v__weight);
return __pyx_r;
}
-/* "pywrapfst.pyx":699
+/* "pywrapfst.pyx":700
*
*
- * cdef Weight _One(weight_type): # <<<<<<<<<<<<<<
+ * cdef Weight _one(weight_type): # <<<<<<<<<<<<<<
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(
*/
-static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__One(PyObject *__pyx_v_weight_type) {
+static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__one(PyObject *__pyx_v_weight_type) {
struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_One", 0);
+ __Pyx_RefNannySetupContext("_one", 0);
- /* "pywrapfst.pyx":700
+ /* "pywrapfst.pyx":701
*
- * cdef Weight _One(weight_type):
+ * cdef Weight _one(weight_type):
* cdef Weight _weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* _weight._weight.reset(
* new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":701
- * cdef Weight _One(weight_type):
+ /* "pywrapfst.pyx":702
+ * cdef Weight _one(weight_type):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset( # <<<<<<<<<<<<<<
* new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 701, __pyx_L1_error)
+ __PYX_ERR(0, 702, __pyx_L1_error)
}
- /* "pywrapfst.pyx":702
+ /* "pywrapfst.pyx":703
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(
* new fst.WeightClass(fst.WeightClass.One(tostring(weight_type)))) # <<<<<<<<<<<<<<
* if _weight._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found")
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L1_error)
- /* "pywrapfst.pyx":701
- * cdef Weight _One(weight_type):
+ /* "pywrapfst.pyx":702
+ * cdef Weight _one(weight_type):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset( # <<<<<<<<<<<<<<
* new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
*/
__pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::One(__pyx_t_2)));
- /* "pywrapfst.pyx":703
+ /* "pywrapfst.pyx":704
* _weight._weight.reset(
* new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
* if _weight._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 703, __pyx_L1_error)
+ __PYX_ERR(0, 704, __pyx_L1_error)
}
__pyx_t_3 = ((__pyx_v__weight->_weight.get()->Type() == ((char const *)"none")) != 0);
if (unlikely(__pyx_t_3)) {
- /* "pywrapfst.pyx":704
+ /* "pywrapfst.pyx":705
* new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
* if _weight._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found") # <<<<<<<<<<<<<<
* return _weight
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_Weight_type_not_found) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Weight_type_not_found);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 704, __pyx_L1_error)
+ __PYX_ERR(0, 705, __pyx_L1_error)
- /* "pywrapfst.pyx":703
+ /* "pywrapfst.pyx":704
* _weight._weight.reset(
* new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
* if _weight._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":705
+ /* "pywrapfst.pyx":706
* if _weight._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found")
* return _weight # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":699
+ /* "pywrapfst.pyx":700
*
*
- * cdef Weight _One(weight_type): # <<<<<<<<<<<<<<
+ * cdef Weight _one(weight_type): # <<<<<<<<<<<<<<
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(
*/
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("pywrapfst._One", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst._one", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v__weight);
return __pyx_r;
}
-/* "pywrapfst.pyx":708
+/* "pywrapfst.pyx":709
*
*
- * cdef Weight _NoWeight(weight_type): # <<<<<<<<<<<<<<
+ * cdef Weight _no_weight(weight_type): # <<<<<<<<<<<<<<
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(
*/
-static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__NoWeight(PyObject *__pyx_v_weight_type) {
+static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__no_weight(PyObject *__pyx_v_weight_type) {
struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_NoWeight", 0);
+ __Pyx_RefNannySetupContext("_no_weight", 0);
- /* "pywrapfst.pyx":709
+ /* "pywrapfst.pyx":710
*
- * cdef Weight _NoWeight(weight_type):
+ * cdef Weight _no_weight(weight_type):
* cdef Weight _weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* _weight._weight.reset(
* new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":710
- * cdef Weight _NoWeight(weight_type):
+ /* "pywrapfst.pyx":711
+ * cdef Weight _no_weight(weight_type):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset( # <<<<<<<<<<<<<<
* new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 710, __pyx_L1_error)
+ __PYX_ERR(0, 711, __pyx_L1_error)
}
- /* "pywrapfst.pyx":711
+ /* "pywrapfst.pyx":712
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(
* new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type)))) # <<<<<<<<<<<<<<
* return _weight
*
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 711, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L1_error)
- /* "pywrapfst.pyx":710
- * cdef Weight _NoWeight(weight_type):
+ /* "pywrapfst.pyx":711
+ * cdef Weight _no_weight(weight_type):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset( # <<<<<<<<<<<<<<
* new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))
*/
__pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::NoWeight(__pyx_t_2)));
- /* "pywrapfst.pyx":712
+ /* "pywrapfst.pyx":713
* _weight._weight.reset(
* new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))
* return _weight # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":708
+ /* "pywrapfst.pyx":709
*
*
- * cdef Weight _NoWeight(weight_type): # <<<<<<<<<<<<<<
+ * cdef Weight _no_weight(weight_type): # <<<<<<<<<<<<<<
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("pywrapfst._NoWeight", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst._no_weight", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v__weight);
return __pyx_r;
}
-/* "pywrapfst.pyx":744
+/* "pywrapfst.pyx":745
* # Doing so will allow undefined behavior.
*
* def __init__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":745
+ /* "pywrapfst.pyx":746
*
* def __init__(self):
* raise NotImplementedError(f"Cannot construct {self.__class__.__name__}") # <<<<<<<<<<<<<<
*
* def __iter__(self):
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_construct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_construct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __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, 745, __pyx_L1_error)
+ __PYX_ERR(0, 746, __pyx_L1_error)
- /* "pywrapfst.pyx":744
+ /* "pywrapfst.pyx":745
* # Doing so will allow undefined behavior.
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":747
+/* "pywrapfst.pyx":748
* raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
*
* def __iter__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":748
+ /* "pywrapfst.pyx":749
*
* def __iter__(self):
* return _SymbolTableIterator(self) # <<<<<<<<<<<<<<
* # Registers the class for pickling.
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_9pywrapfst__SymbolTableIterator), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_9pywrapfst__SymbolTableIterator), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":747
+ /* "pywrapfst.pyx":748
* raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
*
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":752
+/* "pywrapfst.pyx":753
* # Registers the class for pickling.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__reduce__", 0);
- /* "pywrapfst.pyx":753
+ /* "pywrapfst.pyx":754
*
* def __reduce__(self):
* return (_read_SymbolTable_from_string, (self.write_to_string(),)) # <<<<<<<<<<<<<<
* # Returns a raw const pointer to SymbolTable.
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_SymbolTable_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_SymbolTable_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "write_to_string");
- __PYX_ERR(0, 753, __pyx_L1_error)
+ __PYX_ERR(0, 754, __pyx_L1_error)
}
- __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
+ __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __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_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __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_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":752
+ /* "pywrapfst.pyx":753
* # Registers the class for pickling.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":759
+/* "pywrapfst.pyx":760
* # Should not be directly accessed except by `_raw_ptr_or_raise()`.
* # All other methods should use the safer _raw_ptr_or_raise() instead.
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_raw", 0);
- /* "pywrapfst.pyx":760
+ /* "pywrapfst.pyx":761
* # All other methods should use the safer _raw_ptr_or_raise() instead.
* cdef const_SymbolTable_ptr _raw(self):
* return NULL # <<<<<<<<<<<<<<
__pyx_r = NULL;
goto __pyx_L0;
- /* "pywrapfst.pyx":759
+ /* "pywrapfst.pyx":760
* # Should not be directly accessed except by `_raw_ptr_or_raise()`.
* # All other methods should use the safer _raw_ptr_or_raise() instead.
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":763
+/* "pywrapfst.pyx":764
*
* # Raises an FstOpError for a nonexistent SymbolTable.
* cdef void _raise_nonexistent(self) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_raise_nonexistent", 0);
- /* "pywrapfst.pyx":764
+ /* "pywrapfst.pyx":765
* # Raises an FstOpError for a nonexistent SymbolTable.
* cdef void _raise_nonexistent(self) except *:
* raise FstOpError("SymbolTable no longer exists") # <<<<<<<<<<<<<<
*
* # Internal API method that should be used when a const pointer to an
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_SymbolTable_no_longer_exists) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_SymbolTable_no_longer_exists);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
+ 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, 764, __pyx_L1_error)
+ __PYX_ERR(0, 765, __pyx_L1_error)
- /* "pywrapfst.pyx":763
+ /* "pywrapfst.pyx":764
*
* # Raises an FstOpError for a nonexistent SymbolTable.
* cdef void _raise_nonexistent(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":768
+/* "pywrapfst.pyx":769
* # Internal API method that should be used when a const pointer to an
* # fst.SymbolTable is required.
* cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_raw_ptr_or_raise", 0);
- /* "pywrapfst.pyx":769
+ /* "pywrapfst.pyx":770
* # fst.SymbolTable is required.
* cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *:
* cdef const_SymbolTable_ptr _raw = self._raw() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw");
- __PYX_ERR(0, 769, __pyx_L1_error)
+ __PYX_ERR(0, 770, __pyx_L1_error)
}
__pyx_v__raw = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw(__pyx_v_self);
- /* "pywrapfst.pyx":770
+ /* "pywrapfst.pyx":771
* cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *:
* cdef const_SymbolTable_ptr _raw = self._raw()
* if _raw == NULL: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v__raw == NULL) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":771
+ /* "pywrapfst.pyx":772
* cdef const_SymbolTable_ptr _raw = self._raw()
* if _raw == NULL:
* self._raise_nonexistent() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raise_nonexistent");
- __PYX_ERR(0, 771, __pyx_L1_error)
+ __PYX_ERR(0, 772, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raise_nonexistent(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 771, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raise_nonexistent(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 772, __pyx_L1_error)
- /* "pywrapfst.pyx":770
+ /* "pywrapfst.pyx":771
* cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *:
* cdef const_SymbolTable_ptr _raw = self._raw()
* if _raw == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":772
+ /* "pywrapfst.pyx":773
* if _raw == NULL:
* self._raise_nonexistent()
* return _raw # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__raw;
goto __pyx_L0;
- /* "pywrapfst.pyx":768
+ /* "pywrapfst.pyx":769
* # Internal API method that should be used when a const pointer to an
* # fst.SymbolTable is required.
* cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":774
+/* "pywrapfst.pyx":775
* return _raw
*
* cpdef int64 available_key(self) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_available_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __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, 775, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_15SymbolTableView_7available_key)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 774, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 775, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":780
+ /* "pywrapfst.pyx":781
* Returns an integer indicating the next available key index in the table.
* """
* return self._raw_ptr_or_raise().AvailableKey() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 780, __pyx_L1_error)
+ __PYX_ERR(0, 781, __pyx_L1_error)
}
- __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L1_error)
+ __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L1_error)
__pyx_r = __pyx_t_6->AvailableKey();
goto __pyx_L0;
- /* "pywrapfst.pyx":774
+ /* "pywrapfst.pyx":775
* return _raw
*
* cpdef int64 available_key(self) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("available_key", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_available_key(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 774, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_available_key(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 775, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":782
+/* "pywrapfst.pyx":783
* return self._raw_ptr_or_raise().AvailableKey()
*
* cpdef bytes checksum(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_15SymbolTableView_9checksum)) {
__Pyx_XDECREF(__pyx_r);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 782, __pyx_L1_error)
+ if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 783, __pyx_L1_error)
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":788
+ /* "pywrapfst.pyx":789
* Returns a bytestring indicating the label-independent MD5 checksum.
* """
* return self._raw_ptr_or_raise().CheckSum() # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 788, __pyx_L1_error)
+ __PYX_ERR(0, 789, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L1_error)
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_5->CheckSum()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error)
+ __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 789, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_5->CheckSum()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":782
+ /* "pywrapfst.pyx":783
* return self._raw_ptr_or_raise().AvailableKey()
*
* cpdef bytes checksum(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("checksum", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_checksum(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_checksum(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":790
+/* "pywrapfst.pyx":791
* return self._raw_ptr_or_raise().CheckSum()
*
* cpdef SymbolTable copy(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __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, 791, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_15SymbolTableView_11copy)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __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, 790, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_SymbolTable))))) __PYX_ERR(0, 791, __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;
#endif
}
- /* "pywrapfst.pyx":796
+ /* "pywrapfst.pyx":797
* Returns a mutable copy of the SymbolTable.
* """
* return _init_SymbolTable(WrapUnique(self._raw_ptr_or_raise().Copy())) # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 796, __pyx_L1_error)
+ __PYX_ERR(0, 797, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L1_error)
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::WrapUnique<fst::SymbolTable>(__pyx_t_5->Copy()))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error)
+ __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 797, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::WrapUnique<fst::SymbolTable>(__pyx_t_5->Copy()))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __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":790
+ /* "pywrapfst.pyx":791
* return self._raw_ptr_or_raise().CheckSum()
*
* cpdef SymbolTable copy(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_15SymbolTableView_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_15SymbolTableView_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":798
+/* "pywrapfst.pyx":799
* return _init_SymbolTable(WrapUnique(self._raw_ptr_or_raise().Copy()))
*
* def find(self, key): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("find", 0);
- /* "pywrapfst.pyx":815
+ /* "pywrapfst.pyx":816
* not found.
* """
* cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 815, __pyx_L1_error)
+ __PYX_ERR(0, 816, __pyx_L1_error)
}
- __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 815, __pyx_L1_error)
+ __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L1_error)
__pyx_v__raw = __pyx_t_1;
- /* "pywrapfst.pyx":816
+ /* "pywrapfst.pyx":817
* """
* cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try: # <<<<<<<<<<<<<<
__Pyx_XGOTREF(__pyx_t_4);
/*try:*/ {
- /* "pywrapfst.pyx":817
+ /* "pywrapfst.pyx":818
* cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try:
* return _raw.FindIndex(tostring(key)) # <<<<<<<<<<<<<<
* return _raw.FindSymbol(key)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L3_error)
- __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v__raw->Find(__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 817, __pyx_L3_error)
+ __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error)
+ __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v__raw->Find(__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L7_try_return;
- /* "pywrapfst.pyx":816
+ /* "pywrapfst.pyx":817
* """
* cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try: # <<<<<<<<<<<<<<
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "pywrapfst.pyx":818
+ /* "pywrapfst.pyx":819
* try:
* return _raw.FindIndex(tostring(key))
* except TypeError: # <<<<<<<<<<<<<<
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
if (__pyx_t_7) {
__Pyx_AddTraceback("pywrapfst.SymbolTableView.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 818, __pyx_L5_except_error)
+ if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 819, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_9);
- /* "pywrapfst.pyx":819
+ /* "pywrapfst.pyx":820
* return _raw.FindIndex(tostring(key))
* except TypeError:
* return _raw.FindSymbol(key) # <<<<<<<<<<<<<<
* cpdef int64 get_nth_key(self, ssize_t pos) except *:
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_10 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 819, __pyx_L5_except_error)
- __pyx_t_11 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v__raw->Find(__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 819, __pyx_L5_except_error)
+ __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_10 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L5_except_error)
+ __pyx_t_11 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v__raw->Find(__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 820, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_11);
__pyx_r = __pyx_t_11;
__pyx_t_11 = 0;
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
- /* "pywrapfst.pyx":816
+ /* "pywrapfst.pyx":817
* """
* cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try: # <<<<<<<<<<<<<<
goto __pyx_L0;
}
- /* "pywrapfst.pyx":798
+ /* "pywrapfst.pyx":799
* return _init_SymbolTable(WrapUnique(self._raw_ptr_or_raise().Copy()))
*
* def find(self, key): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":821
+/* "pywrapfst.pyx":822
* return _raw.FindSymbol(key)
*
* cpdef int64 get_nth_key(self, ssize_t pos) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nth_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __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, 822, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_15SymbolTableView_15get_nth_key)) {
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error)
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 822, __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;
#endif
}
- /* "pywrapfst.pyx":833
+ /* "pywrapfst.pyx":834
* The integer index of the n-th key, or NO_LABEL if not found.
* """
* return self._raw_ptr_or_raise().GetNthKey(pos) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 833, __pyx_L1_error)
+ __PYX_ERR(0, 834, __pyx_L1_error)
}
- __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 833, __pyx_L1_error)
+ __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 834, __pyx_L1_error)
__pyx_r = __pyx_t_7->GetNthKey(__pyx_v_pos);
goto __pyx_L0;
- /* "pywrapfst.pyx":821
+ /* "pywrapfst.pyx":822
* return _raw.FindSymbol(key)
*
* cpdef int64 get_nth_key(self, ssize_t pos) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_nth_key (wrapper)", 0);
assert(__pyx_arg_pos); {
- __pyx_v_pos = PyInt_AsSsize_t(__pyx_arg_pos); if (unlikely((__pyx_v_pos == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 821, __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, 822, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_nth_key", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_get_nth_key(__pyx_v_self, __pyx_v_pos, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_get_nth_key(__pyx_v_self, __pyx_v_pos, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 822, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":835
+/* "pywrapfst.pyx":836
* return self._raw_ptr_or_raise().GetNthKey(pos)
*
* cpdef bytes labeled_checksum(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_labeled_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __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, 836, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_15SymbolTableView_17labeled_checksum)) {
__Pyx_XDECREF(__pyx_r);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 835, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 835, __pyx_L1_error)
+ if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 836, __pyx_L1_error)
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":841
+ /* "pywrapfst.pyx":842
* Returns a bytestring indicating the label-dependent MD5 checksum.
* """
* return self._raw_ptr_or_raise().LabeledCheckSum() # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 841, __pyx_L1_error)
+ __PYX_ERR(0, 842, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 841, __pyx_L1_error)
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_5->LabeledCheckSum()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 841, __pyx_L1_error)
+ __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_5->LabeledCheckSum()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":835
+ /* "pywrapfst.pyx":836
* return self._raw_ptr_or_raise().GetNthKey(pos)
*
* cpdef bytes labeled_checksum(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("labeled_checksum", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_labeled_checksum(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_labeled_checksum(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":843
+/* "pywrapfst.pyx":844
* return self._raw_ptr_or_raise().LabeledCheckSum()
*
* cpdef bool member(self, key) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_member); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __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, 844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_15SymbolTableView_19member)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __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, 843, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":859
+ /* "pywrapfst.pyx":860
* Whether or not the key is present (as a string or a index) in the table.
* """
* cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 859, __pyx_L1_error)
+ __PYX_ERR(0, 860, __pyx_L1_error)
}
- __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 859, __pyx_L1_error)
+ __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 860, __pyx_L1_error)
__pyx_v__raw = __pyx_t_6;
- /* "pywrapfst.pyx":860
+ /* "pywrapfst.pyx":861
* """
* cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try: # <<<<<<<<<<<<<<
__Pyx_XGOTREF(__pyx_t_9);
/*try:*/ {
- /* "pywrapfst.pyx":861
+ /* "pywrapfst.pyx":862
* cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try:
* return _raw.MemberSymbol(tostring(key)) # <<<<<<<<<<<<<<
* except TypeError:
* return _raw.MemberIndex(key)
*/
- __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L3_error)
+ __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 862, __pyx_L3_error)
__pyx_r = __pyx_v__raw->Member(__pyx_t_10);
goto __pyx_L7_try_return;
- /* "pywrapfst.pyx":860
+ /* "pywrapfst.pyx":861
* """
* cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "pywrapfst.pyx":862
+ /* "pywrapfst.pyx":863
* try:
* return _raw.MemberSymbol(tostring(key))
* except TypeError: # <<<<<<<<<<<<<<
__pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
if (__pyx_t_11) {
__Pyx_AddTraceback("pywrapfst.SymbolTableView.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 862, __pyx_L5_except_error)
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 863, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":863
+ /* "pywrapfst.pyx":864
* return _raw.MemberSymbol(tostring(key))
* except TypeError:
* return _raw.MemberIndex(key) # <<<<<<<<<<<<<<
*
* cpdef string name(self) except *:
*/
- __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_12 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 863, __pyx_L5_except_error)
+ __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_12 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L5_except_error)
__pyx_r = __pyx_v__raw->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":860
+ /* "pywrapfst.pyx":861
* """
* cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try: # <<<<<<<<<<<<<<
goto __pyx_L0;
}
- /* "pywrapfst.pyx":843
+ /* "pywrapfst.pyx":844
* return self._raw_ptr_or_raise().LabeledCheckSum()
*
* cpdef bool member(self, key) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("member", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_member(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 843, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_member(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":865
+/* "pywrapfst.pyx":866
* return _raw.MemberIndex(key)
*
* cpdef string name(self) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __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, 866, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_15SymbolTableView_21name)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __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, 865, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 866, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":871
+ /* "pywrapfst.pyx":872
* Returns the symbol table's name.
* """
* return self._raw_ptr_or_raise().Name() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 871, __pyx_L1_error)
+ __PYX_ERR(0, 872, __pyx_L1_error)
}
- __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error)
+ __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 872, __pyx_L1_error)
__pyx_r = __pyx_t_6->Name();
goto __pyx_L0;
- /* "pywrapfst.pyx":865
+ /* "pywrapfst.pyx":866
* return _raw.MemberIndex(key)
*
* cpdef string name(self) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("name", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_name(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 865, __pyx_L1_error)
- __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_name(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 866, __pyx_L1_error)
+ __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":873
+/* "pywrapfst.pyx":874
* return self._raw_ptr_or_raise().Name()
*
* cpdef size_t num_symbols(self) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __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, 874, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_15SymbolTableView_23num_symbols)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __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, 873, __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, 874, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":879
+ /* "pywrapfst.pyx":880
* Returns the number of symbols in the symbol table.
* """
* return self._raw_ptr_or_raise().NumSymbols() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 879, __pyx_L1_error)
+ __PYX_ERR(0, 880, __pyx_L1_error)
}
- __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 879, __pyx_L1_error)
+ __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 880, __pyx_L1_error)
__pyx_r = __pyx_t_6->NumSymbols();
goto __pyx_L0;
- /* "pywrapfst.pyx":873
+ /* "pywrapfst.pyx":874
* return self._raw_ptr_or_raise().Name()
*
* cpdef size_t num_symbols(self) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("num_symbols", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_num_symbols(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_num_symbols(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 874, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":881
+/* "pywrapfst.pyx":882
* return self._raw_ptr_or_raise().NumSymbols()
*
* cpdef void write(self, source) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __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, 882, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_15SymbolTableView_25write)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_source);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":895
+ /* "pywrapfst.pyx":896
* FstIOError: Write failed.
* """
* if not self._raw_ptr_or_raise().Write(path_tostring(source)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 895, __pyx_L1_error)
+ __PYX_ERR(0, 896, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 895, __pyx_L1_error)
- __pyx_t_6 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 895, __pyx_L1_error)
+ __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 896, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 896, __pyx_L1_error)
__pyx_t_7 = ((!(__pyx_t_5->Write(__pyx_t_6) != 0)) != 0);
if (unlikely(__pyx_t_7)) {
- /* "pywrapfst.pyx":896
+ /* "pywrapfst.pyx":897
* """
* if not self._raw_ptr_or_raise().Write(path_tostring(source)):
* raise FstIOError(f"Write failed: {source!r}") # <<<<<<<<<<<<<<
*
* cpdef void write_text(self, source) except *:
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 897, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 896, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __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, 896, __pyx_L1_error)
+ __PYX_ERR(0, 897, __pyx_L1_error)
- /* "pywrapfst.pyx":895
+ /* "pywrapfst.pyx":896
* FstIOError: Write failed.
* """
* if not self._raw_ptr_or_raise().Write(path_tostring(source)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":881
+ /* "pywrapfst.pyx":882
* return self._raw_ptr_or_raise().NumSymbols()
*
* cpdef void write(self, source) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_15SymbolTableView_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error)
+ __pyx_f_9pywrapfst_15SymbolTableView_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 882, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":898
+/* "pywrapfst.pyx":899
* raise FstIOError(f"Write failed: {source!r}")
*
* cpdef void write_text(self, source) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __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, 899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_15SymbolTableView_27write_text)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_source);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":912
+ /* "pywrapfst.pyx":913
* FstIOError: Write failed.
* """
* if not self._raw_ptr_or_raise().WriteText(path_tostring(source)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 912, __pyx_L1_error)
+ __PYX_ERR(0, 913, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 912, __pyx_L1_error)
- __pyx_t_6 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 912, __pyx_L1_error)
+ __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 913, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 913, __pyx_L1_error)
__pyx_t_7 = ((!(__pyx_t_5->WriteText(__pyx_t_6) != 0)) != 0);
if (unlikely(__pyx_t_7)) {
- /* "pywrapfst.pyx":913
+ /* "pywrapfst.pyx":914
* """
* if not self._raw_ptr_or_raise().WriteText(path_tostring(source)):
* raise FstIOError(f"Write failed: {source!r}") # <<<<<<<<<<<<<<
*
* cpdef bytes write_to_string(self):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __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, 913, __pyx_L1_error)
+ __PYX_ERR(0, 914, __pyx_L1_error)
- /* "pywrapfst.pyx":912
+ /* "pywrapfst.pyx":913
* FstIOError: Write failed.
* """
* if not self._raw_ptr_or_raise().WriteText(path_tostring(source)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":898
+ /* "pywrapfst.pyx":899
* raise FstIOError(f"Write failed: {source!r}")
*
* cpdef void write_text(self, source) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_15SymbolTableView_write_text(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error)
+ __pyx_f_9pywrapfst_15SymbolTableView_write_text(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 899, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":915
+/* "pywrapfst.pyx":916
* raise FstIOError(f"Write failed: {source!r}")
*
* cpdef bytes write_to_string(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __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, 916, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_15SymbolTableView_29write_to_string)) {
__Pyx_XDECREF(__pyx_r);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 915, __pyx_L1_error)
+ if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 916, __pyx_L1_error)
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":928
+ /* "pywrapfst.pyx":929
* """
* cdef stringstream _sstrm
* if not self._raw_ptr_or_raise().Write(_sstrm): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 928, __pyx_L1_error)
+ __PYX_ERR(0, 929, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 928, __pyx_L1_error)
+ __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L1_error)
__pyx_t_6 = ((!(__pyx_t_5->Write(__pyx_v__sstrm) != 0)) != 0);
if (unlikely(__pyx_t_6)) {
- /* "pywrapfst.pyx":929
+ /* "pywrapfst.pyx":930
* cdef stringstream _sstrm
* if not self._raw_ptr_or_raise().Write(_sstrm):
* raise FstIOError("Write to string failed") # <<<<<<<<<<<<<<
* return _sstrm.str()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Write_to_string_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Write_to_string_failed);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __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, 929, __pyx_L1_error)
+ __PYX_ERR(0, 930, __pyx_L1_error)
- /* "pywrapfst.pyx":928
+ /* "pywrapfst.pyx":929
* """
* cdef stringstream _sstrm
* if not self._raw_ptr_or_raise().Write(_sstrm): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":930
+ /* "pywrapfst.pyx":931
* if not self._raw_ptr_or_raise().Write(_sstrm):
* raise FstIOError("Write to string failed")
* return _sstrm.str() # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v__sstrm.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v__sstrm.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":915
+ /* "pywrapfst.pyx":916
* raise FstIOError(f"Write failed: {source!r}")
*
* cpdef bytes write_to_string(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_to_string", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_write_to_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_write_to_string(__pyx_v_self, 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":948
+/* "pywrapfst.pyx":949
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":949
+ /* "pywrapfst.pyx":950
*
* def __repr__(self):
* return (f"<const EncodeMapper SymbolTableView {self.name()!r} " # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_const_EncodeMapper_SymbolTableV);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
- __PYX_ERR(0, 949, __pyx_L1_error)
+ __PYX_ERR(0, 950, __pyx_L1_error)
}
- __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 949, __pyx_L1_error)
- __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error)
+ __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 950, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 950, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 949, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 950, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
__Pyx_GIVEREF(__pyx_kp_u_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_at_0x);
- /* "pywrapfst.pyx":950
+ /* "pywrapfst.pyx":951
* def __repr__(self):
* return (f"<const EncodeMapper SymbolTableView {self.name()!r} "
* f"at 0x{id(self):x}>") # <<<<<<<<<<<<<<
*
* cdef const_SymbolTable_ptr _raw(self):
*/
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 950, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 951, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 950, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 951, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
- /* "pywrapfst.pyx":949
+ /* "pywrapfst.pyx":950
*
* def __repr__(self):
* return (f"<const EncodeMapper SymbolTableView {self.name()!r} " # <<<<<<<<<<<<<<
* f"at 0x{id(self):x}>")
*
*/
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 950, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":948
+ /* "pywrapfst.pyx":949
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":952
+/* "pywrapfst.pyx":953
* f"at 0x{id(self):x}>")
*
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_raw", 0);
- /* "pywrapfst.pyx":953
+ /* "pywrapfst.pyx":954
*
* cdef const_SymbolTable_ptr _raw(self):
* return (self._mapper.get().InputSymbols() if self._input_side # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
- __PYX_ERR(0, 953, __pyx_L1_error)
+ __PYX_ERR(0, 954, __pyx_L1_error)
}
if ((__pyx_v_self->_input_side != 0)) {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 953, __pyx_L1_error)
+ __PYX_ERR(0, 954, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mapper.get()->InputSymbols();
} else {
- /* "pywrapfst.pyx":954
+ /* "pywrapfst.pyx":955
* cdef const_SymbolTable_ptr _raw(self):
* return (self._mapper.get().InputSymbols() if self._input_side
* else self._mapper.get().OutputSymbols()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 954, __pyx_L1_error)
+ __PYX_ERR(0, 955, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mapper.get()->OutputSymbols();
}
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "pywrapfst.pyx":952
+ /* "pywrapfst.pyx":953
* f"at 0x{id(self):x}>")
*
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":971
+/* "pywrapfst.pyx":972
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":972
+ /* "pywrapfst.pyx":973
*
* def __repr__(self):
* return (f"<const Fst SymbolTableView {self.name()!r} " # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_const_Fst_SymbolTableView);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
- __PYX_ERR(0, 972, __pyx_L1_error)
+ __PYX_ERR(0, 973, __pyx_L1_error)
}
- __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst__FstSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L1_error)
- __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L1_error)
+ __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst__FstSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 973, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 972, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 973, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
__Pyx_GIVEREF(__pyx_kp_u_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_at_0x);
- /* "pywrapfst.pyx":973
+ /* "pywrapfst.pyx":974
* def __repr__(self):
* return (f"<const Fst SymbolTableView {self.name()!r} "
* f"at 0x{id(self):x}>") # <<<<<<<<<<<<<<
*
* cdef const_SymbolTable_ptr _raw(self):
*/
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 973, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 973, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 974, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
- /* "pywrapfst.pyx":972
+ /* "pywrapfst.pyx":973
*
* def __repr__(self):
* return (f"<const Fst SymbolTableView {self.name()!r} " # <<<<<<<<<<<<<<
* f"at 0x{id(self):x}>")
*
*/
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 973, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":971
+ /* "pywrapfst.pyx":972
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":975
+/* "pywrapfst.pyx":976
* f"at 0x{id(self):x}>")
*
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_raw", 0);
- /* "pywrapfst.pyx":976
+ /* "pywrapfst.pyx":977
*
* cdef const_SymbolTable_ptr _raw(self):
* return (self._fst.get().InputSymbols() if self._input_side # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
- __PYX_ERR(0, 976, __pyx_L1_error)
+ __PYX_ERR(0, 977, __pyx_L1_error)
}
if ((__pyx_v_self->_input_side != 0)) {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 976, __pyx_L1_error)
+ __PYX_ERR(0, 977, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_fst.get()->InputSymbols();
} else {
- /* "pywrapfst.pyx":977
+ /* "pywrapfst.pyx":978
* cdef const_SymbolTable_ptr _raw(self):
* return (self._fst.get().InputSymbols() if self._input_side
* else self._fst.get().OutputSymbols()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 977, __pyx_L1_error)
+ __PYX_ERR(0, 978, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_fst.get()->OutputSymbols();
}
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "pywrapfst.pyx":975
+ /* "pywrapfst.pyx":976
* f"at 0x{id(self):x}>")
*
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":991
+/* "pywrapfst.pyx":992
* """
*
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_raw", 0);
- /* "pywrapfst.pyx":992
+ /* "pywrapfst.pyx":993
*
* cdef const_SymbolTable_ptr _raw(self):
* return self._mutable_raw() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mutable_raw");
- __PYX_ERR(0, 992, __pyx_L1_error)
+ __PYX_ERR(0, 993, __pyx_L1_error)
}
__pyx_r = ((struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw(__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":991
+ /* "pywrapfst.pyx":992
* """
*
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":998
+/* "pywrapfst.pyx":999
* # Should not be directly accessed except by `_mutable__raw_ptr_or_raise()`.
* # All other methods should use the safer _mutable__raw_ptr_or_raise() instead.
* cdef SymbolTable_ptr _mutable_raw(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_mutable_raw", 0);
- /* "pywrapfst.pyx":999
+ /* "pywrapfst.pyx":1000
* # All other methods should use the safer _mutable__raw_ptr_or_raise() instead.
* cdef SymbolTable_ptr _mutable_raw(self):
* return NULL # <<<<<<<<<<<<<<
__pyx_r = NULL;
goto __pyx_L0;
- /* "pywrapfst.pyx":998
+ /* "pywrapfst.pyx":999
* # Should not be directly accessed except by `_mutable__raw_ptr_or_raise()`.
* # All other methods should use the safer _mutable__raw_ptr_or_raise() instead.
* cdef SymbolTable_ptr _mutable_raw(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1003
+/* "pywrapfst.pyx":1004
* # Internal API method that should be used when a mutable pointer to an
* # fst.SymbolTable is required.
* cdef SymbolTable_ptr _mutable_raw_ptr_or_raise(self) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_mutable_raw_ptr_or_raise", 0);
- /* "pywrapfst.pyx":1004
+ /* "pywrapfst.pyx":1005
* # fst.SymbolTable is required.
* cdef SymbolTable_ptr _mutable_raw_ptr_or_raise(self) except *:
* cdef SymbolTable_ptr mutable_raw = self._mutable_raw() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mutable_raw");
- __PYX_ERR(0, 1004, __pyx_L1_error)
+ __PYX_ERR(0, 1005, __pyx_L1_error)
}
__pyx_v_mutable_raw = ((struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw(__pyx_v_self);
- /* "pywrapfst.pyx":1005
+ /* "pywrapfst.pyx":1006
* cdef SymbolTable_ptr _mutable_raw_ptr_or_raise(self) except *:
* cdef SymbolTable_ptr mutable_raw = self._mutable_raw()
* if mutable_raw == NULL: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_mutable_raw == NULL) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":1006
+ /* "pywrapfst.pyx":1007
* cdef SymbolTable_ptr mutable_raw = self._mutable_raw()
* if mutable_raw == NULL:
* self._raise_nonexistent() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raise_nonexistent");
- __PYX_ERR(0, 1006, __pyx_L1_error)
+ __PYX_ERR(0, 1007, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._raise_nonexistent(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1006, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._raise_nonexistent(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1007, __pyx_L1_error)
- /* "pywrapfst.pyx":1005
+ /* "pywrapfst.pyx":1006
* cdef SymbolTable_ptr _mutable_raw_ptr_or_raise(self) except *:
* cdef SymbolTable_ptr mutable_raw = self._mutable_raw()
* if mutable_raw == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1007
+ /* "pywrapfst.pyx":1008
* if mutable_raw == NULL:
* self._raise_nonexistent()
* return mutable_raw # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_mutable_raw;
goto __pyx_L0;
- /* "pywrapfst.pyx":1003
+ /* "pywrapfst.pyx":1004
* # Internal API method that should be used when a mutable pointer to an
* # fst.SymbolTable is required.
* cdef SymbolTable_ptr _mutable_raw_ptr_or_raise(self) except *: # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1009
+/* "pywrapfst.pyx":1010
* return mutable_raw
*
* cpdef int64 add_symbol(self, symbol, int64 key=fst.kNoSymbol) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __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, 1010, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol)) {
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __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, 1009, __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, 1010, __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, 1009, __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, 1010, __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, 1009, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1010, __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, 1009, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1010, __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;
#endif
}
- /* "pywrapfst.pyx":1026
+ /* "pywrapfst.pyx":1027
* The integer key of the new symbol.
* """
* cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mutable_raw_ptr_or_raise");
- __PYX_ERR(0, 1026, __pyx_L1_error)
+ __PYX_ERR(0, 1027, __pyx_L1_error)
}
- __pyx_t_9 = ((struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1026, __pyx_L1_error)
+ __pyx_t_9 = ((struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1027, __pyx_L1_error)
__pyx_v__mutable_raw = __pyx_t_9;
- /* "pywrapfst.pyx":1027
+ /* "pywrapfst.pyx":1028
* """
* cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
* cdef string _symbol = tostring(symbol) # <<<<<<<<<<<<<<
* if key != fst.kNoSymbol:
* return _mutable_raw.AddSymbol(_symbol, key)
*/
- __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_symbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1027, __pyx_L1_error)
+ __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_symbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1028, __pyx_L1_error)
__pyx_v__symbol = __pyx_t_10;
- /* "pywrapfst.pyx":1028
+ /* "pywrapfst.pyx":1029
* cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
* cdef string _symbol = tostring(symbol)
* if key != fst.kNoSymbol: # <<<<<<<<<<<<<<
__pyx_t_11 = ((__pyx_v_key != fst::kNoSymbol) != 0);
if (__pyx_t_11) {
- /* "pywrapfst.pyx":1029
+ /* "pywrapfst.pyx":1030
* cdef string _symbol = tostring(symbol)
* if key != fst.kNoSymbol:
* return _mutable_raw.AddSymbol(_symbol, key) # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__mutable_raw->AddSymbol(__pyx_v__symbol, __pyx_v_key);
goto __pyx_L0;
- /* "pywrapfst.pyx":1028
+ /* "pywrapfst.pyx":1029
* cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
* cdef string _symbol = tostring(symbol)
* if key != fst.kNoSymbol: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1031
+ /* "pywrapfst.pyx":1032
* return _mutable_raw.AddSymbol(_symbol, key)
* else:
* return _mutable_raw.AddSymbol(_symbol) # <<<<<<<<<<<<<<
goto __pyx_L0;
}
- /* "pywrapfst.pyx":1009
+ /* "pywrapfst.pyx":1010
* return mutable_raw
*
* cpdef int64 add_symbol(self, symbol, int64 key=fst.kNoSymbol) except *: # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symbol") < 0)) __PYX_ERR(0, 1009, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symbol") < 0)) __PYX_ERR(0, 1010, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L3_error)
+ __pyx_v_key = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_key == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1010, __pyx_L3_error)
} else {
__pyx_v_key = __pyx_k__6;
}
}
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, 1009, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add_symbol", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1010, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableSymbolTable.add_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__Pyx_XDECREF(__pyx_r);
__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); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
+ __pyx_t_1 = __pyx_vtabptr_9pywrapfst__MutableSymbolTable->add_symbol(__pyx_v_self, __pyx_v_symbol, 1, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1010, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1033
+/* "pywrapfst.pyx":1034
* return _mutable_raw.AddSymbol(_symbol)
*
* cpdef void add_table(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __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, 1034, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_symbols)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_symbols));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1034, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":1045
+ /* "pywrapfst.pyx":1046
* symbols: A SymbolTable to be merged with the current table.
* """
* self._mutable_raw_ptr_or_raise().AddTable( # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mutable_raw_ptr_or_raise");
- __PYX_ERR(0, 1045, __pyx_L1_error)
+ __PYX_ERR(0, 1046, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1045, __pyx_L1_error)
+ __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1046, __pyx_L1_error)
- /* "pywrapfst.pyx":1046
+ /* "pywrapfst.pyx":1047
* """
* self._mutable_raw_ptr_or_raise().AddTable(
* deref(symbols._raw_ptr_or_raise())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1046, __pyx_L1_error)
+ __PYX_ERR(0, 1047, __pyx_L1_error)
}
- __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1046, __pyx_L1_error)
+ __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1047, __pyx_L1_error)
- /* "pywrapfst.pyx":1045
+ /* "pywrapfst.pyx":1046
* symbols: A SymbolTable to be merged with the current table.
* """
* self._mutable_raw_ptr_or_raise().AddTable( # <<<<<<<<<<<<<<
*/
__pyx_t_5->AddTable((*__pyx_t_6));
- /* "pywrapfst.pyx":1033
+ /* "pywrapfst.pyx":1034
* return _mutable_raw.AddSymbol(_symbol)
*
* cpdef void add_table(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_table (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1033, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1034, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_19_MutableSymbolTable_2add_table(((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_symbols));
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add_table", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(__pyx_v_self, __pyx_v_symbols, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1033, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(__pyx_v_self, __pyx_v_symbols, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1034, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1048
+/* "pywrapfst.pyx":1049
* deref(symbols._raw_ptr_or_raise()))
*
* cpdef void set_name(self, new_name) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __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, 1049, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_19_MutableSymbolTable_5set_name)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_new_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_new_name);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":1049
+ /* "pywrapfst.pyx":1050
*
* cpdef void set_name(self, new_name) except *:
* self._mutable_raw_ptr_or_raise().SetName(tostring(new_name)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mutable_raw_ptr_or_raise");
- __PYX_ERR(0, 1049, __pyx_L1_error)
+ __PYX_ERR(0, 1050, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L1_error)
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_new_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L1_error)
+ __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1050, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_new_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1050, __pyx_L1_error)
__pyx_t_5->SetName(__pyx_t_6);
- /* "pywrapfst.pyx":1048
+ /* "pywrapfst.pyx":1049
* deref(symbols._raw_ptr_or_raise()))
*
* cpdef void set_name(self, new_name) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 1048, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __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, 1049, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1059
+/* "pywrapfst.pyx":1060
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1060
+ /* "pywrapfst.pyx":1061
*
* def __repr__(self):
* return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>" # <<<<<<<<<<<<<<
* cdef SymbolTable_ptr _mutable_raw(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1061, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Fst_SymbolTableView);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
- __PYX_ERR(0, 1060, __pyx_L1_error)
+ __PYX_ERR(0, 1061, __pyx_L1_error)
}
- __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1060, __pyx_L1_error)
- __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1060, __pyx_L1_error)
+ __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1061, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1061, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1060, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1061, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
__pyx_t_2 += 6;
__Pyx_GIVEREF(__pyx_kp_u_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_at_0x);
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1060, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1061, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1060, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1061, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1060, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1061, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1059
+ /* "pywrapfst.pyx":1060
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1062
+/* "pywrapfst.pyx":1063
* return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>"
*
* cdef SymbolTable_ptr _mutable_raw(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_mutable_raw", 0);
- /* "pywrapfst.pyx":1063
+ /* "pywrapfst.pyx":1064
*
* cdef SymbolTable_ptr _mutable_raw(self):
* return (self._mfst.get().MutableInputSymbols() if self._input_side else # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
- __PYX_ERR(0, 1063, __pyx_L1_error)
+ __PYX_ERR(0, 1064, __pyx_L1_error)
}
if ((__pyx_v_self->_input_side != 0)) {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 1063, __pyx_L1_error)
+ __PYX_ERR(0, 1064, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->MutableInputSymbols();
} else {
- /* "pywrapfst.pyx":1064
+ /* "pywrapfst.pyx":1065
* cdef SymbolTable_ptr _mutable_raw(self):
* return (self._mfst.get().MutableInputSymbols() if self._input_side else
* self._mfst.get().MutableOutputSymbols()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 1064, __pyx_L1_error)
+ __PYX_ERR(0, 1065, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->MutableOutputSymbols();
}
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "pywrapfst.pyx":1062
+ /* "pywrapfst.pyx":1063
* return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>"
*
* cdef SymbolTable_ptr _mutable_raw(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1084
+/* "pywrapfst.pyx":1085
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1085
+ /* "pywrapfst.pyx":1086
*
* def __repr__(self):
* return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>" # <<<<<<<<<<<<<<
* def __init__(self, name="<unspecified>"):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1085, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_SymbolTable);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
- __PYX_ERR(0, 1085, __pyx_L1_error)
+ __PYX_ERR(0, 1086, __pyx_L1_error)
}
- __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1085, __pyx_L1_error)
- __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1085, __pyx_L1_error)
+ __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1086, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1086, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1085, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1086, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
__pyx_t_2 += 6;
__Pyx_GIVEREF(__pyx_kp_u_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_at_0x);
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1085, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1086, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1085, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1086, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1085, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1086, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1084
+ /* "pywrapfst.pyx":1085
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1087
+/* "pywrapfst.pyx":1088
* return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"
*
* def __init__(self, name="<unspecified>"): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1087, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1088, __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, 1087, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1088, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.SymbolTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":1088
+ /* "pywrapfst.pyx":1089
*
* def __init__(self, name="<unspecified>"):
* self._smart_table.reset(new fst.SymbolTable(tostring(name))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_smart_table");
- __PYX_ERR(0, 1088, __pyx_L1_error)
+ __PYX_ERR(0, 1089, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1088, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1089, __pyx_L1_error)
__pyx_v_self->_smart_table.reset(new fst::SymbolTable(__pyx_t_1));
- /* "pywrapfst.pyx":1087
+ /* "pywrapfst.pyx":1088
* return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"
*
* def __init__(self, name="<unspecified>"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1090
+/* "pywrapfst.pyx":1091
* self._smart_table.reset(new fst.SymbolTable(tostring(name)))
*
* cdef SymbolTable_ptr _mutable_raw(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_mutable_raw", 0);
- /* "pywrapfst.pyx":1091
+ /* "pywrapfst.pyx":1092
*
* cdef SymbolTable_ptr _mutable_raw(self):
* return self._smart_table.get() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_smart_table");
- __PYX_ERR(0, 1091, __pyx_L1_error)
+ __PYX_ERR(0, 1092, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_smart_table.get();
goto __pyx_L0;
- /* "pywrapfst.pyx":1090
+ /* "pywrapfst.pyx":1091
* self._smart_table.reset(new fst.SymbolTable(tostring(name)))
*
* cdef SymbolTable_ptr _mutable_raw(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1094
+/* "pywrapfst.pyx":1095
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read", 0);
- /* "pywrapfst.pyx":1109
+ /* "pywrapfst.pyx":1110
* """
* cdef unique_ptr[fst.SymbolTable] _symbols
* _symbols.reset(fst.SymbolTable.Read(path_tostring(source))) # <<<<<<<<<<<<<<
* if _symbols.get() == NULL:
* raise FstIOError(f"Read failed: {source!r}")
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1109, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L1_error)
__pyx_v__symbols.reset(fst::SymbolTable::Read(__pyx_t_1));
- /* "pywrapfst.pyx":1110
+ /* "pywrapfst.pyx":1111
* cdef unique_ptr[fst.SymbolTable] _symbols
* _symbols.reset(fst.SymbolTable.Read(path_tostring(source)))
* if _symbols.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v__symbols.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1111
+ /* "pywrapfst.pyx":1112
* _symbols.reset(fst.SymbolTable.Read(path_tostring(source)))
* if _symbols.get() == NULL:
* raise FstIOError(f"Read failed: {source!r}") # <<<<<<<<<<<<<<
* return _init_SymbolTable(move(_symbols))
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1111, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1111, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1111, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1111, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 1111, __pyx_L1_error)
+ __PYX_ERR(0, 1112, __pyx_L1_error)
- /* "pywrapfst.pyx":1110
+ /* "pywrapfst.pyx":1111
* cdef unique_ptr[fst.SymbolTable] _symbols
* _symbols.reset(fst.SymbolTable.Read(path_tostring(source)))
* if _symbols.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1112
+ /* "pywrapfst.pyx":1113
* if _symbols.get() == NULL:
* raise FstIOError(f"Read failed: {source!r}")
* return _init_SymbolTable(move(_symbols)) # <<<<<<<<<<<<<<
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1094
+ /* "pywrapfst.pyx":1095
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1115
+/* "pywrapfst.pyx":1116
*
* @classmethod
* def read_text(cls, source, 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, 1115, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_text") < 0)) __PYX_ERR(0, 1116, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_source = 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, 1115, __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, 1116, __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, 1115, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_text", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1116, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.SymbolTable.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "pywrapfst.pyx":1132
+ /* "pywrapfst.pyx":1133
* """
* 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":1134
+ /* "pywrapfst.pyx":1135
* _opts.reset(new fst.SymbolTableTextOptions(allow_negative_labels))
* cdef unique_ptr[fst.SymbolTable] _symbols
* _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source), # <<<<<<<<<<<<<<
* deref(_opts)))
* if _symbols.get() == NULL:
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1134, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1135, __pyx_L1_error)
- /* "pywrapfst.pyx":1135
+ /* "pywrapfst.pyx":1136
* cdef unique_ptr[fst.SymbolTable] _symbols
* _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source),
* deref(_opts))) # <<<<<<<<<<<<<<
*/
__pyx_v__symbols.reset(fst::SymbolTable::ReadText(__pyx_t_1, (*__pyx_v__opts)));
- /* "pywrapfst.pyx":1136
+ /* "pywrapfst.pyx":1137
* _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source),
* deref(_opts)))
* if _symbols.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v__symbols.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1137
+ /* "pywrapfst.pyx":1138
* deref(_opts)))
* if _symbols.get() == NULL:
* raise FstIOError(f"Read failed: {source!r}") # <<<<<<<<<<<<<<
* return _init_SymbolTable(move(_symbols))
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1137, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1138, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1137, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1138, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 1137, __pyx_L1_error)
+ __PYX_ERR(0, 1138, __pyx_L1_error)
- /* "pywrapfst.pyx":1136
+ /* "pywrapfst.pyx":1137
* _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source),
* deref(_opts)))
* if _symbols.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1138
+ /* "pywrapfst.pyx":1139
* if _symbols.get() == NULL:
* raise FstIOError(f"Read failed: {source!r}")
* return _init_SymbolTable(move(_symbols)) # <<<<<<<<<<<<<<
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1139, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1115
+ /* "pywrapfst.pyx":1116
*
* @classmethod
* def read_text(cls, source, bool allow_negative_labels=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1141
+/* "pywrapfst.pyx":1142
*
* @classmethod
* def read_fst(cls, source, bool input_table): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input_table)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, 1); __PYX_ERR(0, 1141, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, 1); __PYX_ERR(0, 1142, __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, 1141, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_fst") < 0)) __PYX_ERR(0, 1142, __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_source = values[0];
- __pyx_v_input_table = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_input_table == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1141, __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, 1142, __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, 1141, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1142, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.SymbolTable.read_fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_fst", 0);
- /* "pywrapfst.pyx":1162
+ /* "pywrapfst.pyx":1163
* """
* cdef unique_ptr[fst.SymbolTable] _symbols
* _symbols.reset(fst.FstReadSymbols(path_tostring(source), input_table)) # <<<<<<<<<<<<<<
* if _symbols.get() == NULL:
* raise FstIOError(f"Read from FST failed: {source!r}")
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1162, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1163, __pyx_L1_error)
__pyx_v__symbols.reset(fst::FstReadSymbols(__pyx_t_1, __pyx_v_input_table));
- /* "pywrapfst.pyx":1163
+ /* "pywrapfst.pyx":1164
* cdef unique_ptr[fst.SymbolTable] _symbols
* _symbols.reset(fst.FstReadSymbols(path_tostring(source), input_table))
* if _symbols.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v__symbols.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1164
+ /* "pywrapfst.pyx":1165
* _symbols.reset(fst.FstReadSymbols(path_tostring(source), input_table))
* if _symbols.get() == NULL:
* raise FstIOError(f"Read from FST failed: {source!r}") # <<<<<<<<<<<<<<
* return _init_SymbolTable(move(_symbols))
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1164, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1164, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_from_FST_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1164, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_from_FST_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 1164, __pyx_L1_error)
+ __PYX_ERR(0, 1165, __pyx_L1_error)
- /* "pywrapfst.pyx":1163
+ /* "pywrapfst.pyx":1164
* cdef unique_ptr[fst.SymbolTable] _symbols
* _symbols.reset(fst.FstReadSymbols(path_tostring(source), input_table))
* if _symbols.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1165
+ /* "pywrapfst.pyx":1166
* if _symbols.get() == NULL:
* raise FstIOError(f"Read from FST failed: {source!r}")
* return _init_SymbolTable(move(_symbols)) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1165, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1141
+ /* "pywrapfst.pyx":1142
*
* @classmethod
* def read_fst(cls, source, bool input_table): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1168
+/* "pywrapfst.pyx":1169
*
*
* cdef _EncodeMapperSymbolTableView _init_EncodeMapperSymbolTableView( # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_EncodeMapperSymbolTableView", 0);
- /* "pywrapfst.pyx":1171
+ /* "pywrapfst.pyx":1172
* shared_ptr[fst.EncodeMapperClass] mapper, bool input_side):
* cdef _EncodeMapperSymbolTableView _symbols = (
* _EncodeMapperSymbolTableView.__new__(_EncodeMapperSymbolTableView)) # <<<<<<<<<<<<<<
* _symbols._mapper = move(mapper)
* _symbols._input_side = input_side
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst__EncodeMapperSymbolTableView(((PyTypeObject *)__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst__EncodeMapperSymbolTableView(((PyTypeObject *)__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__symbols = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1172
+ /* "pywrapfst.pyx":1173
* cdef _EncodeMapperSymbolTableView _symbols = (
* _EncodeMapperSymbolTableView.__new__(_EncodeMapperSymbolTableView))
* _symbols._mapper = move(mapper) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1172, __pyx_L1_error)
+ __PYX_ERR(0, 1173, __pyx_L1_error)
}
__pyx_v__symbols->_mapper = fst::move<std::shared_ptr<fst::script::EncodeMapperClass> >(__pyx_v_mapper);
- /* "pywrapfst.pyx":1173
+ /* "pywrapfst.pyx":1174
* _EncodeMapperSymbolTableView.__new__(_EncodeMapperSymbolTableView))
* _symbols._mapper = move(mapper)
* _symbols._input_side = input_side # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
- __PYX_ERR(0, 1173, __pyx_L1_error)
+ __PYX_ERR(0, 1174, __pyx_L1_error)
}
__pyx_v__symbols->_input_side = __pyx_v_input_side;
- /* "pywrapfst.pyx":1174
+ /* "pywrapfst.pyx":1175
* _symbols._mapper = move(mapper)
* _symbols._input_side = input_side
* return _symbols # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__symbols;
goto __pyx_L0;
- /* "pywrapfst.pyx":1168
+ /* "pywrapfst.pyx":1169
*
*
* cdef _EncodeMapperSymbolTableView _init_EncodeMapperSymbolTableView( # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1177
+/* "pywrapfst.pyx":1178
*
*
* cdef _FstSymbolTableView _init_FstSymbolTableView(shared_ptr[fst.FstClass] ifst, # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_FstSymbolTableView", 0);
- /* "pywrapfst.pyx":1180
+ /* "pywrapfst.pyx":1181
* bool input_side):
* cdef _FstSymbolTableView _symbols = (
* _FstSymbolTableView.__new__(_FstSymbolTableView)) # <<<<<<<<<<<<<<
* _symbols._fst = move(ifst)
* _symbols._input_side = input_side
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst__FstSymbolTableView(((PyTypeObject *)__pyx_ptype_9pywrapfst__FstSymbolTableView), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst__FstSymbolTableView(((PyTypeObject *)__pyx_ptype_9pywrapfst__FstSymbolTableView), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__symbols = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1181
+ /* "pywrapfst.pyx":1182
* cdef _FstSymbolTableView _symbols = (
* _FstSymbolTableView.__new__(_FstSymbolTableView))
* _symbols._fst = move(ifst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1181, __pyx_L1_error)
+ __PYX_ERR(0, 1182, __pyx_L1_error)
}
__pyx_v__symbols->_fst = fst::move<std::shared_ptr<fst::script::FstClass> >(__pyx_v_ifst);
- /* "pywrapfst.pyx":1182
+ /* "pywrapfst.pyx":1183
* _FstSymbolTableView.__new__(_FstSymbolTableView))
* _symbols._fst = move(ifst)
* _symbols._input_side = input_side # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
- __PYX_ERR(0, 1182, __pyx_L1_error)
+ __PYX_ERR(0, 1183, __pyx_L1_error)
}
__pyx_v__symbols->_input_side = __pyx_v_input_side;
- /* "pywrapfst.pyx":1183
+ /* "pywrapfst.pyx":1184
* _symbols._fst = move(ifst)
* _symbols._input_side = input_side
* return _symbols # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__symbols;
goto __pyx_L0;
- /* "pywrapfst.pyx":1177
+ /* "pywrapfst.pyx":1178
*
*
* cdef _FstSymbolTableView _init_FstSymbolTableView(shared_ptr[fst.FstClass] ifst, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1186
+/* "pywrapfst.pyx":1187
*
*
* cdef _MutableFstSymbolTableView _init_MutableFstSymbolTableView( # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_MutableFstSymbolTableView", 0);
- /* "pywrapfst.pyx":1190
+ /* "pywrapfst.pyx":1191
* bool input_side):
* cdef _MutableFstSymbolTableView _symbols = (
* _MutableFstSymbolTableView.__new__(_MutableFstSymbolTableView)) # <<<<<<<<<<<<<<
* _symbols._mfst = move(ifst)
* _symbols._input_side = input_side
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst__MutableFstSymbolTableView(((PyTypeObject *)__pyx_ptype_9pywrapfst__MutableFstSymbolTableView), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst__MutableFstSymbolTableView(((PyTypeObject *)__pyx_ptype_9pywrapfst__MutableFstSymbolTableView), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__symbols = ((struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1191
+ /* "pywrapfst.pyx":1192
* cdef _MutableFstSymbolTableView _symbols = (
* _MutableFstSymbolTableView.__new__(_MutableFstSymbolTableView))
* _symbols._mfst = move(ifst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 1191, __pyx_L1_error)
+ __PYX_ERR(0, 1192, __pyx_L1_error)
}
__pyx_v__symbols->_mfst = fst::move<std::shared_ptr<fst::script::MutableFstClass> >(__pyx_v_ifst);
- /* "pywrapfst.pyx":1192
+ /* "pywrapfst.pyx":1193
* _MutableFstSymbolTableView.__new__(_MutableFstSymbolTableView))
* _symbols._mfst = move(ifst)
* _symbols._input_side = input_side # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
- __PYX_ERR(0, 1192, __pyx_L1_error)
+ __PYX_ERR(0, 1193, __pyx_L1_error)
}
__pyx_v__symbols->_input_side = __pyx_v_input_side;
- /* "pywrapfst.pyx":1193
+ /* "pywrapfst.pyx":1194
* _symbols._mfst = move(ifst)
* _symbols._input_side = input_side
* return _symbols # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__symbols;
goto __pyx_L0;
- /* "pywrapfst.pyx":1186
+ /* "pywrapfst.pyx":1187
*
*
* cdef _MutableFstSymbolTableView _init_MutableFstSymbolTableView( # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1196
+/* "pywrapfst.pyx":1197
*
*
* cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_SymbolTable", 0);
- /* "pywrapfst.pyx":1197
+ /* "pywrapfst.pyx":1198
*
* cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols):
* cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable) # <<<<<<<<<<<<<<
* _symbols._smart_table = move(symbols)
* return _symbols
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_SymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst_SymbolTable), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_SymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst_SymbolTable), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__symbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1198
+ /* "pywrapfst.pyx":1199
* cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols):
* cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
* _symbols._smart_table = move(symbols) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_smart_table");
- __PYX_ERR(0, 1198, __pyx_L1_error)
+ __PYX_ERR(0, 1199, __pyx_L1_error)
}
__pyx_v__symbols->_smart_table = fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v_symbols);
- /* "pywrapfst.pyx":1199
+ /* "pywrapfst.pyx":1200
* cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
* _symbols._smart_table = move(symbols)
* return _symbols # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__symbols;
goto __pyx_L0;
- /* "pywrapfst.pyx":1196
+ /* "pywrapfst.pyx":1197
*
*
* cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1202
+/* "pywrapfst.pyx":1203
*
*
* cpdef SymbolTable _read_SymbolTable_from_string(string state): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_read_SymbolTable_from_string", 0);
- /* "pywrapfst.pyx":1204
+ /* "pywrapfst.pyx":1205
* cpdef SymbolTable _read_SymbolTable_from_string(string state):
* cdef stringstream _sstrm
* _sstrm << state # <<<<<<<<<<<<<<
*/
(void)((__pyx_v__sstrm << __pyx_v_state));
- /* "pywrapfst.pyx":1206
+ /* "pywrapfst.pyx":1207
* _sstrm << state
* cdef unique_ptr[fst.SymbolTable] _symbols
* _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>")) # <<<<<<<<<<<<<<
*/
__pyx_v__symbols.reset(fst::SymbolTable::Read(__pyx_v__sstrm, __pyx_k_pywrapfst));
- /* "pywrapfst.pyx":1207
+ /* "pywrapfst.pyx":1208
* cdef unique_ptr[fst.SymbolTable] _symbols
* _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
* if _symbols.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v__symbols.get() == NULL) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":1208
+ /* "pywrapfst.pyx":1209
* _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
* if _symbols.get() == NULL:
* raise FstIOError("Read from string failed") # <<<<<<<<<<<<<<
* return _init_SymbolTable(move(_symbols))
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Read_from_string_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Read_from_string_failed);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1208, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1209, __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, 1208, __pyx_L1_error)
+ __PYX_ERR(0, 1209, __pyx_L1_error)
- /* "pywrapfst.pyx":1207
+ /* "pywrapfst.pyx":1208
* cdef unique_ptr[fst.SymbolTable] _symbols
* _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
* if _symbols.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1209
+ /* "pywrapfst.pyx":1210
* if _symbols.get() == NULL:
* raise FstIOError("Read from string failed")
* return _init_SymbolTable(move(_symbols)) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1209, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1202
+ /* "pywrapfst.pyx":1203
*
*
* cpdef SymbolTable _read_SymbolTable_from_string(string state): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_read_SymbolTable_from_string (wrapper)", 0);
assert(__pyx_arg_state); {
- __pyx_v_state = __pyx_convert_string_from_py_std__in_string(__pyx_arg_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L3_error)
+ __pyx_v_state = __pyx_convert_string_from_py_std__in_string(__pyx_arg_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1203, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_read_SymbolTable_from_string", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_SymbolTable_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_SymbolTable_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1215
+/* "pywrapfst.pyx":1216
*
*
* cpdef SymbolTable compact_symbol_table(SymbolTableView symbols): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("compact_symbol_table", 0);
- /* "pywrapfst.pyx":1227
+ /* "pywrapfst.pyx":1228
* A new compacted SymbolTable.
* """
* return _init_SymbolTable(WrapUnique(fst.CompactSymbolTable( # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "pywrapfst.pyx":1228
+ /* "pywrapfst.pyx":1229
* """
* return _init_SymbolTable(WrapUnique(fst.CompactSymbolTable(
* deref(symbols._raw_ptr_or_raise())))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1228, __pyx_L1_error)
+ __PYX_ERR(0, 1229, __pyx_L1_error)
}
- __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1228, __pyx_L1_error)
+ __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1229, __pyx_L1_error)
- /* "pywrapfst.pyx":1227
+ /* "pywrapfst.pyx":1228
* A new compacted SymbolTable.
* """
* return _init_SymbolTable(WrapUnique(fst.CompactSymbolTable( # <<<<<<<<<<<<<<
* deref(symbols._raw_ptr_or_raise()))))
*
*/
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::WrapUnique<fst::SymbolTable>(fst::CompactSymbolTable((*__pyx_t_1))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1227, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::WrapUnique<fst::SymbolTable>(fst::CompactSymbolTable((*__pyx_t_1))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1215
+ /* "pywrapfst.pyx":1216
*
*
* cpdef SymbolTable compact_symbol_table(SymbolTableView symbols): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("compact_symbol_table (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1215, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1216, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_10compact_symbol_table(__pyx_self, ((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_symbols));
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("compact_symbol_table", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_compact_symbol_table(__pyx_v_symbols, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1215, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_compact_symbol_table(__pyx_v_symbols, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1231
+/* "pywrapfst.pyx":1232
*
*
* cpdef SymbolTable merge_symbol_table(SymbolTableView lhs, # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("merge_symbol_table", 0);
- /* "pywrapfst.pyx":1254
+ /* "pywrapfst.pyx":1255
* A new merged SymbolTable.
* """
* return _init_SymbolTable(WrapUnique(fst.MergeSymbolTable( # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "pywrapfst.pyx":1255
+ /* "pywrapfst.pyx":1256
* """
* return _init_SymbolTable(WrapUnique(fst.MergeSymbolTable(
* deref(lhs._raw_ptr_or_raise()), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1255, __pyx_L1_error)
+ __PYX_ERR(0, 1256, __pyx_L1_error)
}
- __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_lhs->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_lhs); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1255, __pyx_L1_error)
+ __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_lhs->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_lhs); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1256, __pyx_L1_error)
- /* "pywrapfst.pyx":1256
+ /* "pywrapfst.pyx":1257
* return _init_SymbolTable(WrapUnique(fst.MergeSymbolTable(
* deref(lhs._raw_ptr_or_raise()),
* deref(rhs._raw_ptr_or_raise()), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1256, __pyx_L1_error)
+ __PYX_ERR(0, 1257, __pyx_L1_error)
}
- __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_rhs->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_rhs); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1256, __pyx_L1_error)
+ __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_rhs->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_rhs); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1257, __pyx_L1_error)
- /* "pywrapfst.pyx":1254
+ /* "pywrapfst.pyx":1255
* A new merged SymbolTable.
* """
* return _init_SymbolTable(WrapUnique(fst.MergeSymbolTable( # <<<<<<<<<<<<<<
* deref(lhs._raw_ptr_or_raise()),
* deref(rhs._raw_ptr_or_raise()),
*/
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::WrapUnique<fst::SymbolTable>(fst::MergeSymbolTable((*__pyx_t_1), (*__pyx_t_2), NULL)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::WrapUnique<fst::SymbolTable>(fst::MergeSymbolTable((*__pyx_t_1), (*__pyx_t_2), NULL)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1231
+ /* "pywrapfst.pyx":1232
*
*
* cpdef SymbolTable merge_symbol_table(SymbolTableView lhs, # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, 1); __PYX_ERR(0, 1231, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, 1); __PYX_ERR(0, 1232, __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, 1231, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "merge_symbol_table") < 0)) __PYX_ERR(0, 1232, __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, 1231, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1232, __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_SymbolTableView, 1, "lhs", 0))) __PYX_ERR(0, 1231, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "rhs", 0))) __PYX_ERR(0, 1232, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "lhs", 0))) __PYX_ERR(0, 1232, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "rhs", 0))) __PYX_ERR(0, 1233, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_12merge_symbol_table(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
/* function exit code */
int __pyx_clineno = 0;
__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, 1231, __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, 1232, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1270
+/* "pywrapfst.pyx":1271
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1271
+ /* "pywrapfst.pyx":1272
*
* def __repr__(self):
* return f"<_SymbolTableIterator at 0x{id(self):x}>" # <<<<<<<<<<<<<<
* def __init__(self, SymbolTableView symbols):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1271, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__pyx_t_2 += 27;
__Pyx_GIVEREF(__pyx_kp_u_SymbolTableIterator_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_SymbolTableIterator_at_0x);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1271, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1271, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1271, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1270
+ /* "pywrapfst.pyx":1271
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1273
+/* "pywrapfst.pyx":1274
* return f"<_SymbolTableIterator at 0x{id(self):x}>"
*
* def __init__(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
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, 1273, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1274, __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, 1273, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1274, __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_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1273, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1274, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_20_SymbolTableIterator_2__init__(((struct __pyx_obj_9pywrapfst__SymbolTableIterator *)__pyx_v_self), __pyx_v_symbols);
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":1274
+ /* "pywrapfst.pyx":1275
*
* def __init__(self, SymbolTableView symbols):
* self._table = symbols # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 1274, __pyx_L1_error)
+ __PYX_ERR(0, 1275, __pyx_L1_error)
}
__Pyx_INCREF(((PyObject *)__pyx_v_symbols));
__Pyx_GIVEREF(((PyObject *)__pyx_v_symbols));
__Pyx_DECREF(((PyObject *)__pyx_v_self->_table));
__pyx_v_self->_table = __pyx_v_symbols;
- /* "pywrapfst.pyx":1275
+ /* "pywrapfst.pyx":1276
* def __init__(self, SymbolTableView symbols):
* self._table = symbols
* self._siter.reset( # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 1275, __pyx_L1_error)
+ __PYX_ERR(0, 1276, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1276
+ /* "pywrapfst.pyx":1277
* self._table = symbols
* self._siter.reset(
* new fst.SymbolTableIterator(self._table._raw_ptr_or_raise().begin())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 1276, __pyx_L1_error)
+ __PYX_ERR(0, 1277, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self->_table) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1276, __pyx_L1_error)
+ __PYX_ERR(0, 1277, __pyx_L1_error)
}
- __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->_table->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self->_table); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1276, __pyx_L1_error)
+ __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->_table->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self->_table); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1277, __pyx_L1_error)
- /* "pywrapfst.pyx":1275
+ /* "pywrapfst.pyx":1276
* def __init__(self, SymbolTableView symbols):
* self._table = symbols
* self._siter.reset( # <<<<<<<<<<<<<<
*/
__pyx_v_self->_siter.reset(new fst::SymbolTable::iterator(__pyx_t_1->begin()));
- /* "pywrapfst.pyx":1273
+ /* "pywrapfst.pyx":1274
* return f"<_SymbolTableIterator at 0x{id(self):x}>"
*
* def __init__(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1279
+/* "pywrapfst.pyx":1280
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":1280
+ /* "pywrapfst.pyx":1281
* # 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":1279
+ /* "pywrapfst.pyx":1280
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1283
+/* "pywrapfst.pyx":1284
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "pywrapfst.pyx":1284
+ /* "pywrapfst.pyx":1285
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self._table._raw_ptr_or_raise().end() == deref(self._siter): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 1284, __pyx_L1_error)
+ __PYX_ERR(0, 1285, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self->_table) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1284, __pyx_L1_error)
+ __PYX_ERR(0, 1285, __pyx_L1_error)
}
- __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->_table->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self->_table); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1284, __pyx_L1_error)
+ __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->_table->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self->_table); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1285, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 1284, __pyx_L1_error)
+ __PYX_ERR(0, 1285, __pyx_L1_error)
}
__pyx_t_2 = ((__pyx_t_1->end() == (*__pyx_v_self->_siter)) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1285
+ /* "pywrapfst.pyx":1286
* def __next__(self):
* if self._table._raw_ptr_or_raise().end() == deref(self._siter):
* raise StopIteration # <<<<<<<<<<<<<<
* cdef string _symbol = self._siter.get().Pair().Symbol()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 1285, __pyx_L1_error)
+ __PYX_ERR(0, 1286, __pyx_L1_error)
- /* "pywrapfst.pyx":1284
+ /* "pywrapfst.pyx":1285
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self._table._raw_ptr_or_raise().end() == deref(self._siter): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1286
+ /* "pywrapfst.pyx":1287
* if self._table._raw_ptr_or_raise().end() == deref(self._siter):
* raise StopIteration
* cdef int64 _label = self._siter.get().Pair().Label() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 1286, __pyx_L1_error)
+ __PYX_ERR(0, 1287, __pyx_L1_error)
}
__pyx_v__label = __pyx_v_self->_siter.get()->operator*().Label();
- /* "pywrapfst.pyx":1287
+ /* "pywrapfst.pyx":1288
* raise StopIteration
* cdef int64 _label = self._siter.get().Pair().Label()
* cdef string _symbol = self._siter.get().Pair().Symbol() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 1287, __pyx_L1_error)
+ __PYX_ERR(0, 1288, __pyx_L1_error)
}
__pyx_v__symbol = __pyx_v_self->_siter.get()->operator*().Symbol();
- /* "pywrapfst.pyx":1288
+ /* "pywrapfst.pyx":1289
* cdef int64 _label = self._siter.get().Pair().Label()
* cdef string _symbol = self._siter.get().Pair().Symbol()
* inc(deref(self._siter)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 1288, __pyx_L1_error)
+ __PYX_ERR(0, 1289, __pyx_L1_error)
}
(void)((++(*__pyx_v_self->_siter)));
- /* "pywrapfst.pyx":1289
+ /* "pywrapfst.pyx":1290
* cdef string _symbol = self._siter.get().Pair().Symbol()
* inc(deref(self._siter))
* return (_label, _symbol) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v__label); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1289, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v__label); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1290, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v__symbol); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1289, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v__symbol); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1290, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1289, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1290, __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_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1283
+ /* "pywrapfst.pyx":1284
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1318
+/* "pywrapfst.pyx":1319
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1319
+ /* "pywrapfst.pyx":1320
*
* def __repr__(self):
* return f"<EncodeMapper at 0x{id(self):x}>" # <<<<<<<<<<<<<<
* def __init__(self,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__pyx_t_2 += 19;
__Pyx_GIVEREF(__pyx_kp_u_EncodeMapper_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_EncodeMapper_at_0x);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1319, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1318
+ /* "pywrapfst.pyx":1319
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1321
+/* "pywrapfst.pyx":1322
* return f"<EncodeMapper at 0x{id(self):x}>"
*
* 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, 1321, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1322, __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, 1323, __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, 1324, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1323
+ /* "pywrapfst.pyx":1324
* def __init__(self,
* arc_type="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, 1324, __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, 1325, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1324
+ /* "pywrapfst.pyx":1325
* arc_type="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, 1321, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1322, __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":1321
+ /* "pywrapfst.pyx":1322
* return f"<EncodeMapper at 0x{id(self):x}>"
*
* def __init__(self, # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":1325
+ /* "pywrapfst.pyx":1326
* bool encode_labels=False,
* bool encode_weights=False):
* cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights) # <<<<<<<<<<<<<<
*/
__pyx_v__flags = fst::script::GetEncodeFlags(__pyx_v_encode_labels, __pyx_v_encode_weights);
- /* "pywrapfst.pyx":1326
+ /* "pywrapfst.pyx":1327
* bool encode_weights=False):
* cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
* self._mapper.reset( # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1326, __pyx_L1_error)
+ __PYX_ERR(0, 1327, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1327
+ /* "pywrapfst.pyx":1328
* cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
* self._mapper.reset(
* new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE)) # <<<<<<<<<<<<<<
* if self._mapper.get() == NULL:
* raise FstOpError(f"Unknown arc type: {arc_type!r}")
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1327, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1328, __pyx_L1_error)
- /* "pywrapfst.pyx":1326
+ /* "pywrapfst.pyx":1327
* bool encode_weights=False):
* cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
* self._mapper.reset( # <<<<<<<<<<<<<<
*/
__pyx_v_self->_mapper.reset(new fst::script::EncodeMapperClass(__pyx_t_1, __pyx_v__flags, fst::ENCODE));
- /* "pywrapfst.pyx":1328
+ /* "pywrapfst.pyx":1329
* self._mapper.reset(
* new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
* if self._mapper.get() == NULL: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1328, __pyx_L1_error)
+ __PYX_ERR(0, 1329, __pyx_L1_error)
}
__pyx_t_2 = ((__pyx_v_self->_mapper.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1329
+ /* "pywrapfst.pyx":1330
* new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
* if self._mapper.get() == NULL:
* raise FstOpError(f"Unknown arc type: {arc_type!r}") # <<<<<<<<<<<<<<
*
* # Python's equivalent to operator().
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1329, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1330, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_arc_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1329, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_arc_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_arc_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1329, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_arc_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1330, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 1329, __pyx_L1_error)
+ __PYX_ERR(0, 1330, __pyx_L1_error)
- /* "pywrapfst.pyx":1328
+ /* "pywrapfst.pyx":1329
* self._mapper.reset(
* new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
* if self._mapper.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1321
+ /* "pywrapfst.pyx":1322
* return f"<EncodeMapper at 0x{id(self):x}>"
*
* def __init__(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1333
+/* "pywrapfst.pyx":1334
* # 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, 1333, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 1334, __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, 1333, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1334, __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, 1333, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1334, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_4__call__(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), __pyx_v_arc);
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__call__", 0);
- /* "pywrapfst.pyx":1349
+ /* "pywrapfst.pyx":1350
* FstOpError: Incompatible or invalid weight.
* """
* return _init_Arc(self._mapper.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 '%.30s'", "_mapper");
- __PYX_ERR(0, 1349, __pyx_L1_error)
+ __PYX_ERR(0, 1350, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 1349, __pyx_L1_error)
+ __PYX_ERR(0, 1350, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_mapper.get()->operator()((*__pyx_v_arc->_arc)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1349, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_mapper.get()->operator()((*__pyx_v_arc->_arc)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1333
+ /* "pywrapfst.pyx":1334
* # Python's equivalent to operator().
*
* def __call__(self, Arc arc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1353
+/* "pywrapfst.pyx":1354
* # Registers the class for pickling.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__reduce__", 0);
- /* "pywrapfst.pyx":1354
+ /* "pywrapfst.pyx":1355
*
* def __reduce__(self):
* return (_read_EncodeMapper_from_string, (self.write_to_string(),)) # <<<<<<<<<<<<<<
* cpdef string arc_type(self):
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_EncodeMapper_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_EncodeMapper_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "write_to_string");
- __PYX_ERR(0, 1354, __pyx_L1_error)
+ __PYX_ERR(0, 1355, __pyx_L1_error)
}
- __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error)
+ __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1355, __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_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1355, __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_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1353
+ /* "pywrapfst.pyx":1354
* # Registers the class for pickling.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1356
+/* "pywrapfst.pyx":1357
* return (_read_EncodeMapper_from_string, (self.write_to_string(),))
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __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, 1357, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_12EncodeMapper_9arc_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1356, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __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, 1356, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1357, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1362
+ /* "pywrapfst.pyx":1363
* Returns a string indicating the arc type.
* """
* return self._mapper.get().ArcType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1362, __pyx_L1_error)
+ __PYX_ERR(0, 1363, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mapper.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1356
+ /* "pywrapfst.pyx":1357
* return (_read_EncodeMapper_from_string, (self.write_to_string(),))
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arc_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_12EncodeMapper_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_12EncodeMapper_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1364
+/* "pywrapfst.pyx":1365
* return self._mapper.get().ArcType()
*
* cpdef string weight_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __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, 1365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_12EncodeMapper_11weight_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1365, __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, 1364, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1365, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1370
+ /* "pywrapfst.pyx":1371
* Returns a string indicating the weight type.
* """
* return self._mapper.get().WeightType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1370, __pyx_L1_error)
+ __PYX_ERR(0, 1371, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mapper.get()->WeightType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1364
+ /* "pywrapfst.pyx":1365
* return self._mapper.get().ArcType()
*
* cpdef string weight_type(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("weight_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_12EncodeMapper_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_12EncodeMapper_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1372
+/* "pywrapfst.pyx":1373
* return self._mapper.get().WeightType()
*
* cpdef uint8 flags(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __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, 1373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_12EncodeMapper_13flags)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1372, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1373, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1378
+ /* "pywrapfst.pyx":1379
* Returns the mapper's flags.
* """
* return self._mapper.get().Flags() # <<<<<<<<<<<<<<
*
- * cpdef uint64 properties(self, uint64 mask):
+ * def properties(self, mask):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1378, __pyx_L1_error)
+ __PYX_ERR(0, 1379, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mapper.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":1372
+ /* "pywrapfst.pyx":1373
* return self._mapper.get().WeightType()
*
* cpdef uint8 flags(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("flags", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_f_9pywrapfst_12EncodeMapper_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_f_9pywrapfst_12EncodeMapper_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1380
+/* "pywrapfst.pyx":1381
* return self._mapper.get().Flags()
*
- * cpdef uint64 properties(self, uint64 mask): # <<<<<<<<<<<<<<
+ * def properties(self, mask): # <<<<<<<<<<<<<<
* """
* properties(self, mask)
*/
-static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_15properties(PyObject *__pyx_v_self, PyObject *__pyx_arg_mask); /*proto*/
-static uint64 __pyx_f_9pywrapfst_12EncodeMapper_properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, uint64 __pyx_v_mask, int __pyx_skip_dispatch) {
- uint64 __pyx_r;
+/* Python wrapper */
+static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_15properties(PyObject *__pyx_v_self, PyObject *__pyx_v_mask); /*proto*/
+static char __pyx_doc_9pywrapfst_12EncodeMapper_14properties[] = "\n properties(self, mask)\n\n Provides property bits.\n\n This method provides user access to the properties of the mapper.\n\n Args:\n mask: The property mask to be compared to the mapper's properties.\n\n Returns:\n A 64-bit bitmask representing the requested properties.\n ";
+static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_15properties(PyObject *__pyx_v_self, PyObject *__pyx_v_mask) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("properties (wrapper)", 0);
+ __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_14properties(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), ((PyObject *)__pyx_v_mask));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_14properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_mask) {
+ PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
+ uint64 __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
- uint64 __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("properties", 0);
- /* Check if called by wrapper */
- if (unlikely(__pyx_skip_dispatch)) ;
- /* Check if overridden in Python */
- else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
- #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
- static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
- if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
- PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
- #endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_12EncodeMapper_15properties)) {
- __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1380, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- }
- }
- __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1380, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyInt_As_uint64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1380, __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;
- goto __pyx_L0;
- }
- #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
- __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
- __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
- if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
- __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
- }
- #endif
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
- }
- #endif
- }
- /* "pywrapfst.pyx":1394
- * A 64-bit bitmask representing the requested properties.
+ /* "pywrapfst.pyx":1396
* """
- * return self._mapper.get().Properties(mask) # <<<<<<<<<<<<<<
+ *
+ * return FstProperties(self._mapper.get().Properties(mask.value)) # <<<<<<<<<<<<<<
*
* @classmethod
*/
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1396, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1394, __pyx_L1_error)
+ __PYX_ERR(0, 1396, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1396, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyInt_As_uint64_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1396, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_mapper.get()->Properties(__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1396, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
}
- __pyx_r = __pyx_v_self->_mapper.get()->Properties(__pyx_v_mask);
+ __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1380
+ /* "pywrapfst.pyx":1381
* return self._mapper.get().Flags()
*
- * cpdef uint64 properties(self, uint64 mask): # <<<<<<<<<<<<<<
+ * def properties(self, mask): # <<<<<<<<<<<<<<
* """
* properties(self, mask)
*/
__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_WriteUnraisable("pywrapfst.EncodeMapper.properties", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_15properties(PyObject *__pyx_v_self, PyObject *__pyx_arg_mask); /*proto*/
-static char __pyx_doc_9pywrapfst_12EncodeMapper_14properties[] = "\n properties(self, mask)\n\n Provides property bits.\n\n This method provides user access to the properties of the mapper.\n\n Args:\n mask: The property mask to be compared to the mapper's properties.\n\n Returns:\n A 64-bit bitmask representing the requested properties.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_15properties(PyObject *__pyx_v_self, PyObject *__pyx_arg_mask) {
- uint64 __pyx_v_mask;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1380, __pyx_L3_error)
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L3_error:;
- __Pyx_AddTraceback("pywrapfst.EncodeMapper.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_14properties(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), ((uint64)__pyx_v_mask));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_14properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, uint64 __pyx_v_mask) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __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, 1380, __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.EncodeMapper.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1397
+/* "pywrapfst.pyx":1399
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read", 0);
- /* "pywrapfst.pyx":1413
+ /* "pywrapfst.pyx":1415
* """
* cdef unique_ptr[fst.EncodeMapperClass] _mapper
* _mapper.reset(fst.EncodeMapperClass.Read(path_tostring(source))) # <<<<<<<<<<<<<<
* if _mapper.get() == NULL:
* raise FstIOError(f"Read failed: {source!r}")
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1413, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1415, __pyx_L1_error)
__pyx_v__mapper.reset(fst::script::EncodeMapperClass::Read(__pyx_t_1));
- /* "pywrapfst.pyx":1414
+ /* "pywrapfst.pyx":1416
* cdef unique_ptr[fst.EncodeMapperClass] _mapper
* _mapper.reset(fst.EncodeMapperClass.Read(path_tostring(source)))
* if _mapper.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v__mapper.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1415
+ /* "pywrapfst.pyx":1417
* _mapper.reset(fst.EncodeMapperClass.Read(path_tostring(source)))
* if _mapper.get() == NULL:
* raise FstIOError(f"Read failed: {source!r}") # <<<<<<<<<<<<<<
* return _init_EncodeMapper(_mapper.release())
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1415, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1417, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1415, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1417, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1415, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1417, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1415, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 1415, __pyx_L1_error)
+ __PYX_ERR(0, 1417, __pyx_L1_error)
- /* "pywrapfst.pyx":1414
+ /* "pywrapfst.pyx":1416
* cdef unique_ptr[fst.EncodeMapperClass] _mapper
* _mapper.reset(fst.EncodeMapperClass.Read(path_tostring(source)))
* if _mapper.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1416
+ /* "pywrapfst.pyx":1418
* if _mapper.get() == NULL:
* raise FstIOError(f"Read failed: {source!r}")
* return _init_EncodeMapper(_mapper.release()) # <<<<<<<<<<<<<<
* @staticmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapper(__pyx_v__mapper.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1416, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapper(__pyx_v__mapper.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1397
+ /* "pywrapfst.pyx":1399
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1419
+/* "pywrapfst.pyx":1421
*
* @staticmethod
* def read_from_string(state): # <<<<<<<<<<<<<<
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_from_string") < 0)) __PYX_ERR(0, 1419, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_from_string") < 0)) __PYX_ERR(0, 1421, __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("read_from_string", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1419, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_from_string", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1421, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.EncodeMapper.read_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_from_string", 0);
- /* "pywrapfst.pyx":1434
+ /* "pywrapfst.pyx":1436
* FstIOError: Read failed.
* """
* return _read_EncodeMapper_from_string(state) # <<<<<<<<<<<<<<
* cpdef void write(self, source) except *:
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1434, __pyx_L1_error)
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__read_EncodeMapper_from_string(__pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1436, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__read_EncodeMapper_from_string(__pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1419
+ /* "pywrapfst.pyx":1421
*
* @staticmethod
* def read_from_string(state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1436
+/* "pywrapfst.pyx":1438
* return _read_EncodeMapper_from_string(state)
*
* cpdef void write(self, source) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); 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_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1438, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_12EncodeMapper_21write)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_source);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1438, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":1449
+ /* "pywrapfst.pyx":1451
* FstIOError: Write failed.
* """
* if not self._mapper.get().Write(path_tostring(source)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1449, __pyx_L1_error)
+ __PYX_ERR(0, 1451, __pyx_L1_error)
}
- __pyx_t_5 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1449, __pyx_L1_error)
+ __pyx_t_5 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1451, __pyx_L1_error)
__pyx_t_6 = ((!(__pyx_v_self->_mapper.get()->Write(__pyx_t_5) != 0)) != 0);
if (unlikely(__pyx_t_6)) {
- /* "pywrapfst.pyx":1450
+ /* "pywrapfst.pyx":1452
* """
* if not self._mapper.get().Write(path_tostring(source)):
* raise FstIOError(f"Write failed: {source!r}") # <<<<<<<<<<<<<<
*
* cpdef bytes write_to_string(self):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1450, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1450, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __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, 1450, __pyx_L1_error)
+ __PYX_ERR(0, 1452, __pyx_L1_error)
- /* "pywrapfst.pyx":1449
+ /* "pywrapfst.pyx":1451
* FstIOError: Write failed.
* """
* if not self._mapper.get().Write(path_tostring(source)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1436
+ /* "pywrapfst.pyx":1438
* return _read_EncodeMapper_from_string(state)
*
* cpdef void write(self, source) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_12EncodeMapper_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1436, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
+ __pyx_f_9pywrapfst_12EncodeMapper_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1438, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1438, __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":1454
* raise FstIOError(f"Write failed: {source!r}")
*
* cpdef bytes write_to_string(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_to_string); 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_write_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_12EncodeMapper_23write_to_string)) {
__Pyx_XDECREF(__pyx_r);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1452, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1452, __pyx_L1_error)
+ if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1454, __pyx_L1_error)
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1465
+ /* "pywrapfst.pyx":1467
* """
* cdef stringstream _sstrm
* if not self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>"): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1465, __pyx_L1_error)
+ __PYX_ERR(0, 1467, __pyx_L1_error)
}
__pyx_t_5 = ((!(__pyx_v_self->_mapper.get()->Write(__pyx_v__sstrm, __pyx_k_pywrapfst) != 0)) != 0);
if (unlikely(__pyx_t_5)) {
- /* "pywrapfst.pyx":1466
+ /* "pywrapfst.pyx":1468
* cdef stringstream _sstrm
* if not self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>"):
* raise FstIOError("Write to string failed") # <<<<<<<<<<<<<<
* return _sstrm.str()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1466, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Write_to_string_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Write_to_string_failed);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1466, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __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, 1466, __pyx_L1_error)
+ __PYX_ERR(0, 1468, __pyx_L1_error)
- /* "pywrapfst.pyx":1465
+ /* "pywrapfst.pyx":1467
* """
* cdef stringstream _sstrm
* if not self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>"): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1467
+ /* "pywrapfst.pyx":1469
* if not self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>"):
* raise FstIOError("Write to string failed")
* return _sstrm.str() # <<<<<<<<<<<<<<
* cpdef _EncodeMapperSymbolTableView input_symbols(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v__sstrm.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v__sstrm.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1452
+ /* "pywrapfst.pyx":1454
* raise FstIOError(f"Write failed: {source!r}")
*
* cpdef bytes write_to_string(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_to_string", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_12EncodeMapper_write_to_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_12EncodeMapper_write_to_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1469
+/* "pywrapfst.pyx":1471
* return _sstrm.str()
*
* cpdef _EncodeMapperSymbolTableView input_symbols(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __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, 1471, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_12EncodeMapper_25input_symbols)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __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__EncodeMapperSymbolTableView))))) __PYX_ERR(0, 1469, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView))))) __PYX_ERR(0, 1471, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1475
+ /* "pywrapfst.pyx":1477
* Returns the mapper's input symbol table, or None if none is present.
* """
* if self._mapper.get().InputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1475, __pyx_L1_error)
+ __PYX_ERR(0, 1477, __pyx_L1_error)
}
__pyx_t_5 = ((__pyx_v_self->_mapper.get()->InputSymbols() == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1476
+ /* "pywrapfst.pyx":1478
* """
* if self._mapper.get().InputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1475
+ /* "pywrapfst.pyx":1477
* Returns the mapper's input symbol table, or None if none is present.
* """
* if self._mapper.get().InputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1477
+ /* "pywrapfst.pyx":1479
* if self._mapper.get().InputSymbols() == NULL:
* return
* return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True) # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1477, __pyx_L1_error)
+ __PYX_ERR(0, 1479, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTableView(__pyx_v_self->_mapper, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTableView(__pyx_v_self->_mapper, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1479, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1469
+ /* "pywrapfst.pyx":1471
* return _sstrm.str()
*
* cpdef _EncodeMapperSymbolTableView input_symbols(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 1469, __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, 1471, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1479
+/* "pywrapfst.pyx":1481
* return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
*
* cpdef _EncodeMapperSymbolTableView output_symbols(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1479, __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, 1481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_12EncodeMapper_27output_symbols)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1479, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __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__EncodeMapperSymbolTableView))))) __PYX_ERR(0, 1479, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView))))) __PYX_ERR(0, 1481, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1485
+ /* "pywrapfst.pyx":1487
* Returns the mapper's output symbol table, or None if none is present.
* """
* if self._mapper.get().OutputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1485, __pyx_L1_error)
+ __PYX_ERR(0, 1487, __pyx_L1_error)
}
__pyx_t_5 = ((__pyx_v_self->_mapper.get()->OutputSymbols() == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1486
+ /* "pywrapfst.pyx":1488
* """
* if self._mapper.get().OutputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1485
+ /* "pywrapfst.pyx":1487
* Returns the mapper's output symbol table, or None if none is present.
* """
* if self._mapper.get().OutputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1487
+ /* "pywrapfst.pyx":1489
* if self._mapper.get().OutputSymbols() == NULL:
* return
* return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False) # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1487, __pyx_L1_error)
+ __PYX_ERR(0, 1489, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTableView(__pyx_v_self->_mapper, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1487, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTableView(__pyx_v_self->_mapper, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1489, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1479
+ /* "pywrapfst.pyx":1481
* return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
*
* cpdef _EncodeMapperSymbolTableView output_symbols(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 1479, __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, 1481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1489
+/* "pywrapfst.pyx":1491
* return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
*
* cdef void _set_input_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_set_input_symbols", 0);
- /* "pywrapfst.pyx":1490
+ /* "pywrapfst.pyx":1492
*
* cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
* if symbols is None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":1491
+ /* "pywrapfst.pyx":1493
* cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
* if symbols is None:
* self._mapper.get().SetInputSymbols(NULL) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1491, __pyx_L1_error)
+ __PYX_ERR(0, 1493, __pyx_L1_error)
}
__pyx_v_self->_mapper.get()->SetInputSymbols(NULL);
- /* "pywrapfst.pyx":1492
+ /* "pywrapfst.pyx":1494
* if symbols is None:
* self._mapper.get().SetInputSymbols(NULL)
* return # <<<<<<<<<<<<<<
*/
goto __pyx_L0;
- /* "pywrapfst.pyx":1490
+ /* "pywrapfst.pyx":1492
*
* cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
* if symbols is None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1493
+ /* "pywrapfst.pyx":1495
* self._mapper.get().SetInputSymbols(NULL)
* return
* self._mapper.get().SetInputSymbols(symbols._raw_ptr_or_raise()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1493, __pyx_L1_error)
+ __PYX_ERR(0, 1495, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1493, __pyx_L1_error)
+ __PYX_ERR(0, 1495, __pyx_L1_error)
}
- __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1493, __pyx_L1_error)
+ __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1495, __pyx_L1_error)
__pyx_v_self->_mapper.get()->SetInputSymbols(__pyx_t_3);
- /* "pywrapfst.pyx":1489
+ /* "pywrapfst.pyx":1491
* return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
*
* cdef void _set_input_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1495
+/* "pywrapfst.pyx":1497
* self._mapper.get().SetInputSymbols(symbols._raw_ptr_or_raise())
*
* def set_input_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_input_symbols (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1495, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1497, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_28set_input_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_symbols));
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_input_symbols", 0);
- /* "pywrapfst.pyx":1509
+ /* "pywrapfst.pyx":1511
* self.
* """
* self._set_input_symbols(symbols) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_input_symbols");
- __PYX_ERR(0, 1509, __pyx_L1_error)
+ __PYX_ERR(0, 1511, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1509, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1511, __pyx_L1_error)
- /* "pywrapfst.pyx":1510
+ /* "pywrapfst.pyx":1512
* """
* self._set_input_symbols(symbols)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1495
+ /* "pywrapfst.pyx":1497
* self._mapper.get().SetInputSymbols(symbols._raw_ptr_or_raise())
*
* def set_input_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1512
+/* "pywrapfst.pyx":1514
* return self
*
* cdef void _set_output_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_set_output_symbols", 0);
- /* "pywrapfst.pyx":1513
+ /* "pywrapfst.pyx":1515
*
* cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
* if symbols is None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":1514
+ /* "pywrapfst.pyx":1516
* cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
* if symbols is None:
* self._mapper.get().SetOutputSymbols(NULL) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1514, __pyx_L1_error)
+ __PYX_ERR(0, 1516, __pyx_L1_error)
}
__pyx_v_self->_mapper.get()->SetOutputSymbols(NULL);
- /* "pywrapfst.pyx":1515
+ /* "pywrapfst.pyx":1517
* if symbols is None:
* self._mapper.get().SetOutputSymbols(NULL)
* return # <<<<<<<<<<<<<<
*/
goto __pyx_L0;
- /* "pywrapfst.pyx":1513
+ /* "pywrapfst.pyx":1515
*
* cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
* if symbols is None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1516
+ /* "pywrapfst.pyx":1518
* self._mapper.get().SetOutputSymbols(NULL)
* return
* self._mapper.get().SetOutputSymbols(symbols._raw_ptr_or_raise()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1516, __pyx_L1_error)
+ __PYX_ERR(0, 1518, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1516, __pyx_L1_error)
+ __PYX_ERR(0, 1518, __pyx_L1_error)
}
- __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1516, __pyx_L1_error)
+ __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1518, __pyx_L1_error)
__pyx_v_self->_mapper.get()->SetOutputSymbols(__pyx_t_3);
- /* "pywrapfst.pyx":1512
+ /* "pywrapfst.pyx":1514
* return self
*
* cdef void _set_output_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1518
+/* "pywrapfst.pyx":1520
* self._mapper.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
*
* def set_output_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_output_symbols (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1518, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1520, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_30set_output_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_symbols));
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_output_symbols", 0);
- /* "pywrapfst.pyx":1532
+ /* "pywrapfst.pyx":1534
* self.
* """
* self._set_output_symbols(symbols) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_output_symbols");
- __PYX_ERR(0, 1532, __pyx_L1_error)
+ __PYX_ERR(0, 1534, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1532, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1534, __pyx_L1_error)
- /* "pywrapfst.pyx":1533
+ /* "pywrapfst.pyx":1535
* """
* self._set_output_symbols(symbols)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1518
+ /* "pywrapfst.pyx":1520
* self._mapper.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
*
* def set_output_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1536
+/* "pywrapfst.pyx":1538
*
*
* cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_EncodeMapper", 0);
- /* "pywrapfst.pyx":1537
+ /* "pywrapfst.pyx":1539
*
* cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper):
* cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper) # <<<<<<<<<<<<<<
* result._mapper.reset(mapper)
* return result
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_EncodeMapper(((PyTypeObject *)__pyx_ptype_9pywrapfst_EncodeMapper), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1537, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_EncodeMapper(((PyTypeObject *)__pyx_ptype_9pywrapfst_EncodeMapper), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v_result = ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1538
+ /* "pywrapfst.pyx":1540
* cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper):
* cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)
* result._mapper.reset(mapper) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1538, __pyx_L1_error)
+ __PYX_ERR(0, 1540, __pyx_L1_error)
}
__pyx_v_result->_mapper.reset(__pyx_v_mapper);
- /* "pywrapfst.pyx":1539
+ /* "pywrapfst.pyx":1541
* cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)
* result._mapper.reset(mapper)
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1536
+ /* "pywrapfst.pyx":1538
*
*
* cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1542
+/* "pywrapfst.pyx":1544
*
*
* cpdef EncodeMapper _read_EncodeMapper_from_string(string state): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_read_EncodeMapper_from_string", 0);
- /* "pywrapfst.pyx":1544
+ /* "pywrapfst.pyx":1546
* cpdef EncodeMapper _read_EncodeMapper_from_string(string state):
* cdef stringstream _sstrm
* _sstrm << state # <<<<<<<<<<<<<<
*/
(void)((__pyx_v__sstrm << __pyx_v_state));
- /* "pywrapfst.pyx":1546
+ /* "pywrapfst.pyx":1548
* _sstrm << state
* cdef unique_ptr[fst.EncodeMapperClass] _mapper
* _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>")) # <<<<<<<<<<<<<<
*/
__pyx_v__mapper.reset(fst::script::EncodeMapperClass::Read(__pyx_v__sstrm, __pyx_k_pywrapfst));
- /* "pywrapfst.pyx":1547
+ /* "pywrapfst.pyx":1549
* cdef unique_ptr[fst.EncodeMapperClass] _mapper
* _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>"))
* if _mapper.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v__mapper.get() == NULL) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":1548
+ /* "pywrapfst.pyx":1550
* _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>"))
* if _mapper.get() == NULL:
* raise FstIOError("Read from string failed") # <<<<<<<<<<<<<<
* return _init_EncodeMapper(_mapper.release())
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1550, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Read_from_string_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Read_from_string_failed);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1550, __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, 1548, __pyx_L1_error)
+ __PYX_ERR(0, 1550, __pyx_L1_error)
- /* "pywrapfst.pyx":1547
+ /* "pywrapfst.pyx":1549
* cdef unique_ptr[fst.EncodeMapperClass] _mapper
* _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>"))
* if _mapper.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1549
+ /* "pywrapfst.pyx":1551
* if _mapper.get() == NULL:
* raise FstIOError("Read from string failed")
* return _init_EncodeMapper(_mapper.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapper(__pyx_v__mapper.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1549, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapper(__pyx_v__mapper.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1551, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1542
+ /* "pywrapfst.pyx":1544
*
*
* cpdef EncodeMapper _read_EncodeMapper_from_string(string state): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_read_EncodeMapper_from_string (wrapper)", 0);
assert(__pyx_arg_state); {
- __pyx_v_state = __pyx_convert_string_from_py_std__in_string(__pyx_arg_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1542, __pyx_L3_error)
+ __pyx_v_state = __pyx_convert_string_from_py_std__in_string(__pyx_arg_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1544, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_read_EncodeMapper_from_string", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_EncodeMapper_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1542, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_EncodeMapper_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1544, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1575
+/* "pywrapfst.pyx":1577
*
* @staticmethod
* cdef string _local_render_svg(const string &dot): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_local_render_svg", 0);
- /* "pywrapfst.pyx":1576
+ /* "pywrapfst.pyx":1578
* @staticmethod
* cdef string _local_render_svg(const string &dot):
* proc = subprocess.Popen(("dot", "-Tsvg"), # <<<<<<<<<<<<<<
* stdin=subprocess.PIPE,
* stdout=subprocess.PIPE)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1576, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1578, __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, 1576, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Popen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":1577
+ /* "pywrapfst.pyx":1579
* cdef string _local_render_svg(const string &dot):
* proc = subprocess.Popen(("dot", "-Tsvg"),
* stdin=subprocess.PIPE, # <<<<<<<<<<<<<<
* stdout=subprocess.PIPE)
* return proc.communicate(dot.encode("utf8"))[0]
*/
- __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1577, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1579, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1577, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1579, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1577, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1579, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdin, __pyx_t_4) < 0) __PYX_ERR(0, 1577, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdin, __pyx_t_4) < 0) __PYX_ERR(0, 1579, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "pywrapfst.pyx":1578
+ /* "pywrapfst.pyx":1580
* proc = subprocess.Popen(("dot", "-Tsvg"),
* stdin=subprocess.PIPE,
* stdout=subprocess.PIPE) # <<<<<<<<<<<<<<
* return proc.communicate(dot.encode("utf8"))[0]
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1578, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1580, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1578, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1580, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdout, __pyx_t_3) < 0) __PYX_ERR(0, 1577, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdout, __pyx_t_3) < 0) __PYX_ERR(0, 1579, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "pywrapfst.pyx":1576
+ /* "pywrapfst.pyx":1578
* @staticmethod
* cdef string _local_render_svg(const string &dot):
* proc = subprocess.Popen(("dot", "-Tsvg"), # <<<<<<<<<<<<<<
* stdin=subprocess.PIPE,
* stdout=subprocess.PIPE)
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1576, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_proc = __pyx_t_3;
__pyx_t_3 = 0;
- /* "pywrapfst.pyx":1579
+ /* "pywrapfst.pyx":1581
* stdin=subprocess.PIPE,
* stdout=subprocess.PIPE)
* return proc.communicate(dot.encode("utf8"))[0] # <<<<<<<<<<<<<<
*
* def _repr_svg_(self):
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_communicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1579, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_communicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1581, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_dot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
+ __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_dot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1581, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1579, __pyx_L1_error)
+ __pyx_t_4 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1581, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
__pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1579, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1581, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_t_3 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- __PYX_ERR(0, 1579, __pyx_L1_error)
+ __PYX_ERR(0, 1581, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1579, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1581, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1579, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1581, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
goto __pyx_L0;
- /* "pywrapfst.pyx":1575
+ /* "pywrapfst.pyx":1577
*
* @staticmethod
* cdef string _local_render_svg(const string &dot): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1581
+/* "pywrapfst.pyx":1583
* return proc.communicate(dot.encode("utf8"))[0]
*
* def _repr_svg_(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_repr_svg_", 0);
- /* "pywrapfst.pyx":1589
+ /* "pywrapfst.pyx":1591
* """
* cdef stringstream _sstrm
* cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) == # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1589, __pyx_L1_error)
+ __PYX_ERR(0, 1591, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1590
+ /* "pywrapfst.pyx":1592
* cdef stringstream _sstrm
* cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==
* fst.kAcceptor) # <<<<<<<<<<<<<<
*/
__pyx_v_acceptor = (__pyx_v_self->_fst.get()->Properties(fst::kAcceptor, 1) == fst::kAcceptor);
- /* "pywrapfst.pyx":1591
+ /* "pywrapfst.pyx":1593
* cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==
* fst.kAcceptor)
* fst.Draw(deref(self._fst), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1591, __pyx_L1_error)
+ __PYX_ERR(0, 1593, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1592
+ /* "pywrapfst.pyx":1594
* fst.kAcceptor)
* fst.Draw(deref(self._fst),
* self._fst.get().InputSymbols(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1592, __pyx_L1_error)
+ __PYX_ERR(0, 1594, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1593
+ /* "pywrapfst.pyx":1595
* fst.Draw(deref(self._fst),
* self._fst.get().InputSymbols(),
* self._fst.get().OutputSymbols(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1593, __pyx_L1_error)
+ __PYX_ERR(0, 1595, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1591
+ /* "pywrapfst.pyx":1593
* cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==
* fst.kAcceptor)
* fst.Draw(deref(self._fst), # <<<<<<<<<<<<<<
*/
fst::script::Draw((*__pyx_v_self->_fst), __pyx_v_self->_fst.get()->InputSymbols(), __pyx_v_self->_fst.get()->OutputSymbols(), NULL, __pyx_v_acceptor, __pyx_k__11, 8.5, 11.0, 1, 0, 0.4, 0.25, 14, 5, __pyx_k_g, 0, __pyx_v__sstrm, __pyx_k_pywrapfst);
- /* "pywrapfst.pyx":1609
+ /* "pywrapfst.pyx":1611
* _sstrm,
* b"<pywrapfst>")
* try: # <<<<<<<<<<<<<<
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
- /* "pywrapfst.pyx":1610
+ /* "pywrapfst.pyx":1612
* b"<pywrapfst>")
* try:
* return Fst._local_render_svg(_sstrm.str()) # <<<<<<<<<<<<<<
* logging.error("Dot rendering failed: %s", e)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_3Fst__local_render_svg(__pyx_v__sstrm.str())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1610, __pyx_L3_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_3Fst__local_render_svg(__pyx_v__sstrm.str())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1612, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L7_try_return;
- /* "pywrapfst.pyx":1609
+ /* "pywrapfst.pyx":1611
* _sstrm,
* b"<pywrapfst>")
* try: # <<<<<<<<<<<<<<
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "pywrapfst.pyx":1611
+ /* "pywrapfst.pyx":1613
* try:
* return Fst._local_render_svg(_sstrm.str())
* except Exception as e: # <<<<<<<<<<<<<<
__pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
if (__pyx_t_5) {
__Pyx_AddTraceback("pywrapfst.Fst._repr_svg_", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1611, __pyx_L5_except_error)
+ if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1613, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_e = __pyx_t_6;
/*try:*/ {
- /* "pywrapfst.pyx":1612
+ /* "pywrapfst.pyx":1614
* return Fst._local_render_svg(_sstrm.str())
* except Exception as e:
* logging.error("Dot rendering failed: %s", e) # <<<<<<<<<<<<<<
*
* def __init__(self):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_logging); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1612, __pyx_L14_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_logging); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1614, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1612, __pyx_L14_error)
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1614, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_10)) {
PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_u_Dot_rendering_failed_s, __pyx_v_e};
- __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1612, __pyx_L14_error)
+ __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1614, __pyx_L14_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_u_Dot_rendering_failed_s, __pyx_v_e};
- __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1612, __pyx_L14_error)
+ __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1614, __pyx_L14_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else
#endif
{
- __pyx_t_11 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1612, __pyx_L14_error)
+ __pyx_t_11 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1614, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_11);
if (__pyx_t_9) {
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
__Pyx_INCREF(__pyx_v_e);
__Pyx_GIVEREF(__pyx_v_e);
PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_v_e);
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1612, __pyx_L14_error)
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1614, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- /* "pywrapfst.pyx":1611
+ /* "pywrapfst.pyx":1613
* try:
* return Fst._local_render_svg(_sstrm.str())
* except Exception as e: # <<<<<<<<<<<<<<
__Pyx_XGOTREF(__pyx_t_19);
__pyx_t_5 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
{
- __Pyx_XDECREF(__pyx_v_e);
+ __Pyx_DECREF(__pyx_v_e);
__pyx_v_e = NULL;
}
if (PY_MAJOR_VERSION >= 3) {
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
- /* "pywrapfst.pyx":1609
+ /* "pywrapfst.pyx":1611
* _sstrm,
* b"<pywrapfst>")
* try: # <<<<<<<<<<<<<<
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
}
- /* "pywrapfst.pyx":1581
+ /* "pywrapfst.pyx":1583
* return proc.communicate(dot.encode("utf8"))[0]
*
* def _repr_svg_(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1614
+/* "pywrapfst.pyx":1616
* logging.error("Dot rendering failed: %s", e)
*
* def __init__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":1615
+ /* "pywrapfst.pyx":1617
*
* def __init__(self):
* raise NotImplementedError(f"Cannot construct {self._class__.__name__}") # <<<<<<<<<<<<<<
*
* # Registers the class for pickling; must be repeated in any subclass which
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1615, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_construct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1615, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_construct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1617, __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, 1615, __pyx_L1_error)
+ __PYX_ERR(0, 1617, __pyx_L1_error)
- /* "pywrapfst.pyx":1614
+ /* "pywrapfst.pyx":1616
* logging.error("Dot rendering failed: %s", e)
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1620
+/* "pywrapfst.pyx":1622
* # can't be derived by _init_XFst.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__reduce__", 0);
- /* "pywrapfst.pyx":1621
+ /* "pywrapfst.pyx":1623
*
* def __reduce__(self):
* return (_read_Fst_from_string, (self.write_to_string(),)) # <<<<<<<<<<<<<<
* def __repr__(self):
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_Fst_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1621, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_Fst_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "write_to_string");
- __PYX_ERR(0, 1621, __pyx_L1_error)
+ __PYX_ERR(0, 1623, __pyx_L1_error)
}
- __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1621, __pyx_L1_error)
+ __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1621, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1623, __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_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1621, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1623, __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_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1620
+ /* "pywrapfst.pyx":1622
* # can't be derived by _init_XFst.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1623
+/* "pywrapfst.pyx":1625
* return (_read_Fst_from_string, (self.write_to_string(),))
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1624
+ /* "pywrapfst.pyx":1626
*
* def __repr__(self):
* return f"<{self.fst_type()} Fst at 0x{id(self):x}>" # <<<<<<<<<<<<<<
* def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "fst_type");
- __PYX_ERR(0, 1624, __pyx_L1_error)
+ __PYX_ERR(0, 1626, __pyx_L1_error)
}
- __pyx_t_4 = __pyx_convert_PyUnicode_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_4)) __PYX_ERR(0, 1624, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_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_4)) __PYX_ERR(0, 1626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__pyx_t_2 += 10;
__Pyx_GIVEREF(__pyx_kp_u_Fst_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_Fst_at_0x);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1624, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1624, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1624, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1623
+ /* "pywrapfst.pyx":1625
* return (_read_Fst_from_string, (self.write_to_string(),))
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1626
+/* "pywrapfst.pyx":1628
* return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
*
* def __str__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "pywrapfst.pyx":1627
+ /* "pywrapfst.pyx":1629
*
* def __str__(self):
* return self.print() # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "print");
- __PYX_ERR(0, 1627, __pyx_L1_error)
+ __PYX_ERR(0, 1629, __pyx_L1_error)
}
- __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_self->__pyx_vtab)->print(__pyx_v_self, 0, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1627, __pyx_L1_error)
- __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1627, __pyx_L1_error)
+ __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_self->__pyx_vtab)->print(__pyx_v_self, 0, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1629, __pyx_L1_error)
+ __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1629, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1626
+ /* "pywrapfst.pyx":1628
* return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
*
* def __str__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1629
+/* "pywrapfst.pyx":1631
* return self.print()
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __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, 1631, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_11arc_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1629, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1631, __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, 1629, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1631, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1635
+ /* "pywrapfst.pyx":1637
* 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 '%.30s'", "_fst");
- __PYX_ERR(0, 1635, __pyx_L1_error)
+ __PYX_ERR(0, 1637, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1629
+ /* "pywrapfst.pyx":1631
* return self.print()
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arc_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_3Fst_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_3Fst_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1631, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1637
+/* "pywrapfst.pyx":1639
* return self._fst.get().ArcType()
*
* cpdef ArcIterator arcs(self, int64 state): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1637, __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, 1639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_13arcs)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1637, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1637, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_ArcIterator))))) __PYX_ERR(0, 1637, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_ArcIterator))))) __PYX_ERR(0, 1639, __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;
#endif
}
- /* "pywrapfst.pyx":1649
+ /* "pywrapfst.pyx":1651
* An ArcIterator.
* """
* 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, 1649, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1649, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1651, __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, 1649, __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, 1651, __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":1637
+ /* "pywrapfst.pyx":1639
* 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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1637, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1639, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arcs", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1637, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1651
+/* "pywrapfst.pyx":1653
* return ArcIterator(self, state)
*
* cpdef Fst copy(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1651, __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, 1653, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_15copy)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1651, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1653, __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, 1651, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 1653, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1657
+ /* "pywrapfst.pyx":1659
* 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 '%.30s'", "_fst");
- __PYX_ERR(0, 1657, __pyx_L1_error)
+ __PYX_ERR(0, 1659, __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, 1657, __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, 1659, __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":1651
+ /* "pywrapfst.pyx":1653
* return ArcIterator(self, state)
*
* cpdef Fst copy(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1651, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1653, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1659
+/* "pywrapfst.pyx":1661
* return _init_XFst(new fst.FstClass(deref(self._fst)))
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_3Fst_17draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pywrapfst_3Fst_draw(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_draw *__pyx_optional_args) {
- /* "pywrapfst.pyx":1661
+ /* "pywrapfst.pyx":1663
* cpdef void draw(self,
* source,
* SymbolTableView isymbols=None, # <<<<<<<<<<<<<<
*/
struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1662
+ /* "pywrapfst.pyx":1664
* source,
* SymbolTableView isymbols=None,
* SymbolTableView osymbols=None, # <<<<<<<<<<<<<<
*/
struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1663
+ /* "pywrapfst.pyx":1665
* SymbolTableView isymbols=None,
* SymbolTableView osymbols=None,
* SymbolTableView ssymbols=None, # <<<<<<<<<<<<<<
*/
struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1664
+ /* "pywrapfst.pyx":1666
* SymbolTableView osymbols=None,
* SymbolTableView ssymbols=None,
* bool acceptor=False, # <<<<<<<<<<<<<<
double __pyx_v_width = ((double)8.5);
double __pyx_v_height = ((double)11.0);
- /* "pywrapfst.pyx":1668
+ /* "pywrapfst.pyx":1670
* double width=8.5,
* double height=11,
* bool portrait=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_portrait = ((bool)0);
- /* "pywrapfst.pyx":1669
+ /* "pywrapfst.pyx":1671
* double height=11,
* bool portrait=False,
* bool vertical=False, # <<<<<<<<<<<<<<
int32 __pyx_v_precision = ((int32)5);
PyObject *__pyx_v_float_format = ((PyObject *)__pyx_n_u_g);
- /* "pywrapfst.pyx":1675
+ /* "pywrapfst.pyx":1677
* int32 precision=5,
* float_format="g",
* bool show_weight_one=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1659
+ /* "pywrapfst.pyx":1661
* return _init_XFst(new fst.FstClass(deref(self._fst)))
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_draw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1659, __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, 1661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_17draw)) {
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1659, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1659, __pyx_L1_error)
+ __pyx_t_4 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1659, __pyx_L1_error)
+ __pyx_t_5 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1661, __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, 1659, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_portrait); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1661, __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, 1659, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_vertical); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyFloat_FromDouble(__pyx_v_ranksep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1659, __pyx_L1_error)
+ __pyx_t_8 = PyFloat_FromDouble(__pyx_v_ranksep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = PyFloat_FromDouble(__pyx_v_nodesep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1659, __pyx_L1_error)
+ __pyx_t_9 = PyFloat_FromDouble(__pyx_v_nodesep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1661, __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, 1659, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_fontsize); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1661, __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, 1659, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyInt_From_int32_t(__pyx_v_precision); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1661, __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, 1659, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1661, __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_source, ((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, 1659, __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, 1661, __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_source, ((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, 1659, __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, 1661, __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, 1659, __pyx_L1_error)
+ __pyx_t_16 = PyTuple_New(16+__pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1661, __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, 1659, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
}
#endif
}
- /* "pywrapfst.pyx":1707
+ /* "pywrapfst.pyx":1709
* show_weight_one: Should weights equivalent to semiring One be printed?
* """
* cdef string _source = path_tostring(source) # <<<<<<<<<<<<<<
* cdef unique_ptr[ostream] _fstrm
* _fstrm.reset(new ofstream(_source))
*/
- __pyx_t_17 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1707, __pyx_L1_error)
+ __pyx_t_17 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1709, __pyx_L1_error)
__pyx_v__source = __pyx_t_17;
- /* "pywrapfst.pyx":1709
+ /* "pywrapfst.pyx":1711
* cdef string _source = path_tostring(source)
* cdef unique_ptr[ostream] _fstrm
* _fstrm.reset(new ofstream(_source)) # <<<<<<<<<<<<<<
*/
__pyx_v__fstrm.reset(new std::ofstream(__pyx_v__source));
- /* "pywrapfst.pyx":1710
+ /* "pywrapfst.pyx":1712
* cdef unique_ptr[ostream] _fstrm
* _fstrm.reset(new ofstream(_source))
* cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1710, __pyx_L1_error)
+ __PYX_ERR(0, 1712, __pyx_L1_error)
}
__pyx_v__isymbols = __pyx_v_self->_fst.get()->InputSymbols();
- /* "pywrapfst.pyx":1711
+ /* "pywrapfst.pyx":1713
* _fstrm.reset(new ofstream(_source))
* cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
* if isymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_19 = (__pyx_t_18 != 0);
if (__pyx_t_19) {
- /* "pywrapfst.pyx":1712
+ /* "pywrapfst.pyx":1714
* cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
* if isymbols is not None:
* _isymbols = isymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1712, __pyx_L1_error)
+ __PYX_ERR(0, 1714, __pyx_L1_error)
}
- __pyx_t_20 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1712, __pyx_L1_error)
+ __pyx_t_20 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1714, __pyx_L1_error)
__pyx_v__isymbols = __pyx_t_20;
- /* "pywrapfst.pyx":1711
+ /* "pywrapfst.pyx":1713
* _fstrm.reset(new ofstream(_source))
* cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
* if isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1713
+ /* "pywrapfst.pyx":1715
* if isymbols is not None:
* _isymbols = isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1713, __pyx_L1_error)
+ __PYX_ERR(0, 1715, __pyx_L1_error)
}
__pyx_v__osymbols = __pyx_v_self->_fst.get()->OutputSymbols();
- /* "pywrapfst.pyx":1714
+ /* "pywrapfst.pyx":1716
* _isymbols = isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
* if osymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_18 = (__pyx_t_19 != 0);
if (__pyx_t_18) {
- /* "pywrapfst.pyx":1715
+ /* "pywrapfst.pyx":1717
* cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
* if osymbols is not None:
* _osymbols = osymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1715, __pyx_L1_error)
+ __PYX_ERR(0, 1717, __pyx_L1_error)
}
- __pyx_t_20 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1715, __pyx_L1_error)
+ __pyx_t_20 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1717, __pyx_L1_error)
__pyx_v__osymbols = __pyx_t_20;
- /* "pywrapfst.pyx":1714
+ /* "pywrapfst.pyx":1716
* _isymbols = isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
* if osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1716
+ /* "pywrapfst.pyx":1718
* if osymbols is not None:
* _osymbols = osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_ssymbols = NULL # <<<<<<<<<<<<<<
*/
__pyx_v__ssymbols = NULL;
- /* "pywrapfst.pyx":1717
+ /* "pywrapfst.pyx":1719
* _osymbols = osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_19 = (__pyx_t_18 != 0);
if (__pyx_t_19) {
- /* "pywrapfst.pyx":1718
+ /* "pywrapfst.pyx":1720
* cdef const fst.SymbolTable *_ssymbols = NULL
* if ssymbols is not None:
* _ssymbols = ssymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1718, __pyx_L1_error)
+ __PYX_ERR(0, 1720, __pyx_L1_error)
}
- __pyx_t_20 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_ssymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_ssymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1718, __pyx_L1_error)
+ __pyx_t_20 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_ssymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_ssymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1720, __pyx_L1_error)
__pyx_v__ssymbols = __pyx_t_20;
- /* "pywrapfst.pyx":1717
+ /* "pywrapfst.pyx":1719
* _osymbols = osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1719
+ /* "pywrapfst.pyx":1721
* if ssymbols is not None:
* _ssymbols = ssymbols._raw_ptr_or_raise()
* fst.Draw(deref(self._fst), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1719, __pyx_L1_error)
+ __PYX_ERR(0, 1721, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1724
+ /* "pywrapfst.pyx":1726
* _ssymbols,
* acceptor,
* tostring(title), # <<<<<<<<<<<<<<
* width,
* height,
*/
- __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_title); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1724, __pyx_L1_error)
+ __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_title); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1726, __pyx_L1_error)
- /* "pywrapfst.pyx":1733
+ /* "pywrapfst.pyx":1735
* fontsize,
* precision,
* tostring(float_format), # <<<<<<<<<<<<<<
* show_weight_one,
* deref(_fstrm),
*/
- __pyx_t_21 = __pyx_f_9pywrapfst_tostring(__pyx_v_float_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1733, __pyx_L1_error)
+ __pyx_t_21 = __pyx_f_9pywrapfst_tostring(__pyx_v_float_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1735, __pyx_L1_error)
- /* "pywrapfst.pyx":1719
+ /* "pywrapfst.pyx":1721
* if ssymbols is not None:
* _ssymbols = ssymbols._raw_ptr_or_raise()
* fst.Draw(deref(self._fst), # <<<<<<<<<<<<<<
*/
fst::script::Draw((*__pyx_v_self->_fst), __pyx_v__isymbols, __pyx_v__osymbols, __pyx_v__ssymbols, __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_21, __pyx_v_show_weight_one, (*__pyx_v__fstrm), __pyx_v__source);
- /* "pywrapfst.pyx":1659
+ /* "pywrapfst.pyx":1661
* return _init_XFst(new fst.FstClass(deref(self._fst)))
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__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":1661
+ /* "pywrapfst.pyx":1663
* cpdef void draw(self,
* source,
* SymbolTableView isymbols=None, # <<<<<<<<<<<<<<
*/
values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1662
+ /* "pywrapfst.pyx":1664
* source,
* SymbolTableView isymbols=None,
* SymbolTableView osymbols=None, # <<<<<<<<<<<<<<
*/
values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1663
+ /* "pywrapfst.pyx":1665
* SymbolTableView isymbols=None,
* SymbolTableView osymbols=None,
* SymbolTableView ssymbols=None, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 1659, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 1661, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[2]);
__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)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, 1664, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1666, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1664
+ /* "pywrapfst.pyx":1666
* SymbolTableView osymbols=None,
* SymbolTableView 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, 1666, __pyx_L3_error)
+ __pyx_v_width = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_width == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1668, __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, 1667, __pyx_L3_error)
+ __pyx_v_height = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_height == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1669, __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, 1668, __pyx_L3_error)
+ __pyx_v_portrait = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_portrait == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1670, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1668
+ /* "pywrapfst.pyx":1670
* 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, 1669, __pyx_L3_error)
+ __pyx_v_vertical = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_vertical == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1671, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1669
+ /* "pywrapfst.pyx":1671
* 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, 1670, __pyx_L3_error)
+ __pyx_v_ranksep = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_ranksep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1672, __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, 1671, __pyx_L3_error)
+ __pyx_v_nodesep = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_nodesep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1673, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1672, __pyx_L3_error)
+ __pyx_v_fontsize = __Pyx_PyInt_As_int32_t(values[12]); if (unlikely((__pyx_v_fontsize == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1674, __pyx_L3_error)
} else {
__pyx_v_fontsize = ((int32)14);
}
if (values[13]) {
- __pyx_v_precision = __Pyx_PyInt_As_int32_t(values[13]); if (unlikely((__pyx_v_precision == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1673, __pyx_L3_error)
+ __pyx_v_precision = __Pyx_PyInt_As_int32_t(values[13]); if (unlikely((__pyx_v_precision == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1675, __pyx_L3_error)
} else {
__pyx_v_precision = ((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, 1675, __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, 1677, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1675
+ /* "pywrapfst.pyx":1677
* int32 precision=5,
* float_format="g",
* bool show_weight_one=False) except *: # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1659, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1661, __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_SymbolTableView, 1, "isymbols", 0))) __PYX_ERR(0, 1661, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "osymbols", 0))) __PYX_ERR(0, 1662, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "ssymbols", 0))) __PYX_ERR(0, 1663, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "isymbols", 0))) __PYX_ERR(0, 1663, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "osymbols", 0))) __PYX_ERR(0, 1664, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "ssymbols", 0))) __PYX_ERR(0, 1665, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_3Fst_16draw(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), __pyx_v_source, __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":1659
+ /* "pywrapfst.pyx":1661
* return _init_XFst(new fst.FstClass(deref(self._fst)))
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
__pyx_t_1.precision = __pyx_v_precision;
__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_source, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1659, __pyx_L1_error)
- __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1659, __pyx_L1_error)
+ __pyx_vtabptr_9pywrapfst_Fst->draw(__pyx_v_self, __pyx_v_source, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1661, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1738
+/* "pywrapfst.pyx":1740
* _source)
*
* cpdef Weight final(self, int64 state): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_final); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1738, __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, 1740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_19final)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1738, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1738, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 1738, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 1740, __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;
#endif
}
- /* "pywrapfst.pyx":1753
+ /* "pywrapfst.pyx":1755
* FstIndexError: State index out of range.
* """
* cdef Weight _weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
* if not _weight.member():
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1753, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1755, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1754
+ /* "pywrapfst.pyx":1756
* """
* 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 '%.30s'", "_weight");
- __PYX_ERR(0, 1754, __pyx_L1_error)
+ __PYX_ERR(0, 1756, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1754, __pyx_L1_error)
+ __PYX_ERR(0, 1756, __pyx_L1_error)
}
__pyx_v__weight->_weight.reset(new fst::script::WeightClass(__pyx_v_self->_fst.get()->Final(__pyx_v_state)));
- /* "pywrapfst.pyx":1755
+ /* "pywrapfst.pyx":1757
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
* if not _weight.member(): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "member");
- __PYX_ERR(0, 1755, __pyx_L1_error)
+ __PYX_ERR(0, 1757, __pyx_L1_error)
}
__pyx_t_6 = ((!(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->member(__pyx_v__weight, 0) != 0)) != 0);
if (unlikely(__pyx_t_6)) {
- /* "pywrapfst.pyx":1756
+ /* "pywrapfst.pyx":1758
* _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
* if not _weight.member():
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return _weight
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1756, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1758, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1756, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1758, __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, 1756, __pyx_L1_error)
+ __PYX_ERR(0, 1758, __pyx_L1_error)
- /* "pywrapfst.pyx":1755
+ /* "pywrapfst.pyx":1757
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
* if not _weight.member(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1757
+ /* "pywrapfst.pyx":1759
* if not _weight.member():
* raise FstIndexError("State index out of range")
* return _weight # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":1738
+ /* "pywrapfst.pyx":1740
* _source)
*
* 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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1738, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1740, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("final", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_final(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1738, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_final(__pyx_v_self, __pyx_v_state, 1)); 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":1759
+/* "pywrapfst.pyx":1761
* return _weight
*
* cpdef string fst_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __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, 1761, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_21fst_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __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, 1759, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1761, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1765
+ /* "pywrapfst.pyx":1767
* 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 '%.30s'", "_fst");
- __PYX_ERR(0, 1765, __pyx_L1_error)
+ __PYX_ERR(0, 1767, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->FstType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1759
+ /* "pywrapfst.pyx":1761
* return _weight
*
* cpdef string fst_type(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fst_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_3Fst_fst_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_3Fst_fst_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1761, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1767
+/* "pywrapfst.pyx":1769
* return self._fst.get().FstType()
*
* cpdef _FstSymbolTableView input_symbols(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1767, __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, 1769, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_23input_symbols)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1767, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1769, __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__FstSymbolTableView))))) __PYX_ERR(0, 1767, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__FstSymbolTableView))))) __PYX_ERR(0, 1769, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1773
+ /* "pywrapfst.pyx":1775
* Returns the FST's input symbol table, or None if none is present.
* """
* if self._fst.get().InputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1773, __pyx_L1_error)
+ __PYX_ERR(0, 1775, __pyx_L1_error)
}
__pyx_t_5 = ((__pyx_v_self->_fst.get()->InputSymbols() == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1774
+ /* "pywrapfst.pyx":1776
* """
* if self._fst.get().InputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1773
+ /* "pywrapfst.pyx":1775
* Returns the FST's input symbol table, or None if none is present.
* """
* if self._fst.get().InputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1775
+ /* "pywrapfst.pyx":1777
* if self._fst.get().InputSymbols() == NULL:
* return
* return _init_FstSymbolTableView(self._fst, input_side=True) # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1775, __pyx_L1_error)
+ __PYX_ERR(0, 1777, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTableView(__pyx_v_self->_fst, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1775, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTableView(__pyx_v_self->_fst, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1777, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1767
+ /* "pywrapfst.pyx":1769
* return self._fst.get().FstType()
*
* cpdef _FstSymbolTableView input_symbols(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("input_symbols", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1767, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1769, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1777
+/* "pywrapfst.pyx":1779
* return _init_FstSymbolTableView(self._fst, input_side=True)
*
* cpdef size_t num_arcs(self, int64 state) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1777, __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, 1779, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_25num_arcs)) {
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1777, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1777, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1779, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1777, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1779, __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;
#endif
}
- /* "pywrapfst.pyx":1792
+ /* "pywrapfst.pyx":1794
* FstIndexError: State index out of range.
* """
* 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 '%.30s'", "_fst");
- __PYX_ERR(0, 1792, __pyx_L1_error)
+ __PYX_ERR(0, 1794, __pyx_L1_error)
}
__pyx_v__result = __pyx_v_self->_fst.get()->NumArcs(__pyx_v_state);
- /* "pywrapfst.pyx":1793
+ /* "pywrapfst.pyx":1795
* """
* cdef size_t _result = self._fst.get().NumArcs(state)
* if _result == SIZE_MAX: # <<<<<<<<<<<<<<
__pyx_t_7 = ((__pyx_v__result == SIZE_MAX) != 0);
if (unlikely(__pyx_t_7)) {
- /* "pywrapfst.pyx":1794
+ /* "pywrapfst.pyx":1796
* cdef size_t _result = self._fst.get().NumArcs(state)
* if _result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return _result
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1794, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1796, __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, 1794, __pyx_L1_error)
+ __PYX_ERR(0, 1796, __pyx_L1_error)
- /* "pywrapfst.pyx":1793
+ /* "pywrapfst.pyx":1795
* """
* cdef size_t _result = self._fst.get().NumArcs(state)
* if _result == SIZE_MAX: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1795
+ /* "pywrapfst.pyx":1797
* if _result == SIZE_MAX:
* raise FstIndexError("State index out of range")
* return _result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1777
+ /* "pywrapfst.pyx":1779
* return _init_FstSymbolTableView(self._fst, input_side=True)
*
* 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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1777, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1779, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("num_arcs", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_num_arcs(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1777, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1777, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_num_arcs(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1779, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1779, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1797
+/* "pywrapfst.pyx":1799
* return _result
*
* cpdef size_t num_input_epsilons(self, int64 state) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_input_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1797, __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, 1799, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_27num_input_epsilons)) {
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1797, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1799, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1797, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1799, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1797, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1799, __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;
#endif
}
- /* "pywrapfst.pyx":1812
+ /* "pywrapfst.pyx":1814
* FstIndexError: State index out of range.
* """
* 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 '%.30s'", "_fst");
- __PYX_ERR(0, 1812, __pyx_L1_error)
+ __PYX_ERR(0, 1814, __pyx_L1_error)
}
__pyx_v__result = __pyx_v_self->_fst.get()->NumInputEpsilons(__pyx_v_state);
- /* "pywrapfst.pyx":1813
+ /* "pywrapfst.pyx":1815
* """
* cdef size_t _result = self._fst.get().NumInputEpsilons(state)
* if _result == SIZE_MAX: # <<<<<<<<<<<<<<
__pyx_t_7 = ((__pyx_v__result == SIZE_MAX) != 0);
if (unlikely(__pyx_t_7)) {
- /* "pywrapfst.pyx":1814
+ /* "pywrapfst.pyx":1816
* cdef size_t _result = self._fst.get().NumInputEpsilons(state)
* if _result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return _result
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1814, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1816, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1814, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1816, __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, 1814, __pyx_L1_error)
+ __PYX_ERR(0, 1816, __pyx_L1_error)
- /* "pywrapfst.pyx":1813
+ /* "pywrapfst.pyx":1815
* """
* cdef size_t _result = self._fst.get().NumInputEpsilons(state)
* if _result == SIZE_MAX: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1815
+ /* "pywrapfst.pyx":1817
* if _result == SIZE_MAX:
* raise FstIndexError("State index out of range")
* return _result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1797
+ /* "pywrapfst.pyx":1799
* 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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1797, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1799, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("num_input_epsilons", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_num_input_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1797, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1797, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_num_input_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1799, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1799, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1817
+/* "pywrapfst.pyx":1819
* return _result
*
* cpdef size_t num_output_epsilons(self, int64 state) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_output_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1817, __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, 1819, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_29num_output_epsilons)) {
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1817, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1819, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1817, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1819, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1817, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1819, __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;
#endif
}
- /* "pywrapfst.pyx":1832
+ /* "pywrapfst.pyx":1834
* FstIndexError: State index out of range.
* """
* 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 '%.30s'", "_fst");
- __PYX_ERR(0, 1832, __pyx_L1_error)
+ __PYX_ERR(0, 1834, __pyx_L1_error)
}
__pyx_v__result = __pyx_v_self->_fst.get()->NumOutputEpsilons(__pyx_v_state);
- /* "pywrapfst.pyx":1833
+ /* "pywrapfst.pyx":1835
* """
* cdef size_t _result = self._fst.get().NumOutputEpsilons(state)
* if _result == SIZE_MAX: # <<<<<<<<<<<<<<
__pyx_t_7 = ((__pyx_v__result == SIZE_MAX) != 0);
if (unlikely(__pyx_t_7)) {
- /* "pywrapfst.pyx":1834
+ /* "pywrapfst.pyx":1836
* cdef size_t _result = self._fst.get().NumOutputEpsilons(state)
* if _result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* return _result
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1834, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1836, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1834, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1836, __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, 1834, __pyx_L1_error)
+ __PYX_ERR(0, 1836, __pyx_L1_error)
- /* "pywrapfst.pyx":1833
+ /* "pywrapfst.pyx":1835
* """
* cdef size_t _result = self._fst.get().NumOutputEpsilons(state)
* if _result == SIZE_MAX: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1835
+ /* "pywrapfst.pyx":1837
* if _result == SIZE_MAX:
* raise FstIndexError("State index out of range")
* return _result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1817
+ /* "pywrapfst.pyx":1819
* 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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1817, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1819, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("num_output_epsilons", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_num_output_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1817, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1817, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_num_output_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1819, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1819, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1837
+/* "pywrapfst.pyx":1839
* return _result
*
* cpdef _FstSymbolTableView output_symbols(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1837, __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, 1839, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_31output_symbols)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1837, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1839, __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__FstSymbolTableView))))) __PYX_ERR(0, 1837, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__FstSymbolTableView))))) __PYX_ERR(0, 1839, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1843
+ /* "pywrapfst.pyx":1845
* Returns the FST's output symbol table, or None if none is present.
* """
* if self._fst.get().OutputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1843, __pyx_L1_error)
+ __PYX_ERR(0, 1845, __pyx_L1_error)
}
__pyx_t_5 = ((__pyx_v_self->_fst.get()->OutputSymbols() == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1844
+ /* "pywrapfst.pyx":1846
* """
* if self._fst.get().OutputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1843
+ /* "pywrapfst.pyx":1845
* Returns the FST's output symbol table, or None if none is present.
* """
* if self._fst.get().OutputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1845
+ /* "pywrapfst.pyx":1847
* if self._fst.get().OutputSymbols() == NULL:
* return
* return _init_FstSymbolTableView(self._fst, input_side=False) # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1845, __pyx_L1_error)
+ __PYX_ERR(0, 1847, __pyx_L1_error)
}
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTableView(__pyx_v_self->_fst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1845, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTableView(__pyx_v_self->_fst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1847, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1837
+ /* "pywrapfst.pyx":1839
* return _result
*
* cpdef _FstSymbolTableView output_symbols(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("output_symbols", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1837, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1839, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1847
+/* "pywrapfst.pyx":1849
* return _init_FstSymbolTableView(self._fst, input_side=False)
*
* cpdef string print(self, SymbolTableView isymbols=None, # <<<<<<<<<<<<<<
static std::string __pyx_f_9pywrapfst_3Fst_print(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_print *__pyx_optional_args) {
struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1848
+ /* "pywrapfst.pyx":1850
*
* cpdef string print(self, SymbolTableView isymbols=None,
* SymbolTableView osymbols=None, SymbolTableView ssymbols=None, # <<<<<<<<<<<<<<
struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1849
+ /* "pywrapfst.pyx":1851
* cpdef string print(self, SymbolTableView isymbols=None,
* SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
* bool acceptor=False, bool show_weight_one=False, # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":1847
+ /* "pywrapfst.pyx":1849
* return _init_FstSymbolTableView(self._fst, input_side=False)
*
* cpdef string print(self, SymbolTableView isymbols=None, # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_print); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1847, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_print); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1849, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_33print)) {
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1847, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1849, __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, 1847, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1849, __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, 1847, __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, 1849, __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, 1847, __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, 1849, __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, 1847, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(6+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1849, __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, 1847, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1849, __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, 1847, __pyx_L1_error)
+ __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1849, __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;
#endif
}
- /* "pywrapfst.pyx":1873
+ /* "pywrapfst.pyx":1875
* """
* # Prints FST to stringstream, then returns resulting string.
* cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1873, __pyx_L1_error)
+ __PYX_ERR(0, 1875, __pyx_L1_error)
}
__pyx_v__isymbols = __pyx_v_self->_fst.get()->InputSymbols();
- /* "pywrapfst.pyx":1874
+ /* "pywrapfst.pyx":1876
* # Prints FST to stringstream, then returns resulting string.
* cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
* if isymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_11 = (__pyx_t_10 != 0);
if (__pyx_t_11) {
- /* "pywrapfst.pyx":1875
+ /* "pywrapfst.pyx":1877
* cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
* if isymbols is not None:
* _isymbols = isymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1875, __pyx_L1_error)
+ __PYX_ERR(0, 1877, __pyx_L1_error)
}
- __pyx_t_12 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1875, __pyx_L1_error)
+ __pyx_t_12 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1877, __pyx_L1_error)
__pyx_v__isymbols = __pyx_t_12;
- /* "pywrapfst.pyx":1874
+ /* "pywrapfst.pyx":1876
* # Prints FST to stringstream, then returns resulting string.
* cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
* if isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1876
+ /* "pywrapfst.pyx":1878
* if isymbols is not None:
* _isymbols = isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1876, __pyx_L1_error)
+ __PYX_ERR(0, 1878, __pyx_L1_error)
}
__pyx_v__osymbols = __pyx_v_self->_fst.get()->OutputSymbols();
- /* "pywrapfst.pyx":1877
+ /* "pywrapfst.pyx":1879
* _isymbols = isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
* if osymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_10 = (__pyx_t_11 != 0);
if (__pyx_t_10) {
- /* "pywrapfst.pyx":1878
+ /* "pywrapfst.pyx":1880
* cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
* if osymbols is not None:
* _osymbols = osymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1878, __pyx_L1_error)
+ __PYX_ERR(0, 1880, __pyx_L1_error)
}
- __pyx_t_12 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1878, __pyx_L1_error)
+ __pyx_t_12 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1880, __pyx_L1_error)
__pyx_v__osymbols = __pyx_t_12;
- /* "pywrapfst.pyx":1877
+ /* "pywrapfst.pyx":1879
* _isymbols = isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
* if osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1879
+ /* "pywrapfst.pyx":1881
* if osymbols is not None:
* _osymbols = osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_ssymbols = NULL # <<<<<<<<<<<<<<
*/
__pyx_v__ssymbols = NULL;
- /* "pywrapfst.pyx":1880
+ /* "pywrapfst.pyx":1882
* _osymbols = osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_11 = (__pyx_t_10 != 0);
if (__pyx_t_11) {
- /* "pywrapfst.pyx":1881
+ /* "pywrapfst.pyx":1883
* cdef const fst.SymbolTable *_ssymbols = NULL
* if ssymbols is not None:
* _ssymbols = ssymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 1881, __pyx_L1_error)
+ __PYX_ERR(0, 1883, __pyx_L1_error)
}
- __pyx_t_12 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_ssymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_ssymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1881, __pyx_L1_error)
+ __pyx_t_12 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_ssymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_ssymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1883, __pyx_L1_error)
__pyx_v__ssymbols = __pyx_t_12;
- /* "pywrapfst.pyx":1880
+ /* "pywrapfst.pyx":1882
* _osymbols = osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1883
+ /* "pywrapfst.pyx":1885
* _ssymbols = ssymbols._raw_ptr_or_raise()
* cdef stringstream _sstrm
* fst.Print(deref(self._fst), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1883, __pyx_L1_error)
+ __PYX_ERR(0, 1885, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1891
+ /* "pywrapfst.pyx":1893
* acceptor,
* show_weight_one,
* tostring(missing_sym)) # <<<<<<<<<<<<<<
* return _sstrm.str()
*
*/
- __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_missing_sym); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1891, __pyx_L1_error)
+ __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_missing_sym); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1893, __pyx_L1_error)
- /* "pywrapfst.pyx":1883
+ /* "pywrapfst.pyx":1885
* _ssymbols = ssymbols._raw_ptr_or_raise()
* cdef stringstream _sstrm
* fst.Print(deref(self._fst), # <<<<<<<<<<<<<<
*/
fst::script::Print((*__pyx_v_self->_fst), __pyx_v__sstrm, __pyx_k_pywrapfst, __pyx_v__isymbols, __pyx_v__osymbols, __pyx_v__ssymbols, __pyx_v_acceptor, __pyx_v_show_weight_one, __pyx_t_9);
- /* "pywrapfst.pyx":1892
+ /* "pywrapfst.pyx":1894
* show_weight_one,
* tostring(missing_sym))
* return _sstrm.str() # <<<<<<<<<<<<<<
*
- * cpdef uint64 properties(self, uint64 mask, bool test):
+ * def properties(self, mask, bool test):
*/
__pyx_r = __pyx_v__sstrm.str();
goto __pyx_L0;
- /* "pywrapfst.pyx":1847
+ /* "pywrapfst.pyx":1849
* return _init_FstSymbolTableView(self._fst, input_side=False)
*
* cpdef string print(self, SymbolTableView isymbols=None, # <<<<<<<<<<<<<<
PyObject* values[6] = {0,0,0,0,0,0};
values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1848
+ /* "pywrapfst.pyx":1850
*
* cpdef string print(self, SymbolTableView isymbols=None,
* SymbolTableView osymbols=None, SymbolTableView ssymbols=None, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "print") < 0)) __PYX_ERR(0, 1847, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "print") < 0)) __PYX_ERR(0, 1849, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[1]);
__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)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, 1849, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1851, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1849
+ /* "pywrapfst.pyx":1851
* cpdef string print(self, SymbolTableView isymbols=None,
* SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
* bool acceptor=False, bool show_weight_one=False, # <<<<<<<<<<<<<<
__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, 1849, __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, 1851, __pyx_L3_error)
} else {
__pyx_v_show_weight_one = ((bool)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("print", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1847, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("print", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1849, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Fst.print", __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_SymbolTableView, 1, "isymbols", 0))) __PYX_ERR(0, 1847, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "osymbols", 0))) __PYX_ERR(0, 1848, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "ssymbols", 0))) __PYX_ERR(0, 1848, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "isymbols", 0))) __PYX_ERR(0, 1849, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "osymbols", 0))) __PYX_ERR(0, 1850, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "ssymbols", 0))) __PYX_ERR(0, 1850, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_3Fst_32print(((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":1847
+ /* "pywrapfst.pyx":1849
* return _init_FstSymbolTableView(self._fst, input_side=False)
*
* cpdef string print(self, SymbolTableView isymbols=None, # <<<<<<<<<<<<<<
__pyx_t_2.acceptor = __pyx_v_acceptor;
__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->print(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1847, __pyx_L1_error)
- __pyx_t_3 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1847, __pyx_L1_error)
+ __pyx_t_1 = __pyx_vtabptr_9pywrapfst_Fst->print(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1849, __pyx_L1_error)
+ __pyx_t_3 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1849, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1894
+/* "pywrapfst.pyx":1896
* return _sstrm.str()
*
- * cpdef uint64 properties(self, uint64 mask, bool test): # <<<<<<<<<<<<<<
+ * def properties(self, mask, bool test): # <<<<<<<<<<<<<<
* """
* properties(self, mask, test)
*/
-static PyObject *__pyx_pw_9pywrapfst_3Fst_35properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static uint64 __pyx_f_9pywrapfst_3Fst_properties(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, uint64 __pyx_v_mask, bool __pyx_v_test, int __pyx_skip_dispatch) {
- uint64 __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- uint64 __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("properties", 0);
- /* Check if called by wrapper */
- if (unlikely(__pyx_skip_dispatch)) ;
- /* Check if overridden in Python */
- else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
- #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
- static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
- if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
- PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
- #endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1894, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_35properties)) {
- __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1894, __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, 1894, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_1);
- __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
- __pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_7 = 1;
- }
- }
- #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, 1894, __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;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #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, 1894, __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;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1894, __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;
- }
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_4);
- 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, 1894, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1894, __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;
- goto __pyx_L0;
- }
- #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
- __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
- __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
- if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
- __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
- }
- #endif
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
- }
- #endif
- }
-
- /* "pywrapfst.pyx":1912
- * A 64-bit bitmask representing the requested properties.
- * """
- * return self._fst.get().Properties(mask, test) # <<<<<<<<<<<<<<
- *
- * @classmethod
- */
- if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1912, __pyx_L1_error)
- }
- __pyx_r = __pyx_v_self->_fst.get()->Properties(__pyx_v_mask, __pyx_v_test);
- goto __pyx_L0;
-
- /* "pywrapfst.pyx":1894
- * return _sstrm.str()
- *
- * cpdef uint64 properties(self, uint64 mask, bool test): # <<<<<<<<<<<<<<
- * """
- * properties(self, mask, test)
- */
-
- /* 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_XDECREF(__pyx_t_8);
- __Pyx_WriteUnraisable("pywrapfst.Fst.properties", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_35properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_3Fst_34properties[] = "\n properties(self, mask, test)\n\n Provides property bits.\n\n This method provides user access to the properties attributes for the FST.\n The resulting value is a long integer, but when it is cast to a boolean,\n it represents whether or not the FST has the `mask` property.\n\n Args:\n mask: The property mask to be compared to the FST's properties.\n test: Should any unknown values be computed before comparing against\n the mask?\n\n Returns:\n A 64-bit bitmask representing the requested properties.\n ";
+static char __pyx_doc_9pywrapfst_3Fst_34properties[] = "\n properties(self, mask, test)\n\n Provides property bits.\n\n This method provides user access to the properties attributes for the FST.\n The resulting value is a long integer, but when it is cast to a boolean,\n it represents whether or not the FST has the `mask` property.\n\n Args:\n mask: The property mask to be compared to the FST's properties.\n test: Should any unknown values be computed before comparing against\n the mask?\n\n Returns:\n A FstProperties representing a 64-bit bitmask of the requested properties.\n ";
static PyObject *__pyx_pw_9pywrapfst_3Fst_35properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- uint64 __pyx_v_mask;
+ PyObject *__pyx_v_mask = 0;
bool __pyx_v_test;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_test)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, 1); __PYX_ERR(0, 1894, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, 1); __PYX_ERR(0, 1896, __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, 1894, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "properties") < 0)) __PYX_ERR(0, 1896, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L3_error)
- __pyx_v_test = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_test == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L3_error)
+ __pyx_v_mask = values[0];
+ __pyx_v_test = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_test == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1896, __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, 1894, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1896, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Fst.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_3Fst_34properties(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, uint64 __pyx_v_mask, bool __pyx_v_test) {
+static PyObject *__pyx_pf_9pywrapfst_3Fst_34properties(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_mask, bool __pyx_v_test) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ uint64 __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("properties", 0);
+
+ /* "pywrapfst.pyx":1914
+ * A FstProperties representing a 64-bit bitmask of the requested properties.
+ * """
+ * return FstProperties(self._fst.get().Properties(mask.value, test)) # <<<<<<<<<<<<<<
+ *
+ * @classmethod
+ */
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_f_9pywrapfst_3Fst_properties(__pyx_v_self, __pyx_v_mask, __pyx_v_test, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1894, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1914, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
+ __PYX_ERR(0, 1914, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1914, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyInt_As_uint64_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1914, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_fst.get()->Properties(__pyx_t_4, __pyx_v_test)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1914, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
+ /* "pywrapfst.pyx":1896
+ * return _sstrm.str()
+ *
+ * def properties(self, mask, bool test): # <<<<<<<<<<<<<<
+ * """
+ * properties(self, mask, test)
+ */
+
/* 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_5);
__Pyx_AddTraceback("pywrapfst.Fst.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1915
+/* "pywrapfst.pyx":1917
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read", 0);
- /* "pywrapfst.pyx":1930
+ /* "pywrapfst.pyx":1932
* FstIOError: Read failed.
* """
* return _read_Fst(source) # <<<<<<<<<<<<<<
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst(__pyx_v_source, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1930, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst(__pyx_v_source, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1932, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1915
+ /* "pywrapfst.pyx":1917
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1933
+/* "pywrapfst.pyx":1935
*
* @classmethod
* def read_from_string(cls, state): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_from_string", 0);
- /* "pywrapfst.pyx":1948
+ /* "pywrapfst.pyx":1950
* FstIOError: Read failed.
* """
* return _read_Fst_from_string(state) # <<<<<<<<<<<<<<
* cpdef int64 start(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1948, __pyx_L1_error)
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst_from_string(__pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1948, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1950, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst_from_string(__pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1950, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1933
+ /* "pywrapfst.pyx":1935
*
* @classmethod
* def read_from_string(cls, state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1950
+/* "pywrapfst.pyx":1952
* return _read_Fst_from_string(state)
*
* cpdef int64 start(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1950, __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, 1952, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_41start)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1950, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1952, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1950, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1956
+ /* "pywrapfst.pyx":1958
* 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 '%.30s'", "_fst");
- __PYX_ERR(0, 1956, __pyx_L1_error)
+ __PYX_ERR(0, 1958, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->Start();
goto __pyx_L0;
- /* "pywrapfst.pyx":1950
+ /* "pywrapfst.pyx":1952
* return _read_Fst_from_string(state)
*
* cpdef int64 start(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("start", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_3Fst_start(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1950, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_3Fst_start(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1952, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1958
+/* "pywrapfst.pyx":1960
* return self._fst.get().Start()
*
* cpdef StateIterator states(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1958, __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, 1960, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_43states)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1958, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1960, __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, 1958, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_StateIterator))))) __PYX_ERR(0, 1960, __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;
#endif
}
- /* "pywrapfst.pyx":1967
+ /* "pywrapfst.pyx":1969
* A StateIterator object for the FST.
* """
* return StateIterator(self) # <<<<<<<<<<<<<<
* cpdef bool verify(self):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_9pywrapfst_StateIterator), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1967, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_9pywrapfst_StateIterator), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1958
+ /* "pywrapfst.pyx":1960
* return self._fst.get().Start()
*
* cpdef StateIterator states(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("states", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1958, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1960, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1969
+/* "pywrapfst.pyx":1971
* return StateIterator(self)
*
* cpdef bool verify(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_verify); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1969, __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, 1971, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_45verify)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1969, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1971, __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, 1969, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1971, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1978
+ /* "pywrapfst.pyx":1980
* 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 '%.30s'", "_fst");
- __PYX_ERR(0, 1978, __pyx_L1_error)
+ __PYX_ERR(0, 1980, __pyx_L1_error)
}
__pyx_r = fst::script::Verify((*__pyx_v_self->_fst));
goto __pyx_L0;
- /* "pywrapfst.pyx":1969
+ /* "pywrapfst.pyx":1971
* return StateIterator(self)
*
* cpdef bool verify(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("verify", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_3Fst_verify(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1969, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_3Fst_verify(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1971, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1980
+/* "pywrapfst.pyx":1982
* return fst.Verify(deref(self._fst))
*
* cpdef string weight_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1980, __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, 1982, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_47weight_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1980, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1982, __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, 1980, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1982, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":1989
+ /* "pywrapfst.pyx":1991
* 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 '%.30s'", "_fst");
- __PYX_ERR(0, 1989, __pyx_L1_error)
+ __PYX_ERR(0, 1991, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->WeightType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1980
+ /* "pywrapfst.pyx":1982
* return fst.Verify(deref(self._fst))
*
* cpdef string weight_type(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("weight_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_3Fst_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1980, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_3Fst_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1982, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1991
+/* "pywrapfst.pyx":1993
* return self._fst.get().WeightType()
*
* cpdef void write(self, source) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1991, __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, 1993, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_49write)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_source);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1993, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":2005
+ /* "pywrapfst.pyx":2007
* FstIOError: Write failed.
* """
* if not self._fst.get().Write(path_tostring(source)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2005, __pyx_L1_error)
+ __PYX_ERR(0, 2007, __pyx_L1_error)
}
- __pyx_t_5 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2005, __pyx_L1_error)
+ __pyx_t_5 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2007, __pyx_L1_error)
__pyx_t_6 = ((!(__pyx_v_self->_fst.get()->Write(__pyx_t_5) != 0)) != 0);
if (unlikely(__pyx_t_6)) {
- /* "pywrapfst.pyx":2006
+ /* "pywrapfst.pyx":2008
* """
* if not self._fst.get().Write(path_tostring(source)):
* raise FstIOError(f"Write failed: {source!r}") # <<<<<<<<<<<<<<
*
* cpdef bytes write_to_string(self):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2006, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2008, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2006, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2008, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2006, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2008, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2006, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2008, __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, 2006, __pyx_L1_error)
+ __PYX_ERR(0, 2008, __pyx_L1_error)
- /* "pywrapfst.pyx":2005
+ /* "pywrapfst.pyx":2007
* FstIOError: Write failed.
* """
* if not self._fst.get().Write(path_tostring(source)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1991
+ /* "pywrapfst.pyx":1993
* return self._fst.get().WeightType()
*
* cpdef void write(self, source) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_3Fst_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1991, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1991, __pyx_L1_error)
+ __pyx_f_9pywrapfst_3Fst_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1993, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1993, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2008
+/* "pywrapfst.pyx":2010
* raise FstIOError(f"Write failed: {source!r}")
*
* cpdef bytes write_to_string(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2008, __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, 2010, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Fst_51write_to_string)) {
__Pyx_XDECREF(__pyx_r);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2008, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2010, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 2008, __pyx_L1_error)
+ if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 2010, __pyx_L1_error)
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":2021
+ /* "pywrapfst.pyx":2023
* """
* cdef stringstream _sstrm
* if not self._fst.get().Write(_sstrm, b"<pywrapfst>"): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2021, __pyx_L1_error)
+ __PYX_ERR(0, 2023, __pyx_L1_error)
}
__pyx_t_5 = ((!(__pyx_v_self->_fst.get()->Write(__pyx_v__sstrm, __pyx_k_pywrapfst) != 0)) != 0);
if (unlikely(__pyx_t_5)) {
- /* "pywrapfst.pyx":2022
+ /* "pywrapfst.pyx":2024
* cdef stringstream _sstrm
* if not self._fst.get().Write(_sstrm, b"<pywrapfst>"):
* raise FstIOError("Write to string failed") # <<<<<<<<<<<<<<
* return _sstrm.str()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2022, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2024, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Write_to_string_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Write_to_string_failed);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2022, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2024, __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, 2022, __pyx_L1_error)
+ __PYX_ERR(0, 2024, __pyx_L1_error)
- /* "pywrapfst.pyx":2021
+ /* "pywrapfst.pyx":2023
* """
* cdef stringstream _sstrm
* if not self._fst.get().Write(_sstrm, b"<pywrapfst>"): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2023
+ /* "pywrapfst.pyx":2025
* if not self._fst.get().Write(_sstrm, b"<pywrapfst>"):
* raise FstIOError("Write to string failed")
* return _sstrm.str() # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v__sstrm.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2023, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v__sstrm.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2025, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2008
+ /* "pywrapfst.pyx":2010
* raise FstIOError(f"Write failed: {source!r}")
*
* cpdef bytes write_to_string(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_to_string", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_write_to_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2008, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_write_to_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2010, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2036
+/* "pywrapfst.pyx":2038
* """
*
* cdef void _check_mutating_imethod(self) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_check_mutating_imethod", 0);
- /* "pywrapfst.pyx":2041
+ /* "pywrapfst.pyx":2043
* 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 '%.30s'", "_fst");
- __PYX_ERR(0, 2041, __pyx_L1_error)
+ __PYX_ERR(0, 2043, __pyx_L1_error)
}
__pyx_t_1 = ((__pyx_v_self->__pyx_base._fst.get()->Properties(fst::kError, 1) == fst::kError) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2042
+ /* "pywrapfst.pyx":2044
* """
* if self._fst.get().Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed") # <<<<<<<<<<<<<<
* cdef void _add_arc(self, int64 state, Arc arc) except *:
* if not self._fst.get().ValidStateId(state):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2042, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2044, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Operation_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Operation_failed);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2042, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2044, __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, 2042, __pyx_L1_error)
+ __PYX_ERR(0, 2044, __pyx_L1_error)
- /* "pywrapfst.pyx":2041
+ /* "pywrapfst.pyx":2043
* This function is not visible to Python users.
* """
* if self._fst.get().Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2036
+ /* "pywrapfst.pyx":2038
* """
*
* cdef void _check_mutating_imethod(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2043
+/* "pywrapfst.pyx":2045
* if self._fst.get().Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed")
* cdef void _add_arc(self, int64 state, Arc arc) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_add_arc", 0);
- /* "pywrapfst.pyx":2044
+ /* "pywrapfst.pyx":2046
* raise FstOpError("Operation failed")
* 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 '%.30s'", "_fst");
- __PYX_ERR(0, 2044, __pyx_L1_error)
+ __PYX_ERR(0, 2046, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->__pyx_base._fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2045
+ /* "pywrapfst.pyx":2047
* 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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2045, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2047, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2045, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2047, __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, 2045, __pyx_L1_error)
+ __PYX_ERR(0, 2047, __pyx_L1_error)
- /* "pywrapfst.pyx":2044
+ /* "pywrapfst.pyx":2046
* raise FstOpError("Operation failed")
* cdef void _add_arc(self, int64 state, Arc arc) except *:
* if not self._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2046
+ /* "pywrapfst.pyx":2048
* 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 '%.30s'", "_mfst");
- __PYX_ERR(0, 2046, __pyx_L1_error)
+ __PYX_ERR(0, 2048, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 2046, __pyx_L1_error)
+ __PYX_ERR(0, 2048, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->AddArc(__pyx_v_state, (*__pyx_v_arc->_arc)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2047
+ /* "pywrapfst.pyx":2049
* raise FstIndexError("State index out of range")
* if not self._mfst.get().AddArc(state, deref(arc._arc)):
* raise FstOpError("Incompatible or invalid weight type") # <<<<<<<<<<<<<<
*
* def add_arc(self, int64 state, Arc arc):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2047, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2049, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Incompatible_or_invalid_weight_t) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Incompatible_or_invalid_weight_t);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2047, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2049, __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, 2047, __pyx_L1_error)
+ __PYX_ERR(0, 2049, __pyx_L1_error)
- /* "pywrapfst.pyx":2046
+ /* "pywrapfst.pyx":2048
* 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":2043
+ /* "pywrapfst.pyx":2045
* 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_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2049
+/* "pywrapfst.pyx":2051
* raise FstOpError("Incompatible or invalid weight type")
*
* def add_arc(self, int64 state, Arc arc): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arc)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, 1); __PYX_ERR(0, 2049, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, 1); __PYX_ERR(0, 2051, __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, 2049, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_arc") < 0)) __PYX_ERR(0, 2051, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2049, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2051, __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, 2049, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2051, __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, 2049, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 2051, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_10MutableFst_add_arc(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_arc);
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add_arc", 0);
- /* "pywrapfst.pyx":2066
+ /* "pywrapfst.pyx":2068
* FstOpdexError: Incompatible or invalid weight type.
* """
* self._add_arc(state, arc) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_add_arc");
- __PYX_ERR(0, 2066, __pyx_L1_error)
+ __PYX_ERR(0, 2068, __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, 2066, __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, 2068, __pyx_L1_error)
- /* "pywrapfst.pyx":2067
+ /* "pywrapfst.pyx":2069
* """
* self._add_arc(state, arc)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2049
+ /* "pywrapfst.pyx":2051
* raise FstOpError("Incompatible or invalid weight type")
*
* def add_arc(self, int64 state, Arc arc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2069
+/* "pywrapfst.pyx":2071
* return self
*
* cpdef int64 add_state(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2069, __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, 2071, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_10MutableFst_3add_state)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2071, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2069, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2071, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":2078
+ /* "pywrapfst.pyx":2080
* The integer index of the new state.
* """
* return self._mfst.get().AddState() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2078, __pyx_L1_error)
+ __PYX_ERR(0, 2080, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mfst.get()->AddState();
goto __pyx_L0;
- /* "pywrapfst.pyx":2069
+ /* "pywrapfst.pyx":2071
* return self
*
* cpdef int64 add_state(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add_state", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_10MutableFst_add_state(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2069, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_10MutableFst_add_state(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2071, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2080
+/* "pywrapfst.pyx":2082
* return self._mfst.get().AddState()
*
* cpdef void add_states(self, size_t n): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2080, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2082, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_10MutableFst_5add_states)) {
- __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2080, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2082, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2080, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2082, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":2089
+ /* "pywrapfst.pyx":2091
* n: The number of states to add.
* """
* self._mfst.get().AddStates(n) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2089, __pyx_L1_error)
+ __PYX_ERR(0, 2091, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->AddStates(__pyx_v_n);
- /* "pywrapfst.pyx":2080
+ /* "pywrapfst.pyx":2082
* return self._mfst.get().AddState()
*
* cpdef void add_states(self, size_t n): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_states (wrapper)", 0);
assert(__pyx_arg_n); {
- __pyx_v_n = __Pyx_PyInt_As_size_t(__pyx_arg_n); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2080, __pyx_L3_error)
+ __pyx_v_n = __Pyx_PyInt_As_size_t(__pyx_arg_n); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2082, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add_states", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_10MutableFst_add_states(__pyx_v_self, __pyx_v_n, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2080, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_10MutableFst_add_states(__pyx_v_self, __pyx_v_n, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2082, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2091
+/* "pywrapfst.pyx":2093
* self._mfst.get().AddStates(n)
*
* cdef void _arcsort(self, sort_type="ilabel") except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2093
+ /* "pywrapfst.pyx":2095
* cdef void _arcsort(self, sort_type="ilabel") except *:
* cdef fst.ArcSortType _sort_type
* if not fst.GetArcSortType(tostring(sort_type), addr(_sort_type)): # <<<<<<<<<<<<<<
* raise FstArgError(f"Unknown sort type: {sort_type!r}")
* fst.ArcSort(self._mfst.get(), _sort_type)
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_sort_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2093, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_sort_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2095, __pyx_L1_error)
__pyx_t_2 = ((!(fst::script::GetArcSortType(__pyx_t_1, (&__pyx_v__sort_type)) != 0)) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":2094
+ /* "pywrapfst.pyx":2096
* cdef fst.ArcSortType _sort_type
* if not fst.GetArcSortType(tostring(sort_type), addr(_sort_type)):
* raise FstArgError(f"Unknown sort type: {sort_type!r}") # <<<<<<<<<<<<<<
* fst.ArcSort(self._mfst.get(), _sort_type)
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2094, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2096, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_sort_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2094, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_sort_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2096, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_sort_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2094, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_sort_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2096, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2094, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2096, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2094, __pyx_L1_error)
+ __PYX_ERR(0, 2096, __pyx_L1_error)
- /* "pywrapfst.pyx":2093
+ /* "pywrapfst.pyx":2095
* cdef void _arcsort(self, sort_type="ilabel") except *:
* cdef fst.ArcSortType _sort_type
* if not fst.GetArcSortType(tostring(sort_type), addr(_sort_type)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2095
+ /* "pywrapfst.pyx":2097
* if not fst.GetArcSortType(tostring(sort_type), addr(_sort_type)):
* raise FstArgError(f"Unknown sort type: {sort_type!r}")
* fst.ArcSort(self._mfst.get(), _sort_type) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2095, __pyx_L1_error)
+ __PYX_ERR(0, 2097, __pyx_L1_error)
}
fst::script::ArcSort(__pyx_v_self->_mfst.get(), __pyx_v__sort_type);
- /* "pywrapfst.pyx":2091
+ /* "pywrapfst.pyx":2093
* self._mfst.get().AddStates(n)
*
* cdef void _arcsort(self, sort_type="ilabel") except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2097
+/* "pywrapfst.pyx":2099
* fst.ArcSort(self._mfst.get(), _sort_type)
*
* def arcsort(self, sort_type="ilabel"): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 2097, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 2099, __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, 2097, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("arcsort", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2099, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arcsort", 0);
- /* "pywrapfst.pyx":2116
+ /* "pywrapfst.pyx":2118
* FstArgError: Unknown sort type.
* """
* self._arcsort(sort_type) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arcsort");
- __PYX_ERR(0, 2116, __pyx_L1_error)
+ __PYX_ERR(0, 2118, __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, 2116, __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, 2118, __pyx_L1_error)
- /* "pywrapfst.pyx":2117
+ /* "pywrapfst.pyx":2119
* """
* self._arcsort(sort_type)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2097
+ /* "pywrapfst.pyx":2099
* fst.ArcSort(self._mfst.get(), _sort_type)
*
* def arcsort(self, sort_type="ilabel"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2119
+/* "pywrapfst.pyx":2121
* return self
*
* cdef void _closure(self, bool closure_plus=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2120
+ /* "pywrapfst.pyx":2122
*
* cdef void _closure(self, bool closure_plus=False):
* fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2120, __pyx_L1_error)
+ __PYX_ERR(0, 2122, __pyx_L1_error)
}
fst::script::Closure(__pyx_v_self->_mfst.get(), fst::script::GetClosureType(__pyx_v_closure_plus));
- /* "pywrapfst.pyx":2119
+ /* "pywrapfst.pyx":2121
* return self
*
* cdef void _closure(self, bool closure_plus=False): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2122
+/* "pywrapfst.pyx":2124
* fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
*
* 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, 2122, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "closure") < 0)) __PYX_ERR(0, 2124, __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, 2122, __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, 2124, __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, 2122, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("closure", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2124, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.closure", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("closure", 0);
- /* "pywrapfst.pyx":2140
+ /* "pywrapfst.pyx":2142
* self.
* """
* self._closure(closure_plus) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_closure");
- __PYX_ERR(0, 2140, __pyx_L1_error)
+ __PYX_ERR(0, 2142, __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);
- /* "pywrapfst.pyx":2141
+ /* "pywrapfst.pyx":2143
* """
* self._closure(closure_plus)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2122
+ /* "pywrapfst.pyx":2124
* fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
*
* def closure(self, bool closure_plus=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2143
+/* "pywrapfst.pyx":2145
* return self
*
* cdef void _concat(self, Fst fst2) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_concat", 0);
- /* "pywrapfst.pyx":2144
+ /* "pywrapfst.pyx":2146
*
* cdef void _concat(self, Fst fst2) except *:
* fst.Concat(self._mfst.get(), deref(fst2._fst)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2144, __pyx_L1_error)
+ __PYX_ERR(0, 2146, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_fst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2144, __pyx_L1_error)
+ __PYX_ERR(0, 2146, __pyx_L1_error)
}
fst::script::Concat(__pyx_v_self->_mfst.get(), (*__pyx_v_fst2->_fst));
- /* "pywrapfst.pyx":2145
+ /* "pywrapfst.pyx":2147
* cdef void _concat(self, Fst fst2) except *:
* fst.Concat(self._mfst.get(), deref(fst2._fst))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2145, __pyx_L1_error)
+ __PYX_ERR(0, 2147, __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, 2145, __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, 2147, __pyx_L1_error)
- /* "pywrapfst.pyx":2143
+ /* "pywrapfst.pyx":2145
* return self
*
* cdef void _concat(self, Fst fst2) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2147
+/* "pywrapfst.pyx":2149
* self._check_mutating_imethod()
*
* def concat(self, Fst fst2): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("concat (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst2), __pyx_ptype_9pywrapfst_Fst, 1, "fst2", 0))) __PYX_ERR(0, 2147, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst2), __pyx_ptype_9pywrapfst_Fst, 1, "fst2", 0))) __PYX_ERR(0, 2149, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_10MutableFst_10concat(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_fst2));
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("concat", 0);
- /* "pywrapfst.pyx":2164
+ /* "pywrapfst.pyx":2166
* self.
* """
* self._concat(fst2) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_concat");
- __PYX_ERR(0, 2164, __pyx_L1_error)
+ __PYX_ERR(0, 2166, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_concat(__pyx_v_self, __pyx_v_fst2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2164, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_concat(__pyx_v_self, __pyx_v_fst2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2166, __pyx_L1_error)
- /* "pywrapfst.pyx":2165
+ /* "pywrapfst.pyx":2167
* """
* self._concat(fst2)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2147
+ /* "pywrapfst.pyx":2149
* self._check_mutating_imethod()
*
* def concat(self, Fst fst2): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2167
+/* "pywrapfst.pyx":2169
* return self
*
* cdef void _connect(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_connect", 0);
- /* "pywrapfst.pyx":2168
+ /* "pywrapfst.pyx":2170
*
* cdef void _connect(self):
* fst.Connect(self._mfst.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2168, __pyx_L1_error)
+ __PYX_ERR(0, 2170, __pyx_L1_error)
}
fst::script::Connect(__pyx_v_self->_mfst.get());
- /* "pywrapfst.pyx":2167
+ /* "pywrapfst.pyx":2169
* return self
*
* cdef void _connect(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2170
+/* "pywrapfst.pyx":2172
* fst.Connect(self._mfst.get())
*
* def connect(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("connect", 0);
- /* "pywrapfst.pyx":2182
+ /* "pywrapfst.pyx":2184
* self.
* """
* self._connect() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_connect");
- __PYX_ERR(0, 2182, __pyx_L1_error)
+ __PYX_ERR(0, 2184, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_connect(__pyx_v_self);
- /* "pywrapfst.pyx":2183
+ /* "pywrapfst.pyx":2185
* """
* self._connect()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2170
+ /* "pywrapfst.pyx":2172
* fst.Connect(self._mfst.get())
*
* def connect(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2185
+/* "pywrapfst.pyx":2187
* return self
*
* cdef void _decode(self, EncodeMapper mapper) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_decode", 0);
- /* "pywrapfst.pyx":2186
+ /* "pywrapfst.pyx":2188
*
* cdef void _decode(self, EncodeMapper mapper) except *:
* fst.Decode(self._mfst.get(), deref(mapper._mapper)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2186, __pyx_L1_error)
+ __PYX_ERR(0, 2188, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_mapper) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 2186, __pyx_L1_error)
+ __PYX_ERR(0, 2188, __pyx_L1_error)
}
fst::script::Decode(__pyx_v_self->_mfst.get(), (*__pyx_v_mapper->_mapper));
- /* "pywrapfst.pyx":2187
+ /* "pywrapfst.pyx":2189
* cdef void _decode(self, EncodeMapper mapper) except *:
* fst.Decode(self._mfst.get(), deref(mapper._mapper))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2187, __pyx_L1_error)
+ __PYX_ERR(0, 2189, __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, 2187, __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, 2189, __pyx_L1_error)
- /* "pywrapfst.pyx":2185
+ /* "pywrapfst.pyx":2187
* return self
*
* cdef void _decode(self, EncodeMapper mapper) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2189
+/* "pywrapfst.pyx":2191
* self._check_mutating_imethod()
*
* def decode(self, EncodeMapper mapper): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("decode (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapper), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "mapper", 0))) __PYX_ERR(0, 2189, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapper), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "mapper", 0))) __PYX_ERR(0, 2191, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_10MutableFst_14decode(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_mapper));
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("decode", 0);
- /* "pywrapfst.pyx":2203
+ /* "pywrapfst.pyx":2205
* self.
* """
* self._decode(mapper) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_decode");
- __PYX_ERR(0, 2203, __pyx_L1_error)
+ __PYX_ERR(0, 2205, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_decode(__pyx_v_self, __pyx_v_mapper); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2203, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_decode(__pyx_v_self, __pyx_v_mapper); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2205, __pyx_L1_error)
- /* "pywrapfst.pyx":2204
+ /* "pywrapfst.pyx":2206
* """
* self._decode(mapper)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2189
+ /* "pywrapfst.pyx":2191
* self._check_mutating_imethod()
*
* def decode(self, EncodeMapper mapper): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2206
+/* "pywrapfst.pyx":2208
* return self
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2207
+ /* "pywrapfst.pyx":2209
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
* if not (self._mfst.get().DeleteArcs(state, n) if n else # <<<<<<<<<<<<<<
if ((__pyx_v_n != 0)) {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2207, __pyx_L1_error)
+ __PYX_ERR(0, 2209, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state, __pyx_v_n);
} else {
- /* "pywrapfst.pyx":2208
+ /* "pywrapfst.pyx":2210
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
* if not (self._mfst.get().DeleteArcs(state, n) if n else
* self._mfst.get().DeleteArcs(state)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2208, __pyx_L1_error)
+ __PYX_ERR(0, 2210, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state);
}
- /* "pywrapfst.pyx":2207
+ /* "pywrapfst.pyx":2209
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
* if not (self._mfst.get().DeleteArcs(state, n) if n else # <<<<<<<<<<<<<<
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":2209
+ /* "pywrapfst.pyx":2211
* if not (self._mfst.get().DeleteArcs(state, n) if n else
* self._mfst.get().DeleteArcs(state)):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2209, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2209, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2209, __pyx_L1_error)
+ __PYX_ERR(0, 2211, __pyx_L1_error)
- /* "pywrapfst.pyx":2207
+ /* "pywrapfst.pyx":2209
*
* 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":2210
+ /* "pywrapfst.pyx":2212
* self._mfst.get().DeleteArcs(state)):
* raise FstIndexError("State index out of range")
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2210, __pyx_L1_error)
+ __PYX_ERR(0, 2212, __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, 2210, __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, 2212, __pyx_L1_error)
- /* "pywrapfst.pyx":2206
+ /* "pywrapfst.pyx":2208
* return self
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2212
+/* "pywrapfst.pyx":2214
* 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, 2212, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_arcs") < 0)) __PYX_ERR(0, 2214, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2212, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2214, __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, 2212, __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, 2214, __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, 2212, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("delete_arcs", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2214, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.delete_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("delete_arcs", 0);
- /* "pywrapfst.pyx":2230
+ /* "pywrapfst.pyx":2232
* FstIndexError: State index out of range.
* """
* self._delete_arcs(state, n) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_delete_arcs");
- __PYX_ERR(0, 2230, __pyx_L1_error)
+ __PYX_ERR(0, 2232, __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, 2230, __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, 2232, __pyx_L1_error)
- /* "pywrapfst.pyx":2231
+ /* "pywrapfst.pyx":2233
* """
* self._delete_arcs(state, n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2212
+ /* "pywrapfst.pyx":2214
* self._check_mutating_imethod()
*
* def delete_arcs(self, int64 state, size_t n=0): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2233
+/* "pywrapfst.pyx":2235
* return self
*
* cdef void _delete_states(self, states=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2235
+ /* "pywrapfst.pyx":2237
* 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, 2235, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_states); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2237, __pyx_L1_error)
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2236
+ /* "pywrapfst.pyx":2238
* # Only the former signature has a possible indexing failure.
* if states:
* if not self._mfst.get().DeleteStates(<const vector[int64]> states): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2236, __pyx_L1_error)
+ __PYX_ERR(0, 2238, __pyx_L1_error)
}
- __pyx_t_2 = __pyx_convert_vector_from_py_int64(__pyx_v_states); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2236, __pyx_L1_error)
+ __pyx_t_2 = __pyx_convert_vector_from_py_int64(__pyx_v_states); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2238, __pyx_L1_error)
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->DeleteStates(((std::vector<int64> const )__pyx_t_2)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2237
+ /* "pywrapfst.pyx":2239
* if states:
* if not self._mfst.get().DeleteStates(<const vector[int64]> states):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* else:
* self._mfst.get().DeleteStates()
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2237, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2237, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2237, __pyx_L1_error)
+ __PYX_ERR(0, 2239, __pyx_L1_error)
- /* "pywrapfst.pyx":2236
+ /* "pywrapfst.pyx":2238
* # Only the former signature has a possible indexing failure.
* if states:
* if not self._mfst.get().DeleteStates(<const vector[int64]> states): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2235
+ /* "pywrapfst.pyx":2237
* cdef void _delete_states(self, states=None) except *:
* # Only the former signature has a possible indexing failure.
* if states: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":2239
+ /* "pywrapfst.pyx":2241
* raise FstIndexError("State index out of range")
* else:
* self._mfst.get().DeleteStates() # <<<<<<<<<<<<<<
/*else*/ {
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2239, __pyx_L1_error)
+ __PYX_ERR(0, 2241, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->DeleteStates();
}
__pyx_L3:;
- /* "pywrapfst.pyx":2240
+ /* "pywrapfst.pyx":2242
* else:
* self._mfst.get().DeleteStates()
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2240, __pyx_L1_error)
+ __PYX_ERR(0, 2242, __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, 2240, __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, 2242, __pyx_L1_error)
- /* "pywrapfst.pyx":2233
+ /* "pywrapfst.pyx":2235
* return self
*
* cdef void _delete_states(self, states=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2242
+/* "pywrapfst.pyx":2244
* 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, 2242, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_states") < 0)) __PYX_ERR(0, 2244, __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, 2242, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("delete_states", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2244, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.delete_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("delete_states", 0);
- /* "pywrapfst.pyx":2258
+ /* "pywrapfst.pyx":2260
* FstIndexError: State index out of range.
* """
* self._delete_states(states) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_delete_states");
- __PYX_ERR(0, 2258, __pyx_L1_error)
+ __PYX_ERR(0, 2260, __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, 2258, __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, 2260, __pyx_L1_error)
- /* "pywrapfst.pyx":2259
+ /* "pywrapfst.pyx":2261
* """
* self._delete_states(states)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2242
+ /* "pywrapfst.pyx":2244
* self._check_mutating_imethod()
*
* def delete_states(self, states=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2261
+/* "pywrapfst.pyx":2263
* return self
*
* cdef void _encode(self, EncodeMapper mapper) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_encode", 0);
- /* "pywrapfst.pyx":2262
+ /* "pywrapfst.pyx":2264
*
* cdef void _encode(self, EncodeMapper mapper) except *:
* fst.Encode(self._mfst.get(), mapper._mapper.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2262, __pyx_L1_error)
+ __PYX_ERR(0, 2264, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_mapper) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 2262, __pyx_L1_error)
+ __PYX_ERR(0, 2264, __pyx_L1_error)
}
fst::script::Encode(__pyx_v_self->_mfst.get(), __pyx_v_mapper->_mapper.get());
- /* "pywrapfst.pyx":2263
+ /* "pywrapfst.pyx":2265
* cdef void _encode(self, EncodeMapper mapper) except *:
* fst.Encode(self._mfst.get(), mapper._mapper.get())
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2263, __pyx_L1_error)
+ __PYX_ERR(0, 2265, __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, 2263, __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, 2265, __pyx_L1_error)
- /* "pywrapfst.pyx":2261
+ /* "pywrapfst.pyx":2263
* return self
*
* cdef void _encode(self, EncodeMapper mapper) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2265
+/* "pywrapfst.pyx":2267
* self._check_mutating_imethod()
*
* def encode(self, EncodeMapper mapper): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("encode (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapper), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "mapper", 0))) __PYX_ERR(0, 2265, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapper), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "mapper", 0))) __PYX_ERR(0, 2267, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_10MutableFst_20encode(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_mapper));
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("encode", 0);
- /* "pywrapfst.pyx":2284
+ /* "pywrapfst.pyx":2286
* self.
* """
* self._encode(mapper) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encode");
- __PYX_ERR(0, 2284, __pyx_L1_error)
+ __PYX_ERR(0, 2286, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_encode(__pyx_v_self, __pyx_v_mapper); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2284, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_encode(__pyx_v_self, __pyx_v_mapper); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2286, __pyx_L1_error)
- /* "pywrapfst.pyx":2285
+ /* "pywrapfst.pyx":2287
* """
* self._encode(mapper)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2265
+ /* "pywrapfst.pyx":2267
* self._check_mutating_imethod()
*
* def encode(self, EncodeMapper mapper): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2287
+/* "pywrapfst.pyx":2289
* return self
*
* cdef void _invert(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_invert", 0);
- /* "pywrapfst.pyx":2288
+ /* "pywrapfst.pyx":2290
*
* cdef void _invert(self):
* fst.Invert(self._mfst.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2288, __pyx_L1_error)
+ __PYX_ERR(0, 2290, __pyx_L1_error)
}
fst::script::Invert(__pyx_v_self->_mfst.get());
- /* "pywrapfst.pyx":2287
+ /* "pywrapfst.pyx":2289
* return self
*
* cdef void _invert(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2290
+/* "pywrapfst.pyx":2292
* fst.Invert(self._mfst.get())
*
* def invert(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("invert", 0);
- /* "pywrapfst.pyx":2302
+ /* "pywrapfst.pyx":2304
* self.
* """
* self._invert() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_invert");
- __PYX_ERR(0, 2302, __pyx_L1_error)
+ __PYX_ERR(0, 2304, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_invert(__pyx_v_self);
- /* "pywrapfst.pyx":2303
+ /* "pywrapfst.pyx":2305
* """
* self._invert()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2290
+ /* "pywrapfst.pyx":2292
* fst.Invert(self._mfst.get())
*
* def invert(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2305
+/* "pywrapfst.pyx":2307
* return self
*
* cdef void _minimize(self, # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_10MutableFst__minimize(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__minimize *__pyx_optional_args) {
float __pyx_v_delta = __pyx_k__12;
- /* "pywrapfst.pyx":2307
+ /* "pywrapfst.pyx":2309
* cdef void _minimize(self,
* float delta=fst.kShortestDelta,
* bool allow_nondet=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2309
+ /* "pywrapfst.pyx":2311
* bool allow_nondet=False) except *:
* # This runs in-place when the second argument is null.
* fst.Minimize(self._mfst.get(), NULL, delta, allow_nondet) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2309, __pyx_L1_error)
+ __PYX_ERR(0, 2311, __pyx_L1_error)
}
fst::script::Minimize(__pyx_v_self->_mfst.get(), NULL, __pyx_v_delta, __pyx_v_allow_nondet);
- /* "pywrapfst.pyx":2310
+ /* "pywrapfst.pyx":2312
* # This runs in-place when the second argument is null.
* fst.Minimize(self._mfst.get(), NULL, delta, allow_nondet)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2310, __pyx_L1_error)
+ __PYX_ERR(0, 2312, __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)
+ ((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, 2312, __pyx_L1_error)
- /* "pywrapfst.pyx":2305
+ /* "pywrapfst.pyx":2307
* return self
*
* cdef void _minimize(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2312
+/* "pywrapfst.pyx":2314
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kShortestDelta, 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, 2312, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minimize") < 0)) __PYX_ERR(0, 2314, __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, 2312, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2314, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__13;
}
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, 2312, __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, 2314, __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, 2312, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("minimize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2314, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.minimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("minimize", 0);
- /* "pywrapfst.pyx":2338
+ /* "pywrapfst.pyx":2340
* self.
* """
* self._minimize(delta, allow_nondet) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_minimize");
- __PYX_ERR(0, 2338, __pyx_L1_error)
+ __PYX_ERR(0, 2340, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 2;
__pyx_t_1.delta = __pyx_v_delta;
__pyx_t_1.allow_nondet = __pyx_v_allow_nondet;
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_minimize(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2338, __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, 2340, __pyx_L1_error)
- /* "pywrapfst.pyx":2339
+ /* "pywrapfst.pyx":2341
* """
* self._minimize(delta, allow_nondet)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2312
+ /* "pywrapfst.pyx":2314
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2341
+/* "pywrapfst.pyx":2343
* return self
*
* cpdef MutableArcIterator mutable_arcs(self, int64 state): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mutable_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2341, __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, 2343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_10MutableFst_27mutable_arcs)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2341, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2341, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_MutableArcIterator))))) __PYX_ERR(0, 2341, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_MutableArcIterator))))) __PYX_ERR(0, 2343, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":2353
+ /* "pywrapfst.pyx":2355
* A MutableArcIterator.
* """
* 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, 2353, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2353, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2355, __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, 2353, __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, 2355, __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":2341
+ /* "pywrapfst.pyx":2343
* 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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2341, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2343, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mutable_arcs", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_10MutableFst_mutable_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2341, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_10MutableFst_mutable_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2355
+/* "pywrapfst.pyx":2357
* return MutableArcIterator(self, state)
*
* def mutable_input_symbols(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mutable_input_symbols", 0);
- /* "pywrapfst.pyx":2361
+ /* "pywrapfst.pyx":2363
* Returns the FST's (mutable) input symbol table, or None if none is present.
* """
* if self._mfst.get().MutableInputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2361, __pyx_L1_error)
+ __PYX_ERR(0, 2363, __pyx_L1_error)
}
__pyx_t_1 = ((__pyx_v_self->_mfst.get()->MutableInputSymbols() == NULL) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2362
+ /* "pywrapfst.pyx":2364
* """
* if self._mfst.get().MutableInputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":2361
+ /* "pywrapfst.pyx":2363
* Returns the FST's (mutable) input symbol table, or None if none is present.
* """
* if self._mfst.get().MutableInputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2363
+ /* "pywrapfst.pyx":2365
* if self._mfst.get().MutableInputSymbols() == NULL:
* return
* return _init_MutableFstSymbolTableView(self._mfst, input_side=True) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2363, __pyx_L1_error)
+ __PYX_ERR(0, 2365, __pyx_L1_error)
}
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTableView(__pyx_v_self->_mfst, 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2363, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTableView(__pyx_v_self->_mfst, 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2355
+ /* "pywrapfst.pyx":2357
* return MutableArcIterator(self, state)
*
* def mutable_input_symbols(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2365
+/* "pywrapfst.pyx":2367
* return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
*
* def mutable_output_symbols(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mutable_output_symbols", 0);
- /* "pywrapfst.pyx":2371
+ /* "pywrapfst.pyx":2373
* Returns the FST's (mutable) output symbol table, or None if none is present.
* """
* if self._mfst.get().MutableOutputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2371, __pyx_L1_error)
+ __PYX_ERR(0, 2373, __pyx_L1_error)
}
__pyx_t_1 = ((__pyx_v_self->_mfst.get()->MutableOutputSymbols() == NULL) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2372
+ /* "pywrapfst.pyx":2374
* """
* if self._mfst.get().MutableOutputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":2371
+ /* "pywrapfst.pyx":2373
* Returns the FST's (mutable) output symbol table, or None if none is present.
* """
* if self._mfst.get().MutableOutputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2373
+ /* "pywrapfst.pyx":2375
* if self._mfst.get().MutableOutputSymbols() == NULL:
* return
* return _init_MutableFstSymbolTableView(self._mfst, input_side=False) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2373, __pyx_L1_error)
+ __PYX_ERR(0, 2375, __pyx_L1_error)
}
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTableView(__pyx_v_self->_mfst, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2373, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTableView(__pyx_v_self->_mfst, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2375, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2365
+ /* "pywrapfst.pyx":2367
* return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
*
* def mutable_output_symbols(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2375
+/* "pywrapfst.pyx":2377
* return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
*
* cpdef int64 num_states(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2375, __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, 2377, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_10MutableFst_33num_states)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2375, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2377, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2375, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2377, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":2381
+ /* "pywrapfst.pyx":2383
* Returns the number of states.
* """
* return self._mfst.get().NumStates() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2381, __pyx_L1_error)
+ __PYX_ERR(0, 2383, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mfst.get()->NumStates();
goto __pyx_L0;
- /* "pywrapfst.pyx":2375
+ /* "pywrapfst.pyx":2377
* return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
*
* cpdef int64 num_states(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("num_states", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_10MutableFst_num_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2375, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_10MutableFst_num_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2377, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2383
+/* "pywrapfst.pyx":2385
* return self._mfst.get().NumStates()
*
* cdef void _project(self, project_type) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_project", 0);
- /* "pywrapfst.pyx":2384
+ /* "pywrapfst.pyx":2386
*
* cdef void _project(self, project_type) except *:
* fst.Project(self._mfst.get(), _get_project_type(tostring(project_type))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2384, __pyx_L1_error)
+ __PYX_ERR(0, 2386, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_project_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2384, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_project_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2384, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_project_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2386, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_project_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2386, __pyx_L1_error)
fst::script::Project(__pyx_v_self->_mfst.get(), __pyx_t_2);
- /* "pywrapfst.pyx":2383
+ /* "pywrapfst.pyx":2385
* return self._mfst.get().NumStates()
*
* cdef void _project(self, project_type) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2386
+/* "pywrapfst.pyx":2388
* fst.Project(self._mfst.get(), _get_project_type(tostring(project_type)))
*
* def project(self, project_type): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("project", 0);
- /* "pywrapfst.pyx":2403
+ /* "pywrapfst.pyx":2405
* self.
* """
* self._project(project_type) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_project");
- __PYX_ERR(0, 2403, __pyx_L1_error)
+ __PYX_ERR(0, 2405, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_project(__pyx_v_self, __pyx_v_project_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2403, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_project(__pyx_v_self, __pyx_v_project_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2405, __pyx_L1_error)
- /* "pywrapfst.pyx":2404
+ /* "pywrapfst.pyx":2406
* """
* self._project(project_type)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2386
+ /* "pywrapfst.pyx":2388
* fst.Project(self._mfst.get(), _get_project_type(tostring(project_type)))
*
* def project(self, project_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2406
+/* "pywrapfst.pyx":2408
* return self
*
* cdef void _prune(self, # <<<<<<<<<<<<<<
float __pyx_v_delta = __pyx_k__14;
int64 __pyx_v_nstate = __pyx_k__15;
- /* "pywrapfst.pyx":2409
+ /* "pywrapfst.pyx":2411
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None) except *: # <<<<<<<<<<<<<<
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(self.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
fst::script::WeightClass __pyx_v__weight;
}
}
- /* "pywrapfst.pyx":2411
+ /* "pywrapfst.pyx":2413
* weight=None) except *:
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(self.weight_type(), # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(), # <<<<<<<<<<<<<<
* weight)
* fst.Prune(self._mfst.get(), _weight, nstate, delta)
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 2411, __pyx_L1_error)
+ __PYX_ERR(0, 2413, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2412
+ /* "pywrapfst.pyx":2414
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(self.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
* weight) # <<<<<<<<<<<<<<
* fst.Prune(self._mfst.get(), _weight, 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, 2411, __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, 2413, __pyx_L1_error)
__pyx_v__weight = __pyx_t_1;
- /* "pywrapfst.pyx":2413
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(self.weight_type(),
+ /* "pywrapfst.pyx":2415
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
* weight)
* fst.Prune(self._mfst.get(), _weight, nstate, delta) # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2413, __pyx_L1_error)
+ __PYX_ERR(0, 2415, __pyx_L1_error)
}
fst::script::Prune(__pyx_v_self->_mfst.get(), __pyx_v__weight, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":2414
+ /* "pywrapfst.pyx":2416
* weight)
* fst.Prune(self._mfst.get(), _weight, nstate, delta)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2414, __pyx_L1_error)
+ __PYX_ERR(0, 2416, __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, 2414, __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, 2416, __pyx_L1_error)
- /* "pywrapfst.pyx":2406
+ /* "pywrapfst.pyx":2408
* return self
*
* cdef void _prune(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2416
+/* "pywrapfst.pyx":2418
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_weight,0};
PyObject* values[3] = {0,0,0};
- /* "pywrapfst.pyx":2419
+ /* "pywrapfst.pyx":2421
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 2416, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 2418, __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, 2417, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2419, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__16;
}
if (values[1]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2418, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__17;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2416, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2418, __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_10MutableFst_36prune(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);
- /* "pywrapfst.pyx":2416
+ /* "pywrapfst.pyx":2418
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("prune", 0);
- /* "pywrapfst.pyx":2439
+ /* "pywrapfst.pyx":2441
* self.
* """
* self._prune(delta, nstate, weight) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_prune");
- __PYX_ERR(0, 2439, __pyx_L1_error)
+ __PYX_ERR(0, 2441, __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, 2439, __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, 2441, __pyx_L1_error)
- /* "pywrapfst.pyx":2440
+ /* "pywrapfst.pyx":2442
* """
* self._prune(delta, nstate, weight)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2416
+ /* "pywrapfst.pyx":2418
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2442
+/* "pywrapfst.pyx":2444
* return self
*
* cdef void _push(self, # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_10MutableFst__push(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__push *__pyx_optional_args) {
float __pyx_v_delta = __pyx_k__18;
- /* "pywrapfst.pyx":2444
+ /* "pywrapfst.pyx":2446
* cdef void _push(self,
* float delta=fst.kShortestDelta,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_total_weight = ((bool)0);
- /* "pywrapfst.pyx":2445
+ /* "pywrapfst.pyx":2447
* float delta=fst.kShortestDelta,
* bool remove_total_weight=False,
* bool to_final=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2446
+ /* "pywrapfst.pyx":2448
* bool remove_total_weight=False,
* bool to_final=False):
* fst.Push(self._mfst.get(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2446, __pyx_L1_error)
+ __PYX_ERR(0, 2448, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2449
+ /* "pywrapfst.pyx":2451
* 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":2442
+ /* "pywrapfst.pyx":2444
* return self
*
* cdef void _push(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2451
+/* "pywrapfst.pyx":2453
* remove_total_weight)
*
* 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, 2451, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 2453, __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, 2452, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__19;
}
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, 2453, __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, 2455, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2453
+ /* "pywrapfst.pyx":2455
* def push(self,
* float delta=fst.kShortestDelta,
* 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, 2454, __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, 2456, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2454
+ /* "pywrapfst.pyx":2456
* float delta=fst.kShortestDelta,
* 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, 2451, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("push", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2453, __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_10MutableFst_38push(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_remove_total_weight, __pyx_v_to_final);
- /* "pywrapfst.pyx":2451
+ /* "pywrapfst.pyx":2453
* remove_total_weight)
*
* def push(self, # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("push", 0);
- /* "pywrapfst.pyx":2478
+ /* "pywrapfst.pyx":2480
* self.
* """
* self._push(delta, remove_total_weight, to_final) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_push");
- __PYX_ERR(0, 2478, __pyx_L1_error)
+ __PYX_ERR(0, 2480, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 3;
__pyx_t_1.delta = __pyx_v_delta;
__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);
- /* "pywrapfst.pyx":2479
+ /* "pywrapfst.pyx":2481
* """
* self._push(delta, remove_total_weight, to_final)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2451
+ /* "pywrapfst.pyx":2453
* remove_total_weight)
*
* def push(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2481
+/* "pywrapfst.pyx":2483
* return self
*
* cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2484
+ /* "pywrapfst.pyx":2486
* cdef vector[fst.LabelPair] _ipairs
* cdef vector[fst.LabelPair] _opairs
* if ipairs: # <<<<<<<<<<<<<<
* for (before, after) in ipairs:
* _ipairs.push_back(fst.LabelPair(before, after))
*/
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2484, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2486, __pyx_L1_error)
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2485
+ /* "pywrapfst.pyx":2487
* cdef vector[fst.LabelPair] _opairs
* if ipairs:
* for (before, after) in ipairs: # <<<<<<<<<<<<<<
__pyx_t_2 = __pyx_v_ipairs; __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_ipairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2485, __pyx_L1_error)
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ipairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2487, __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, 2485, __pyx_L1_error)
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2487, __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, 2485, __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, 2487, __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, 2485, __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, 2487, __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, 2485, __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, 2487, __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, 2485, __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, 2487, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2485, __pyx_L1_error)
+ else __PYX_ERR(0, 2487, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 2485, __pyx_L1_error)
+ __PYX_ERR(0, 2487, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
#else
- __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2485, __pyx_L1_error)
+ __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2487, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2485, __pyx_L1_error)
+ __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2487, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2485, __pyx_L1_error)
+ __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2487, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
__Pyx_GOTREF(__pyx_t_6);
index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2485, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2487, __pyx_L1_error)
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L7_unpacking_done;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 2485, __pyx_L1_error)
+ __PYX_ERR(0, 2487, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_before, __pyx_t_6);
__Pyx_XDECREF_SET(__pyx_v_after, __pyx_t_7);
__pyx_t_7 = 0;
- /* "pywrapfst.pyx":2486
+ /* "pywrapfst.pyx":2488
* if ipairs:
* for (before, after) in ipairs:
* _ipairs.push_back(fst.LabelPair(before, after)) # <<<<<<<<<<<<<<
* if opairs:
* for (before, after) in opairs:
*/
- __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_before); if (unlikely((__pyx_t_10 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2486, __pyx_L1_error)
- __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_v_after); if (unlikely((__pyx_t_11 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2486, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_before); if (unlikely((__pyx_t_10 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2488, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_v_after); if (unlikely((__pyx_t_11 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2488, __pyx_L1_error)
try {
__pyx_t_12 = __pyx_t_10cpywrapfst_LabelPair(__pyx_t_10, __pyx_t_11);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2486, __pyx_L1_error)
+ __PYX_ERR(0, 2488, __pyx_L1_error)
}
try {
__pyx_v__ipairs.push_back(__pyx_t_12);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2486, __pyx_L1_error)
+ __PYX_ERR(0, 2488, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2485
+ /* "pywrapfst.pyx":2487
* cdef vector[fst.LabelPair] _opairs
* if ipairs:
* for (before, after) in ipairs: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2484
+ /* "pywrapfst.pyx":2486
* cdef vector[fst.LabelPair] _ipairs
* cdef vector[fst.LabelPair] _opairs
* if ipairs: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2487
+ /* "pywrapfst.pyx":2489
* for (before, after) in ipairs:
* _ipairs.push_back(fst.LabelPair(before, after))
* if opairs: # <<<<<<<<<<<<<<
* for (before, after) in opairs:
* _opairs.push_back(fst.LabelPair(before, after))
*/
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2487, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2489, __pyx_L1_error)
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2488
+ /* "pywrapfst.pyx":2490
* _ipairs.push_back(fst.LabelPair(before, after))
* if opairs:
* for (before, after) in opairs: # <<<<<<<<<<<<<<
__pyx_t_2 = __pyx_v_opairs; __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_opairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2488, __pyx_L1_error)
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_opairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2490, __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, 2488, __pyx_L1_error)
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2490, __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, 2488, __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, 2490, __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, 2488, __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, 2490, __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, 2488, __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, 2490, __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, 2488, __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, 2490, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2488, __pyx_L1_error)
+ else __PYX_ERR(0, 2490, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 2488, __pyx_L1_error)
+ __PYX_ERR(0, 2490, __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_6);
#else
- __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2488, __pyx_L1_error)
+ __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2490, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2488, __pyx_L1_error)
+ __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2490, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2488, __pyx_L1_error)
+ __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2490, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
__Pyx_GOTREF(__pyx_t_7);
index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2488, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2490, __pyx_L1_error)
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L12_unpacking_done;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 2488, __pyx_L1_error)
+ __PYX_ERR(0, 2490, __pyx_L1_error)
__pyx_L12_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_before, __pyx_t_7);
__Pyx_XDECREF_SET(__pyx_v_after, __pyx_t_6);
__pyx_t_6 = 0;
- /* "pywrapfst.pyx":2489
+ /* "pywrapfst.pyx":2491
* if opairs:
* for (before, after) in opairs:
* _opairs.push_back(fst.LabelPair(before, after)) # <<<<<<<<<<<<<<
* if _ipairs.empty() and _opairs.empty():
* raise FstArgError("No relabeling pairs specified")
*/
- __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_v_before); if (unlikely((__pyx_t_11 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2489, __pyx_L1_error)
- __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_after); if (unlikely((__pyx_t_10 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2489, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_v_before); if (unlikely((__pyx_t_11 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2491, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_after); if (unlikely((__pyx_t_10 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2491, __pyx_L1_error)
try {
__pyx_t_12 = __pyx_t_10cpywrapfst_LabelPair(__pyx_t_11, __pyx_t_10);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2489, __pyx_L1_error)
+ __PYX_ERR(0, 2491, __pyx_L1_error)
}
try {
__pyx_v__opairs.push_back(__pyx_t_12);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2489, __pyx_L1_error)
+ __PYX_ERR(0, 2491, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2488
+ /* "pywrapfst.pyx":2490
* _ipairs.push_back(fst.LabelPair(before, after))
* if opairs:
* for (before, after) in opairs: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2487
+ /* "pywrapfst.pyx":2489
* for (before, after) in ipairs:
* _ipairs.push_back(fst.LabelPair(before, after))
* if opairs: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2490
+ /* "pywrapfst.pyx":2492
* for (before, after) in opairs:
* _opairs.push_back(fst.LabelPair(before, after))
* if _ipairs.empty() and _opairs.empty(): # <<<<<<<<<<<<<<
__pyx_L14_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2491
+ /* "pywrapfst.pyx":2493
* _opairs.push_back(fst.LabelPair(before, after))
* if _ipairs.empty() and _opairs.empty():
* raise FstArgError("No relabeling pairs specified") # <<<<<<<<<<<<<<
* fst.Relabel(self._mfst.get(), _ipairs, _opairs)
* self._check_mutating_imethod()
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2491, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
}
__pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_u_No_relabeling_pairs_specified) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_No_relabeling_pairs_specified);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2491, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 2491, __pyx_L1_error)
+ __PYX_ERR(0, 2493, __pyx_L1_error)
- /* "pywrapfst.pyx":2490
+ /* "pywrapfst.pyx":2492
* for (before, after) in opairs:
* _opairs.push_back(fst.LabelPair(before, after))
* if _ipairs.empty() and _opairs.empty(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2492
+ /* "pywrapfst.pyx":2494
* if _ipairs.empty() and _opairs.empty():
* raise FstArgError("No relabeling pairs specified")
* fst.Relabel(self._mfst.get(), _ipairs, _opairs) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2492, __pyx_L1_error)
+ __PYX_ERR(0, 2494, __pyx_L1_error)
}
fst::script::Relabel(__pyx_v_self->_mfst.get(), __pyx_v__ipairs, __pyx_v__opairs);
- /* "pywrapfst.pyx":2493
+ /* "pywrapfst.pyx":2495
* raise FstArgError("No relabeling pairs specified")
* fst.Relabel(self._mfst.get(), _ipairs, _opairs)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2493, __pyx_L1_error)
+ __PYX_ERR(0, 2495, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2493, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2495, __pyx_L1_error)
- /* "pywrapfst.pyx":2481
+ /* "pywrapfst.pyx":2483
* return self
*
* cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2495
+/* "pywrapfst.pyx":2497
* 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, 2495, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_pairs") < 0)) __PYX_ERR(0, 2497, __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, 2495, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("relabel_pairs", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2497, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("relabel_pairs", 0);
- /* "pywrapfst.pyx":2515
+ /* "pywrapfst.pyx":2517
* FstArgError: No relabeling pairs specified.
* """
* self._relabel_pairs(ipairs, opairs) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_relabel_pairs");
- __PYX_ERR(0, 2515, __pyx_L1_error)
+ __PYX_ERR(0, 2517, __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, 2515, __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, 2517, __pyx_L1_error)
- /* "pywrapfst.pyx":2516
+ /* "pywrapfst.pyx":2518
* """
* self._relabel_pairs(ipairs, opairs)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2495
+ /* "pywrapfst.pyx":2497
* self._check_mutating_imethod()
*
* def relabel_pairs(self, ipairs=None, opairs=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2518
+/* "pywrapfst.pyx":2520
* return self
*
* cdef void _relabel_tables(self, # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_10MutableFst__relabel_tables(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_tables *__pyx_optional_args) {
- /* "pywrapfst.pyx":2519
+ /* "pywrapfst.pyx":2521
*
* cdef void _relabel_tables(self,
* SymbolTableView old_isymbols=None, # <<<<<<<<<<<<<<
*/
struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":2520
+ /* "pywrapfst.pyx":2522
* cdef void _relabel_tables(self,
* SymbolTableView old_isymbols=None,
* SymbolTableView new_isymbols=None, # <<<<<<<<<<<<<<
struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
PyObject *__pyx_v_unknown_isymbol = ((PyObject *)__pyx_kp_u__11);
- /* "pywrapfst.pyx":2522
+ /* "pywrapfst.pyx":2524
* SymbolTableView new_isymbols=None,
* unknown_isymbol="",
* bool attach_new_isymbols=True, # <<<<<<<<<<<<<<
*/
bool __pyx_v_attach_new_isymbols = ((bool)1);
- /* "pywrapfst.pyx":2523
+ /* "pywrapfst.pyx":2525
* unknown_isymbol="",
* bool attach_new_isymbols=True,
* SymbolTableView old_osymbols=None, # <<<<<<<<<<<<<<
*/
struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":2524
+ /* "pywrapfst.pyx":2526
* bool attach_new_isymbols=True,
* SymbolTableView old_osymbols=None,
* SymbolTableView new_osymbols=None, # <<<<<<<<<<<<<<
struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
PyObject *__pyx_v_unknown_osymbol = ((PyObject *)__pyx_kp_u__11);
- /* "pywrapfst.pyx":2526
+ /* "pywrapfst.pyx":2528
* SymbolTableView new_osymbols=None,
* unknown_osymbol="",
* bool attach_new_osymbols=True) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2527
+ /* "pywrapfst.pyx":2529
* unknown_osymbol="",
* bool attach_new_osymbols=True) except *:
* if new_isymbols is None and new_osymbols is None: # <<<<<<<<<<<<<<
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2528
+ /* "pywrapfst.pyx":2530
* bool attach_new_osymbols=True) except *:
* if new_isymbols is None and new_osymbols is None:
* raise FstArgError("No new SymbolTables specified") # <<<<<<<<<<<<<<
* cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
* if old_isymbols is not None:
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2528, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_u_No_new_SymbolTables_specified) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_No_new_SymbolTables_specified);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2528, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 2528, __pyx_L1_error)
+ __PYX_ERR(0, 2530, __pyx_L1_error)
- /* "pywrapfst.pyx":2527
+ /* "pywrapfst.pyx":2529
* unknown_osymbol="",
* bool attach_new_osymbols=True) except *:
* if new_isymbols is None and new_osymbols is None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2529
+ /* "pywrapfst.pyx":2531
* if new_isymbols is None and new_osymbols is None:
* raise FstArgError("No new SymbolTables specified")
* cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2529, __pyx_L1_error)
+ __PYX_ERR(0, 2531, __pyx_L1_error)
}
__pyx_v__old_isymbols = __pyx_v_self->__pyx_base._fst.get()->InputSymbols();
- /* "pywrapfst.pyx":2530
+ /* "pywrapfst.pyx":2532
* raise FstArgError("No new SymbolTables specified")
* cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
* if old_isymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2531
+ /* "pywrapfst.pyx":2533
* cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
* if old_isymbols is not None:
* _old_isymbols = old_isymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_old_isymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 2531, __pyx_L1_error)
+ __PYX_ERR(0, 2533, __pyx_L1_error)
}
- __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_old_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_old_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2531, __pyx_L1_error)
+ __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_old_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_old_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2533, __pyx_L1_error)
__pyx_v__old_isymbols = __pyx_t_7;
- /* "pywrapfst.pyx":2530
+ /* "pywrapfst.pyx":2532
* raise FstArgError("No new SymbolTables specified")
* cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
* if old_isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2532
+ /* "pywrapfst.pyx":2534
* if old_isymbols is not None:
* _old_isymbols = old_isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2532, __pyx_L1_error)
+ __PYX_ERR(0, 2534, __pyx_L1_error)
}
__pyx_v__old_osymbols = __pyx_v_self->__pyx_base._fst.get()->OutputSymbols();
- /* "pywrapfst.pyx":2533
+ /* "pywrapfst.pyx":2535
* _old_isymbols = old_isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
* if old_osymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2534
+ /* "pywrapfst.pyx":2536
* cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
* if old_osymbols is not None:
* _old_osymbols = old_osymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_old_osymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 2534, __pyx_L1_error)
+ __PYX_ERR(0, 2536, __pyx_L1_error)
}
- __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_old_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_old_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2534, __pyx_L1_error)
+ __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_old_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_old_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2536, __pyx_L1_error)
__pyx_v__old_osymbols = __pyx_t_7;
- /* "pywrapfst.pyx":2533
+ /* "pywrapfst.pyx":2535
* _old_isymbols = old_isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
* if old_osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2535
+ /* "pywrapfst.pyx":2537
* if old_osymbols is not None:
* _old_osymbols = old_osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_new_isymbols = NULL # <<<<<<<<<<<<<<
*/
__pyx_v__new_isymbols = NULL;
- /* "pywrapfst.pyx":2536
+ /* "pywrapfst.pyx":2538
* _old_osymbols = old_osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_new_isymbols = NULL
* if new_isymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2537
+ /* "pywrapfst.pyx":2539
* cdef const fst.SymbolTable *_new_isymbols = NULL
* if new_isymbols is not None:
* _new_isymbols = new_isymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_new_isymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 2537, __pyx_L1_error)
+ __PYX_ERR(0, 2539, __pyx_L1_error)
}
- __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_new_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_new_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2537, __pyx_L1_error)
+ __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_new_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_new_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2539, __pyx_L1_error)
__pyx_v__new_isymbols = __pyx_t_7;
- /* "pywrapfst.pyx":2536
+ /* "pywrapfst.pyx":2538
* _old_osymbols = old_osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_new_isymbols = NULL
* if new_isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2538
+ /* "pywrapfst.pyx":2540
* if new_isymbols is not None:
* _new_isymbols = new_isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_new_osymbols = NULL # <<<<<<<<<<<<<<
*/
__pyx_v__new_osymbols = NULL;
- /* "pywrapfst.pyx":2539
+ /* "pywrapfst.pyx":2541
* _new_isymbols = new_isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_new_osymbols = NULL
* if new_osymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2540
+ /* "pywrapfst.pyx":2542
* cdef const fst.SymbolTable *_new_osymbols = NULL
* if new_osymbols is not None:
* _new_osymbols = new_osymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_new_osymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 2540, __pyx_L1_error)
+ __PYX_ERR(0, 2542, __pyx_L1_error)
}
- __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_new_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_new_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2540, __pyx_L1_error)
+ __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_new_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_new_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2542, __pyx_L1_error)
__pyx_v__new_osymbols = __pyx_t_7;
- /* "pywrapfst.pyx":2539
+ /* "pywrapfst.pyx":2541
* _new_isymbols = new_isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_new_osymbols = NULL
* if new_osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2541
+ /* "pywrapfst.pyx":2543
* if new_osymbols is not None:
* _new_osymbols = new_osymbols._raw_ptr_or_raise()
* fst.Relabel(self._mfst.get(), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2541, __pyx_L1_error)
+ __PYX_ERR(0, 2543, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2544
+ /* "pywrapfst.pyx":2546
* _old_isymbols,
* _new_isymbols,
* tostring(unknown_isymbol), # <<<<<<<<<<<<<<
* attach_new_isymbols,
* _old_osymbols,
*/
- __pyx_t_8 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_isymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2544, __pyx_L1_error)
+ __pyx_t_8 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_isymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2546, __pyx_L1_error)
- /* "pywrapfst.pyx":2548
+ /* "pywrapfst.pyx":2550
* _old_osymbols,
* _new_osymbols,
* tostring(unknown_osymbol), # <<<<<<<<<<<<<<
* attach_new_osymbols)
* self._check_mutating_imethod()
*/
- __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_osymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2548, __pyx_L1_error)
+ __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_osymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2550, __pyx_L1_error)
- /* "pywrapfst.pyx":2541
+ /* "pywrapfst.pyx":2543
* if new_osymbols is not None:
* _new_osymbols = new_osymbols._raw_ptr_or_raise()
* fst.Relabel(self._mfst.get(), # <<<<<<<<<<<<<<
*/
fst::script::Relabel(__pyx_v_self->_mfst.get(), __pyx_v__old_isymbols, __pyx_v__new_isymbols, __pyx_t_8, __pyx_v_attach_new_isymbols, __pyx_v__old_osymbols, __pyx_v__new_osymbols, __pyx_t_9, __pyx_v_attach_new_osymbols);
- /* "pywrapfst.pyx":2550
+ /* "pywrapfst.pyx":2552
* tostring(unknown_osymbol),
* attach_new_osymbols)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2550, __pyx_L1_error)
+ __PYX_ERR(0, 2552, __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, 2550, __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, 2552, __pyx_L1_error)
- /* "pywrapfst.pyx":2518
+ /* "pywrapfst.pyx":2520
* return self
*
* cdef void _relabel_tables(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2552
+/* "pywrapfst.pyx":2554
* 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":2553
+ /* "pywrapfst.pyx":2555
*
* def relabel_tables(self,
* SymbolTableView old_isymbols=None, # <<<<<<<<<<<<<<
*/
values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":2554
+ /* "pywrapfst.pyx":2556
* def relabel_tables(self,
* SymbolTableView old_isymbols=None,
* SymbolTableView new_isymbols=None, # <<<<<<<<<<<<<<
values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
values[2] = ((PyObject *)__pyx_kp_u__11);
- /* "pywrapfst.pyx":2557
+ /* "pywrapfst.pyx":2559
* unknown_isymbol="",
* bool attach_new_isymbols=True,
* SymbolTableView old_osymbols=None, # <<<<<<<<<<<<<<
*/
values[4] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":2558
+ /* "pywrapfst.pyx":2560
* bool attach_new_isymbols=True,
* SymbolTableView old_osymbols=None,
* SymbolTableView new_osymbols=None, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_tables") < 0)) __PYX_ERR(0, 2552, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_tables") < 0)) __PYX_ERR(0, 2554, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__pyx_v_new_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)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, 2556, __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, 2558, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2556
+ /* "pywrapfst.pyx":2558
* SymbolTableView new_isymbols=None,
* unknown_isymbol="",
* bool attach_new_isymbols=True, # <<<<<<<<<<<<<<
__pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)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, 2560, __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, 2562, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2560
+ /* "pywrapfst.pyx":2562
* SymbolTableView new_osymbols=None,
* unknown_osymbol="",
* 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, 2552, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("relabel_tables", 0, 0, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2554, __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_SymbolTableView, 1, "old_isymbols", 0))) __PYX_ERR(0, 2553, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "new_isymbols", 0))) __PYX_ERR(0, 2554, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "old_osymbols", 0))) __PYX_ERR(0, 2557, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "new_osymbols", 0))) __PYX_ERR(0, 2558, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_isymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "old_isymbols", 0))) __PYX_ERR(0, 2555, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "new_isymbols", 0))) __PYX_ERR(0, 2556, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "old_osymbols", 0))) __PYX_ERR(0, 2559, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "new_osymbols", 0))) __PYX_ERR(0, 2560, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_10MutableFst_42relabel_tables(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_old_isymbols, __pyx_v_new_isymbols, __pyx_v_unknown_isymbol, __pyx_v_attach_new_isymbols, __pyx_v_old_osymbols, __pyx_v_new_osymbols, __pyx_v_unknown_osymbol, __pyx_v_attach_new_osymbols);
- /* "pywrapfst.pyx":2552
+ /* "pywrapfst.pyx":2554
* self._check_mutating_imethod()
*
* def relabel_tables(self, # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("relabel_tables", 0);
- /* "pywrapfst.pyx":2594
+ /* "pywrapfst.pyx":2596
* FstArgError: No SymbolTable specified.
* """
* self._relabel_tables(old_isymbols, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_relabel_tables");
- __PYX_ERR(0, 2594, __pyx_L1_error)
+ __PYX_ERR(0, 2596, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2601
+ /* "pywrapfst.pyx":2603
* 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, 2594, __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, 2596, __pyx_L1_error)
- /* "pywrapfst.pyx":2602
+ /* "pywrapfst.pyx":2604
* unknown_osymbol,
* attach_new_osymbols)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2552
+ /* "pywrapfst.pyx":2554
* self._check_mutating_imethod()
*
* def relabel_tables(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2604
+/* "pywrapfst.pyx":2606
* return self
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_reserve_arcs", 0);
- /* "pywrapfst.pyx":2605
+ /* "pywrapfst.pyx":2607
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *:
* if not self._mfst.get().ReserveArcs(state, n): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2605, __pyx_L1_error)
+ __PYX_ERR(0, 2607, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ReserveArcs(__pyx_v_state, __pyx_v_n) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2606
+ /* "pywrapfst.pyx":2608
* cdef void _reserve_arcs(self, int64 state, size_t n) except *:
* if not self._mfst.get().ReserveArcs(state, n):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2608, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2606, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2608, __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, 2606, __pyx_L1_error)
+ __PYX_ERR(0, 2608, __pyx_L1_error)
- /* "pywrapfst.pyx":2605
+ /* "pywrapfst.pyx":2607
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *:
* if not self._mfst.get().ReserveArcs(state, n): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2607
+ /* "pywrapfst.pyx":2609
* if not self._mfst.get().ReserveArcs(state, n):
* raise FstIndexError("State index out of range")
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2607, __pyx_L1_error)
+ __PYX_ERR(0, 2609, __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, 2607, __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, 2609, __pyx_L1_error)
- /* "pywrapfst.pyx":2604
+ /* "pywrapfst.pyx":2606
* return self
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2609
+/* "pywrapfst.pyx":2611
* self._check_mutating_imethod()
*
* def reserve_arcs(self, int64 state, size_t n): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2609, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2611, __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, 2609, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reserve_arcs") < 0)) __PYX_ERR(0, 2611, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2609, __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, 2609, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2611, __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, 2611, __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, 2609, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2611, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.reserve_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reserve_arcs", 0);
- /* "pywrapfst.pyx":2625
+ /* "pywrapfst.pyx":2627
* FstIndexError: State index out of range.
* """
* self._reserve_arcs(state, n) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reserve_arcs");
- __PYX_ERR(0, 2625, __pyx_L1_error)
+ __PYX_ERR(0, 2627, __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, 2625, __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, 2627, __pyx_L1_error)
- /* "pywrapfst.pyx":2626
+ /* "pywrapfst.pyx":2628
* """
* self._reserve_arcs(state, n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2609
+ /* "pywrapfst.pyx":2611
* self._check_mutating_imethod()
*
* def reserve_arcs(self, int64 state, size_t n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2628
+/* "pywrapfst.pyx":2630
* return self
*
* cdef void _reserve_states(self, int64 n): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_reserve_states", 0);
- /* "pywrapfst.pyx":2629
+ /* "pywrapfst.pyx":2631
*
* cdef void _reserve_states(self, int64 n):
* self._mfst.get().ReserveStates(n) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2629, __pyx_L1_error)
+ __PYX_ERR(0, 2631, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->ReserveStates(__pyx_v_n);
- /* "pywrapfst.pyx":2628
+ /* "pywrapfst.pyx":2630
* return self
*
* cdef void _reserve_states(self, int64 n): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2631
+/* "pywrapfst.pyx":2633
* self._mfst.get().ReserveStates(n)
*
* 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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2631, __pyx_L3_error)
+ __pyx_v_n = __Pyx_PyInt_As_int64_t(__pyx_arg_n); if (unlikely((__pyx_v_n == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2633, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reserve_states", 0);
- /* "pywrapfst.pyx":2643
+ /* "pywrapfst.pyx":2645
* self.
* """
* self._reserve_states(n) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reserve_states");
- __PYX_ERR(0, 2643, __pyx_L1_error)
+ __PYX_ERR(0, 2645, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reserve_states(__pyx_v_self, __pyx_v_n);
- /* "pywrapfst.pyx":2644
+ /* "pywrapfst.pyx":2646
* """
* self._reserve_states(n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2631
+ /* "pywrapfst.pyx":2633
* self._mfst.get().ReserveStates(n)
*
* def reserve_states(self, int64 n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2646
+/* "pywrapfst.pyx":2648
* return self
*
* cdef void _reweight(self, potentials, bool to_final=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2647
+ /* "pywrapfst.pyx":2649
*
* cdef void _reweight(self, potentials, bool to_final=False) except *:
* cdef string _weight_type = self.weight_type() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 2647, __pyx_L1_error)
+ __PYX_ERR(0, 2649, __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":2649
+ /* "pywrapfst.pyx":2651
* cdef string _weight_type = self.weight_type()
* cdef vector[fst.WeightClass] _potentials
* for weight in potentials: # <<<<<<<<<<<<<<
- * _potentials.push_back(_get_WeightClass_or_One(_weight_type, weight))
+ * _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
* fst.Reweight(self._mfst.get(), _potentials, fst.GetReweightType(to_final))
*/
if (likely(PyList_CheckExact(__pyx_v_potentials)) || PyTuple_CheckExact(__pyx_v_potentials)) {
__pyx_t_1 = __pyx_v_potentials; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_potentials); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2649, __pyx_L1_error)
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_potentials); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2649, __pyx_L1_error)
+ __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2651, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_3)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2649, __pyx_L1_error)
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2651, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2649, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
} else {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2649, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2651, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2649, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2649, __pyx_L1_error)
+ else __PYX_ERR(0, 2651, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_weight, __pyx_t_4);
__pyx_t_4 = 0;
- /* "pywrapfst.pyx":2650
+ /* "pywrapfst.pyx":2652
* cdef vector[fst.WeightClass] _potentials
* for weight in potentials:
- * _potentials.push_back(_get_WeightClass_or_One(_weight_type, weight)) # <<<<<<<<<<<<<<
+ * _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight)) # <<<<<<<<<<<<<<
* fst.Reweight(self._mfst.get(), _potentials, fst.GetReweightType(to_final))
* self._check_mutating_imethod()
*/
- __pyx_t_5 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_v__weight_type, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2650, __pyx_L1_error)
+ __pyx_t_5 = __pyx_f_9pywrapfst__get_WeightClass_or_one(__pyx_v__weight_type, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2652, __pyx_L1_error)
try {
__pyx_v__potentials.push_back(__pyx_t_5);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2650, __pyx_L1_error)
+ __PYX_ERR(0, 2652, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2649
+ /* "pywrapfst.pyx":2651
* cdef string _weight_type = self.weight_type()
* cdef vector[fst.WeightClass] _potentials
* for weight in potentials: # <<<<<<<<<<<<<<
- * _potentials.push_back(_get_WeightClass_or_One(_weight_type, weight))
+ * _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
* fst.Reweight(self._mfst.get(), _potentials, fst.GetReweightType(to_final))
*/
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2651
+ /* "pywrapfst.pyx":2653
* for weight in potentials:
- * _potentials.push_back(_get_WeightClass_or_One(_weight_type, weight))
+ * _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
* fst.Reweight(self._mfst.get(), _potentials, fst.GetReweightType(to_final)) # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2651, __pyx_L1_error)
+ __PYX_ERR(0, 2653, __pyx_L1_error)
}
fst::script::Reweight(__pyx_v_self->_mfst.get(), __pyx_v__potentials, fst::script::GetReweightType(__pyx_v_to_final));
- /* "pywrapfst.pyx":2652
- * _potentials.push_back(_get_WeightClass_or_One(_weight_type, weight))
+ /* "pywrapfst.pyx":2654
+ * _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
* fst.Reweight(self._mfst.get(), _potentials, fst.GetReweightType(to_final))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2652, __pyx_L1_error)
+ __PYX_ERR(0, 2654, __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, 2652, __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, 2654, __pyx_L1_error)
- /* "pywrapfst.pyx":2646
+ /* "pywrapfst.pyx":2648
* return self
*
* cdef void _reweight(self, potentials, bool to_final=False) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2654
+/* "pywrapfst.pyx":2656
* 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, 2654, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reweight") < 0)) __PYX_ERR(0, 2656, __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, 2654, __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, 2656, __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, 2654, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reweight", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2656, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.reweight", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reweight", 0);
- /* "pywrapfst.pyx":2676
+ /* "pywrapfst.pyx":2678
* self.
* """
* self._reweight(potentials, to_final) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reweight");
- __PYX_ERR(0, 2676, __pyx_L1_error)
+ __PYX_ERR(0, 2678, __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, 2676, __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, 2678, __pyx_L1_error)
- /* "pywrapfst.pyx":2677
+ /* "pywrapfst.pyx":2679
* """
* self._reweight(potentials, to_final)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2654
+ /* "pywrapfst.pyx":2656
* self._check_mutating_imethod()
*
* def reweight(self, potentials, bool to_final=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2679
+/* "pywrapfst.pyx":2681
* return self
*
* cdef void _rmepsilon(self, # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_10MutableFst__rmepsilon(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__rmepsilon *__pyx_optional_args) {
PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":2681
+ /* "pywrapfst.pyx":2683
* cdef void _rmepsilon(self,
* queue_type="auto",
* bool connect=True, # <<<<<<<<<<<<<<
*/
bool __pyx_v_connect = ((bool)1);
- /* "pywrapfst.pyx":2682
+ /* "pywrapfst.pyx":2684
* queue_type="auto",
* bool connect=True,
* weight=None, # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2685
+ /* "pywrapfst.pyx":2687
* int64 nstate=fst.kNoStateId,
* float delta=fst.kShortestDelta) except *:
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(self.weight_type(), # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(), # <<<<<<<<<<<<<<
* weight)
* cdef unique_ptr[fst.RmEpsilonOptions] _opts
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 2685, __pyx_L1_error)
+ __PYX_ERR(0, 2687, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2686
+ /* "pywrapfst.pyx":2688
* float delta=fst.kShortestDelta) except *:
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(self.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
* weight) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.RmEpsilonOptions] _opts
* _opts.reset(
*/
- __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, 2685, __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, 2687, __pyx_L1_error)
__pyx_v__weight = __pyx_t_1;
- /* "pywrapfst.pyx":2689
+ /* "pywrapfst.pyx":2691
* cdef unique_ptr[fst.RmEpsilonOptions] _opts
* _opts.reset(
* new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
* connect,
* _weight,
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2689, __pyx_L1_error)
- __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2689, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2691, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2691, __pyx_L1_error)
- /* "pywrapfst.pyx":2688
+ /* "pywrapfst.pyx":2690
* weight)
* cdef unique_ptr[fst.RmEpsilonOptions] _opts
* _opts.reset( # <<<<<<<<<<<<<<
*/
__pyx_v__opts.reset(new fst::script::RmEpsilonOptions(__pyx_t_3, __pyx_v_connect, __pyx_v__weight, __pyx_v_nstate, __pyx_v_delta));
- /* "pywrapfst.pyx":2694
+ /* "pywrapfst.pyx":2696
* nstate,
* delta))
* fst.RmEpsilon(self._mfst.get(), deref(_opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2694, __pyx_L1_error)
+ __PYX_ERR(0, 2696, __pyx_L1_error)
}
fst::script::RmEpsilon(__pyx_v_self->_mfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":2695
+ /* "pywrapfst.pyx":2697
* delta))
* fst.RmEpsilon(self._mfst.get(), deref(_opts))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2695, __pyx_L1_error)
+ __PYX_ERR(0, 2697, __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, 2695, __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, 2697, __pyx_L1_error)
- /* "pywrapfst.pyx":2679
+ /* "pywrapfst.pyx":2681
* return self
*
* cdef void _rmepsilon(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2697
+/* "pywrapfst.pyx":2699
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
PyObject* values[5] = {0,0,0,0,0};
values[0] = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":2700
+ /* "pywrapfst.pyx":2702
* queue_type="auto",
* bool connect=True,
* weight=None, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 2697, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 2699, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
__pyx_v_queue_type = values[0];
if (values[1]) {
- __pyx_v_connect = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2699, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2701, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2699
+ /* "pywrapfst.pyx":2701
* def rmepsilon(self,
* queue_type="auto",
* bool connect=True, # <<<<<<<<<<<<<<
}
__pyx_v_weight = values[2];
if (values[3]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2701, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2703, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__22;
}
if (values[4]) {
- __pyx_v_delta = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2702, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2704, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__23;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2697, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2699, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_9pywrapfst_10MutableFst_50rmepsilon(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_queue_type, __pyx_v_connect, __pyx_v_weight, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":2697
+ /* "pywrapfst.pyx":2699
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("rmepsilon", 0);
- /* "pywrapfst.pyx":2724
+ /* "pywrapfst.pyx":2726
* self.
* """
* self._rmepsilon(queue_type, connect, weight, nstate, delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_rmepsilon");
- __PYX_ERR(0, 2724, __pyx_L1_error)
+ __PYX_ERR(0, 2726, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 5;
__pyx_t_1.queue_type = __pyx_v_queue_type;
__pyx_t_1.weight = __pyx_v_weight;
__pyx_t_1.nstate = __pyx_v_nstate;
__pyx_t_1.delta = __pyx_v_delta;
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_rmepsilon(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2724, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_rmepsilon(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2726, __pyx_L1_error)
- /* "pywrapfst.pyx":2725
+ /* "pywrapfst.pyx":2727
* """
* self._rmepsilon(queue_type, connect, weight, nstate, delta)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2697
+ /* "pywrapfst.pyx":2699
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2727
+/* "pywrapfst.pyx":2729
* return self
*
* cdef void _set_final(self, int64 state, weight=None) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":2728
+ /* "pywrapfst.pyx":2730
*
* 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 _weight = _get_WeightClass_or_One(self.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2728, __pyx_L1_error)
+ __PYX_ERR(0, 2730, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2729
+ /* "pywrapfst.pyx":2731
* 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 _weight = _get_WeightClass_or_One(self.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
* weight)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2729, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2731, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2729, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2731, __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, 2729, __pyx_L1_error)
+ __PYX_ERR(0, 2731, __pyx_L1_error)
- /* "pywrapfst.pyx":2728
+ /* "pywrapfst.pyx":2730
*
* 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 _weight = _get_WeightClass_or_One(self.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
*/
}
- /* "pywrapfst.pyx":2730
+ /* "pywrapfst.pyx":2732
* if not self._mfst.get().ValidStateId(state):
* raise FstIndexError("State index out of range")
- * cdef fst.WeightClass _weight = _get_WeightClass_or_One(self.weight_type(), # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(), # <<<<<<<<<<<<<<
* weight)
* if not self._mfst.get().SetFinal(state, _weight):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 2730, __pyx_L1_error)
+ __PYX_ERR(0, 2732, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2731
+ /* "pywrapfst.pyx":2733
* raise FstIndexError("State index out of range")
- * cdef fst.WeightClass _weight = _get_WeightClass_or_One(self.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
* weight) # <<<<<<<<<<<<<<
* if not self._mfst.get().SetFinal(state, _weight):
* raise FstOpError("Incompatible or invalid weight")
*/
- __pyx_t_5 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2730, __pyx_L1_error)
+ __pyx_t_5 = __pyx_f_9pywrapfst__get_WeightClass_or_one(((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2732, __pyx_L1_error)
__pyx_v__weight = __pyx_t_5;
- /* "pywrapfst.pyx":2732
- * cdef fst.WeightClass _weight = _get_WeightClass_or_One(self.weight_type(),
+ /* "pywrapfst.pyx":2734
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
* weight)
* if not self._mfst.get().SetFinal(state, _weight): # <<<<<<<<<<<<<<
* raise FstOpError("Incompatible or invalid weight")
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2732, __pyx_L1_error)
+ __PYX_ERR(0, 2734, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetFinal(__pyx_v_state, __pyx_v__weight) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2733
+ /* "pywrapfst.pyx":2735
* weight)
* if not self._mfst.get().SetFinal(state, _weight):
* raise FstOpError("Incompatible or invalid weight") # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2733, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2735, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Incompatible_or_invalid_weight) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Incompatible_or_invalid_weight);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2733, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __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, 2733, __pyx_L1_error)
+ __PYX_ERR(0, 2735, __pyx_L1_error)
- /* "pywrapfst.pyx":2732
- * cdef fst.WeightClass _weight = _get_WeightClass_or_One(self.weight_type(),
+ /* "pywrapfst.pyx":2734
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
* weight)
* if not self._mfst.get().SetFinal(state, _weight): # <<<<<<<<<<<<<<
* raise FstOpError("Incompatible or invalid weight")
*/
}
- /* "pywrapfst.pyx":2734
+ /* "pywrapfst.pyx":2736
* if not self._mfst.get().SetFinal(state, _weight):
* raise FstOpError("Incompatible or invalid weight")
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2734, __pyx_L1_error)
+ __PYX_ERR(0, 2736, __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, 2734, __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, 2736, __pyx_L1_error)
- /* "pywrapfst.pyx":2727
+ /* "pywrapfst.pyx":2729
* return self
*
* cdef void _set_final(self, int64 state, weight=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2736
+/* "pywrapfst.pyx":2738
* self._check_mutating_imethod()
*
* def set_final(self, int64 state, weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2736, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2738, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2736, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2738, __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, 2736, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_final", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2738, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.set_final", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_final", 0);
- /* "pywrapfst.pyx":2754
+ /* "pywrapfst.pyx":2756
* FstOpError: Incompatible or invalid weight.
* """
* self._set_final(state, weight) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_final");
- __PYX_ERR(0, 2754, __pyx_L1_error)
+ __PYX_ERR(0, 2756, __pyx_L1_error)
}
__pyx_t_1.__pyx_n = 1;
__pyx_t_1.weight = __pyx_v_weight;
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_final(__pyx_v_self, __pyx_v_state, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2754, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_final(__pyx_v_self, __pyx_v_state, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2756, __pyx_L1_error)
- /* "pywrapfst.pyx":2755
+ /* "pywrapfst.pyx":2757
* """
* self._set_final(state, weight)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2736
+ /* "pywrapfst.pyx":2738
* self._check_mutating_imethod()
*
* def set_final(self, int64 state, weight=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2757
+/* "pywrapfst.pyx":2759
* return self
*
* cdef void _set_input_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_set_input_symbols", 0);
- /* "pywrapfst.pyx":2758
+ /* "pywrapfst.pyx":2760
*
* cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
* if symbols is None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2759
+ /* "pywrapfst.pyx":2761
* cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
* if symbols is None:
* self._mfst.get().SetInputSymbols(NULL) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2759, __pyx_L1_error)
+ __PYX_ERR(0, 2761, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetInputSymbols(NULL);
- /* "pywrapfst.pyx":2760
+ /* "pywrapfst.pyx":2762
* if symbols is None:
* self._mfst.get().SetInputSymbols(NULL)
* return # <<<<<<<<<<<<<<
*/
goto __pyx_L0;
- /* "pywrapfst.pyx":2758
+ /* "pywrapfst.pyx":2760
*
* cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
* if symbols is None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2761
+ /* "pywrapfst.pyx":2763
* self._mfst.get().SetInputSymbols(NULL)
* return
* self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2761, __pyx_L1_error)
+ __PYX_ERR(0, 2763, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 2761, __pyx_L1_error)
+ __PYX_ERR(0, 2763, __pyx_L1_error)
}
- __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2761, __pyx_L1_error)
+ __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2763, __pyx_L1_error)
__pyx_v_self->_mfst.get()->SetInputSymbols(__pyx_t_3);
- /* "pywrapfst.pyx":2757
+ /* "pywrapfst.pyx":2759
* return self
*
* cdef void _set_input_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2763
+/* "pywrapfst.pyx":2765
* self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
*
* def set_input_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_input_symbols (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 2763, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 2765, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_10MutableFst_54set_input_symbols(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_symbols));
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_input_symbols", 0);
- /* "pywrapfst.pyx":2777
+ /* "pywrapfst.pyx":2779
* self.
* """
* self._set_input_symbols(symbols) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_input_symbols");
- __PYX_ERR(0, 2777, __pyx_L1_error)
+ __PYX_ERR(0, 2779, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2777, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2779, __pyx_L1_error)
- /* "pywrapfst.pyx":2778
+ /* "pywrapfst.pyx":2780
* """
* self._set_input_symbols(symbols)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2763
+ /* "pywrapfst.pyx":2765
* self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
*
* def set_input_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2780
+/* "pywrapfst.pyx":2782
* return self
*
* cdef void _set_output_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_set_output_symbols", 0);
- /* "pywrapfst.pyx":2781
+ /* "pywrapfst.pyx":2783
*
* cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
* if symbols is None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2782
+ /* "pywrapfst.pyx":2784
* cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
* if symbols is None:
* self._mfst.get().SetOutputSymbols(NULL) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2782, __pyx_L1_error)
+ __PYX_ERR(0, 2784, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetOutputSymbols(NULL);
- /* "pywrapfst.pyx":2783
+ /* "pywrapfst.pyx":2785
* if symbols is None:
* self._mfst.get().SetOutputSymbols(NULL)
* return # <<<<<<<<<<<<<<
*/
goto __pyx_L0;
- /* "pywrapfst.pyx":2781
+ /* "pywrapfst.pyx":2783
*
* cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
* if symbols is None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2784
+ /* "pywrapfst.pyx":2786
* self._mfst.get().SetOutputSymbols(NULL)
* return
* self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2784, __pyx_L1_error)
+ __PYX_ERR(0, 2786, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 2784, __pyx_L1_error)
+ __PYX_ERR(0, 2786, __pyx_L1_error)
}
- __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2784, __pyx_L1_error)
+ __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2786, __pyx_L1_error)
__pyx_v_self->_mfst.get()->SetOutputSymbols(__pyx_t_3);
- /* "pywrapfst.pyx":2780
+ /* "pywrapfst.pyx":2782
* return self
*
* cdef void _set_output_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2786
+/* "pywrapfst.pyx":2788
* self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
*
* def set_output_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_output_symbols (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 2786, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 2788, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_10MutableFst_56set_output_symbols(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_symbols));
/* function exit code */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_output_symbols", 0);
- /* "pywrapfst.pyx":2800
+ /* "pywrapfst.pyx":2802
* self.
* """
* self._set_output_symbols(symbols) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_output_symbols");
- __PYX_ERR(0, 2800, __pyx_L1_error)
+ __PYX_ERR(0, 2802, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2800, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2802, __pyx_L1_error)
- /* "pywrapfst.pyx":2801
+ /* "pywrapfst.pyx":2803
* """
* self._set_output_symbols(symbols)
* return self # <<<<<<<<<<<<<<
*
- * cdef void _set_properties(self, uint64 props, uint64 mask):
+ * def set_properties(self, props, mask):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2786
+ /* "pywrapfst.pyx":2788
* self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
*
* def set_output_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2803
- * return self
- *
- * cdef void _set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
- * self._mfst.get().SetProperties(props, mask)
- *
- */
-
-static void __pyx_f_9pywrapfst_10MutableFst__set_properties(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, uint64 __pyx_v_props, uint64 __pyx_v_mask) {
- __Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_set_properties", 0);
-
- /* "pywrapfst.pyx":2804
- *
- * cdef void _set_properties(self, uint64 props, uint64 mask):
- * self._mfst.get().SetProperties(props, mask) # <<<<<<<<<<<<<<
- *
- * def set_properties(self, uint64 props, uint64 mask):
- */
- if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2804, __pyx_L1_error)
- }
- __pyx_v_self->_mfst.get()->SetProperties(__pyx_v_props, __pyx_v_mask);
-
- /* "pywrapfst.pyx":2803
+/* "pywrapfst.pyx":2805
* return self
*
- * cdef void _set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
- * self._mfst.get().SetProperties(props, mask)
- *
- */
-
- /* function exit code */
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_WriteUnraisable("pywrapfst.MutableFst._set_properties", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
-}
-
-/* "pywrapfst.pyx":2806
- * self._mfst.get().SetProperties(props, mask)
- *
- * def set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
+ * def set_properties(self, props, mask): # <<<<<<<<<<<<<<
* """
* set_properties(self, props, mask)
*/
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_59set_properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_10MutableFst_58set_properties[] = "\n set_properties(self, props, mask)\n\n Sets the properties bits.\n\n Args:\n props: The properties to be set.\n mask: A mask to be applied to the `props` argument before setting the\n FST's properties.\n\n Returns:\n self.\n ";
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_59set_properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- uint64 __pyx_v_props;
- uint64 __pyx_v_mask;
+ PyObject *__pyx_v_props = 0;
+ PyObject *__pyx_v_mask = 0;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, 1); __PYX_ERR(0, 2806, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, 1); __PYX_ERR(0, 2805, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_properties") < 0)) __PYX_ERR(0, 2806, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_properties") < 0)) __PYX_ERR(0, 2805, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
- __pyx_v_props = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_props == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2806, __pyx_L3_error)
- __pyx_v_mask = __Pyx_PyInt_As_uint64_t(values[1]); if (unlikely((__pyx_v_mask == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2806, __pyx_L3_error)
+ __pyx_v_props = values[0];
+ __pyx_v_mask = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2806, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2805, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.set_properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_10MutableFst_58set_properties(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, uint64 __pyx_v_props, uint64 __pyx_v_mask) {
+static PyObject *__pyx_pf_9pywrapfst_10MutableFst_58set_properties(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_props, PyObject *__pyx_v_mask) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ uint64 __pyx_t_2;
+ uint64 __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_properties", 0);
- /* "pywrapfst.pyx":2820
+ /* "pywrapfst.pyx":2819
* self.
* """
- * self._set_properties(props, mask) # <<<<<<<<<<<<<<
+ * self._mfst.get().SetProperties(props.value, mask.value) # <<<<<<<<<<<<<<
* return self
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_properties");
- __PYX_ERR(0, 2820, __pyx_L1_error)
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
+ __PYX_ERR(0, 2819, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_properties(__pyx_v_self, __pyx_v_props, __pyx_v_mask);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_props, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2819, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2819, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2819, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2819, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_self->_mfst.get()->SetProperties(__pyx_t_2, __pyx_t_3);
- /* "pywrapfst.pyx":2821
+ /* "pywrapfst.pyx":2820
* """
- * self._set_properties(props, mask)
+ * self._mfst.get().SetProperties(props.value, mask.value)
* return self # <<<<<<<<<<<<<<
*
* cdef void _set_start(self, int64 state) except *:
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2806
- * self._mfst.get().SetProperties(props, mask)
+ /* "pywrapfst.pyx":2805
+ * return self
*
- * def set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
+ * def set_properties(self, props, mask): # <<<<<<<<<<<<<<
* """
* set_properties(self, props, mask)
*/
/* function exit code */
__pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("pywrapfst.MutableFst.set_properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":2823
+/* "pywrapfst.pyx":2822
* return self
*
* cdef void _set_start(self, int64 state) except *: # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_set_start", 0);
- /* "pywrapfst.pyx":2824
+ /* "pywrapfst.pyx":2823
*
* cdef void _set_start(self, int64 state) except *:
* if not self._mfst.get().SetStart(state): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2824, __pyx_L1_error)
+ __PYX_ERR(0, 2823, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetStart(__pyx_v_state) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2825
+ /* "pywrapfst.pyx":2824
* cdef void _set_start(self, int64 state) except *:
* if not self._mfst.get().SetStart(state):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
*
* def set_start(self, int64 state):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2825, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2824, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2825, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2824, __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, 2825, __pyx_L1_error)
+ __PYX_ERR(0, 2824, __pyx_L1_error)
- /* "pywrapfst.pyx":2824
+ /* "pywrapfst.pyx":2823
*
* cdef void _set_start(self, int64 state) except *:
* if not self._mfst.get().SetStart(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2823
+ /* "pywrapfst.pyx":2822
* return self
*
* cdef void _set_start(self, int64 state) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2827
+/* "pywrapfst.pyx":2826
* raise FstIndexError("State index out of range")
*
* def set_start(self, int64 state): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_start (wrapper)", 0);
assert(__pyx_arg_state); {
- __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2827, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2826, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_start", 0);
- /* "pywrapfst.pyx":2842
+ /* "pywrapfst.pyx":2841
* FstIndexError: State index out of range.
* """
* self._set_start(state) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_start");
- __PYX_ERR(0, 2842, __pyx_L1_error)
+ __PYX_ERR(0, 2841, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_start(__pyx_v_self, __pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2842, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_start(__pyx_v_self, __pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2841, __pyx_L1_error)
- /* "pywrapfst.pyx":2843
+ /* "pywrapfst.pyx":2842
* """
* self._set_start(state)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2827
+ /* "pywrapfst.pyx":2826
* raise FstIndexError("State index out of range")
*
* def set_start(self, int64 state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2845
+/* "pywrapfst.pyx":2844
* return self
*
* cdef void _topsort(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_topsort", 0);
- /* "pywrapfst.pyx":2847
+ /* "pywrapfst.pyx":2846
* cdef void _topsort(self):
* # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
* if not fst.TopSort(self._mfst.get()): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2847, __pyx_L1_error)
+ __PYX_ERR(0, 2846, __pyx_L1_error)
}
__pyx_t_1 = ((!(fst::script::TopSort(__pyx_v_self->_mfst.get()) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2848
+ /* "pywrapfst.pyx":2847
* # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
* if not fst.TopSort(self._mfst.get()):
* logging.warning("Cannot topsort cyclic FST") # <<<<<<<<<<<<<<
*
* def topsort(self):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logging); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2848, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logging); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2847, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warning); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2848, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warning); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2847, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
}
__pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_u_Cannot_topsort_cyclic_FST) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Cannot_topsort_cyclic_FST);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2848, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2847, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2847
+ /* "pywrapfst.pyx":2846
* cdef void _topsort(self):
* # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
* if not fst.TopSort(self._mfst.get()): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2845
+ /* "pywrapfst.pyx":2844
* return self
*
* cdef void _topsort(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2850
+/* "pywrapfst.pyx":2849
* logging.warning("Cannot topsort cyclic FST")
*
* def topsort(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("topsort", 0);
- /* "pywrapfst.pyx":2863
+ /* "pywrapfst.pyx":2862
* self.
* """
* self._topsort() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_topsort");
- __PYX_ERR(0, 2863, __pyx_L1_error)
+ __PYX_ERR(0, 2862, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_topsort(__pyx_v_self);
- /* "pywrapfst.pyx":2864
+ /* "pywrapfst.pyx":2863
* """
* self._topsort()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2850
+ /* "pywrapfst.pyx":2849
* logging.warning("Cannot topsort cyclic FST")
*
* def topsort(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2866
+/* "pywrapfst.pyx":2865
* return self
*
* def union(self, *fsts2): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("union", 0);
- /* "pywrapfst.pyx":2884
+ /* "pywrapfst.pyx":2883
* cdef Fst _fst2
* cdef vector[const_FstClass_ptr] _fsts2
* for _fst2 in fsts2: # <<<<<<<<<<<<<<
for (;;) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2884, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2883, __pyx_L1_error)
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2884, __pyx_L1_error)
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2883, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 2884, __pyx_L1_error)
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 2883, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v__fst2, ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_3));
__pyx_t_3 = 0;
- /* "pywrapfst.pyx":2885
+ /* "pywrapfst.pyx":2884
* cdef vector[const_FstClass_ptr] _fsts2
* for _fst2 in fsts2:
* _fsts2.push_back(_fst2._fst.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__fst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2885, __pyx_L1_error)
+ __PYX_ERR(0, 2884, __pyx_L1_error)
}
try {
__pyx_v__fsts2.push_back(__pyx_v__fst2->_fst.get());
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2885, __pyx_L1_error)
+ __PYX_ERR(0, 2884, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2884
+ /* "pywrapfst.pyx":2883
* cdef Fst _fst2
* cdef vector[const_FstClass_ptr] _fsts2
* for _fst2 in fsts2: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2886
+ /* "pywrapfst.pyx":2885
* for _fst2 in fsts2:
* _fsts2.push_back(_fst2._fst.get())
* fst.Union(self._mfst.get(), _fsts2) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2886, __pyx_L1_error)
+ __PYX_ERR(0, 2885, __pyx_L1_error)
}
fst::script::Union(__pyx_v_self->_mfst.get(), __pyx_v__fsts2);
- /* "pywrapfst.pyx":2887
+ /* "pywrapfst.pyx":2886
* _fsts2.push_back(_fst2._fst.get())
* fst.Union(self._mfst.get(), _fsts2)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2887, __pyx_L1_error)
+ __PYX_ERR(0, 2886, __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, 2887, __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, 2886, __pyx_L1_error)
- /* "pywrapfst.pyx":2888
+ /* "pywrapfst.pyx":2887
* fst.Union(self._mfst.get(), _fsts2)
* self._check_mutating_imethod()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2866
+ /* "pywrapfst.pyx":2865
* return self
*
* def union(self, *fsts2): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2904
+/* "pywrapfst.pyx":2903
* """
*
* def __init__(self, arc_type="standard"): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2904, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2903, __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, 2904, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2903, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.VectorFst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":2906
+ /* "pywrapfst.pyx":2905
* def __init__(self, arc_type="standard"):
* cdef unique_ptr[fst.MutableFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(tostring(arc_type))) # <<<<<<<<<<<<<<
* if _tfst.get().Properties(fst.kError, True) == fst.kError:
* raise FstOpError(f"Unknown arc type: {arc_type!r}")
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2906, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2905, __pyx_L1_error)
__pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));
- /* "pywrapfst.pyx":2907
+ /* "pywrapfst.pyx":2906
* cdef unique_ptr[fst.MutableFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
* if _tfst.get().Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v__tfst.get()->Properties(fst::kError, 1) == fst::kError) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":2908
+ /* "pywrapfst.pyx":2907
* _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
* if _tfst.get().Properties(fst.kError, True) == fst.kError:
* raise FstOpError(f"Unknown arc type: {arc_type!r}") # <<<<<<<<<<<<<<
* self._fst.reset(_tfst.release())
* self._mfst = static_pointer_cast[fst.MutableFstClass,
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2908, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_arc_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2908, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_arc_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_arc_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2908, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_arc_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2908, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2908, __pyx_L1_error)
+ __PYX_ERR(0, 2907, __pyx_L1_error)
- /* "pywrapfst.pyx":2907
+ /* "pywrapfst.pyx":2906
* cdef unique_ptr[fst.MutableFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
* if _tfst.get().Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2909
+ /* "pywrapfst.pyx":2908
* if _tfst.get().Properties(fst.kError, True) == fst.kError:
* raise FstOpError(f"Unknown arc type: {arc_type!r}")
* self._fst.reset(_tfst.release()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2909, __pyx_L1_error)
+ __PYX_ERR(0, 2908, __pyx_L1_error)
}
__pyx_v_self->__pyx_base.__pyx_base._fst.reset(__pyx_v__tfst.release());
- /* "pywrapfst.pyx":2911
+ /* "pywrapfst.pyx":2910
* self._fst.reset(_tfst.release())
* self._mfst = static_pointer_cast[fst.MutableFstClass,
* fst.FstClass](self._fst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2911, __pyx_L1_error)
+ __PYX_ERR(0, 2910, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2910
+ /* "pywrapfst.pyx":2909
* raise FstOpError(f"Unknown arc type: {arc_type!r}")
* self._fst.reset(_tfst.release())
* self._mfst = static_pointer_cast[fst.MutableFstClass, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2910, __pyx_L1_error)
+ __PYX_ERR(0, 2909, __pyx_L1_error)
}
__pyx_v_self->__pyx_base._mfst = std::static_pointer_cast<fst::script::MutableFstClass,fst::script::FstClass>(__pyx_v_self->__pyx_base.__pyx_base._fst);
- /* "pywrapfst.pyx":2904
+ /* "pywrapfst.pyx":2903
* """
*
* def __init__(self, arc_type="standard"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2930
+/* "pywrapfst.pyx":2929
*
*
* cdef Fst _init_Fst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_Fst", 0);
- /* "pywrapfst.pyx":2931
+ /* "pywrapfst.pyx":2930
*
* cdef Fst _init_Fst(FstClass_ptr tfst):
* if tfst.Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_tfst->Properties(fst::kError, 1) == fst::kError) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2932
+ /* "pywrapfst.pyx":2931
* cdef Fst _init_Fst(FstClass_ptr tfst):
* if tfst.Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed") # <<<<<<<<<<<<<<
* cdef Fst _ofst = Fst.__new__(Fst)
* _ofst._fst.reset(tfst)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2932, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2931, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Operation_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Operation_failed);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2932, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2931, __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, 2932, __pyx_L1_error)
+ __PYX_ERR(0, 2931, __pyx_L1_error)
- /* "pywrapfst.pyx":2931
+ /* "pywrapfst.pyx":2930
*
* cdef Fst _init_Fst(FstClass_ptr tfst):
* if tfst.Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2933
+ /* "pywrapfst.pyx":2932
* if tfst.Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed")
* cdef Fst _ofst = Fst.__new__(Fst) # <<<<<<<<<<<<<<
* _ofst._fst.reset(tfst)
* return _ofst
*/
- __pyx_t_2 = ((PyObject *)__pyx_tp_new_9pywrapfst_Fst(((PyTypeObject *)__pyx_ptype_9pywrapfst_Fst), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2933, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_tp_new_9pywrapfst_Fst(((PyTypeObject *)__pyx_ptype_9pywrapfst_Fst), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2932, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__pyx_v__ofst = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":2934
+ /* "pywrapfst.pyx":2933
* raise FstOpError("Operation failed")
* cdef Fst _ofst = Fst.__new__(Fst)
* _ofst._fst.reset(tfst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2934, __pyx_L1_error)
+ __PYX_ERR(0, 2933, __pyx_L1_error)
}
__pyx_v__ofst->_fst.reset(__pyx_v_tfst);
- /* "pywrapfst.pyx":2935
+ /* "pywrapfst.pyx":2934
* cdef Fst _ofst = Fst.__new__(Fst)
* _ofst._fst.reset(tfst)
* return _ofst # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__ofst;
goto __pyx_L0;
- /* "pywrapfst.pyx":2930
+ /* "pywrapfst.pyx":2929
*
*
* cdef Fst _init_Fst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2938
+/* "pywrapfst.pyx":2937
*
*
* cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_MutableFst", 0);
- /* "pywrapfst.pyx":2939
+ /* "pywrapfst.pyx":2938
*
* cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
* if tfst.Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_tfst->Properties(fst::kError, 1) == fst::kError) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2940
+ /* "pywrapfst.pyx":2939
* cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
* if tfst.Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed") # <<<<<<<<<<<<<<
* cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
* _ofst._fst.reset(tfst)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2940, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2939, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Operation_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Operation_failed);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2940, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2939, __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, 2940, __pyx_L1_error)
+ __PYX_ERR(0, 2939, __pyx_L1_error)
- /* "pywrapfst.pyx":2939
+ /* "pywrapfst.pyx":2938
*
* cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
* if tfst.Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2941
+ /* "pywrapfst.pyx":2940
* if tfst.Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed")
* cdef MutableFst _ofst = MutableFst.__new__(MutableFst) # <<<<<<<<<<<<<<
* _ofst._fst.reset(tfst)
* # Makes a copy of it as the derived type! Cool.
*/
- __pyx_t_2 = ((PyObject *)__pyx_tp_new_9pywrapfst_MutableFst(((PyTypeObject *)__pyx_ptype_9pywrapfst_MutableFst), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2941, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_tp_new_9pywrapfst_MutableFst(((PyTypeObject *)__pyx_ptype_9pywrapfst_MutableFst), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2940, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__pyx_v__ofst = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":2942
+ /* "pywrapfst.pyx":2941
* raise FstOpError("Operation failed")
* cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
* _ofst._fst.reset(tfst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2942, __pyx_L1_error)
+ __PYX_ERR(0, 2941, __pyx_L1_error)
}
__pyx_v__ofst->__pyx_base._fst.reset(__pyx_v_tfst);
- /* "pywrapfst.pyx":2945
+ /* "pywrapfst.pyx":2944
* # Makes a copy of it as the derived type! Cool.
* _ofst._mfst = static_pointer_cast[fst.MutableFstClass,
* fst.FstClass](_ofst._fst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2945, __pyx_L1_error)
+ __PYX_ERR(0, 2944, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2944
+ /* "pywrapfst.pyx":2943
* _ofst._fst.reset(tfst)
* # Makes a copy of it as the derived type! Cool.
* _ofst._mfst = static_pointer_cast[fst.MutableFstClass, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2944, __pyx_L1_error)
+ __PYX_ERR(0, 2943, __pyx_L1_error)
}
__pyx_v__ofst->_mfst = std::static_pointer_cast<fst::script::MutableFstClass,fst::script::FstClass>(__pyx_v__ofst->__pyx_base._fst);
- /* "pywrapfst.pyx":2946
+ /* "pywrapfst.pyx":2945
* _ofst._mfst = static_pointer_cast[fst.MutableFstClass,
* fst.FstClass](_ofst._fst)
* return _ofst # <<<<<<<<<<<<<<
__pyx_r = __pyx_v__ofst;
goto __pyx_L0;
- /* "pywrapfst.pyx":2938
+ /* "pywrapfst.pyx":2937
*
*
* cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2949
+/* "pywrapfst.pyx":2948
*
*
* cdef Fst _init_XFst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_XFst", 0);
- /* "pywrapfst.pyx":2950
+ /* "pywrapfst.pyx":2949
*
* cdef Fst _init_XFst(FstClass_ptr tfst):
* if tfst.Properties(fst.kMutable, True) == fst.kMutable: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v_tfst->Properties(fst::kMutable, 1) == fst::kMutable) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2951
+ /* "pywrapfst.pyx":2950
* cdef Fst _init_XFst(FstClass_ptr tfst):
* if tfst.Properties(fst.kMutable, True) == fst.kMutable:
* return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst)) # <<<<<<<<<<<<<<
* return _init_Fst(tfst)
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(static_cast<__pyx_t_9pywrapfst_MutableFstClass_ptr>(__pyx_v_tfst))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2951, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(static_cast<__pyx_t_9pywrapfst_MutableFstClass_ptr>(__pyx_v_tfst))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2950, __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":2950
+ /* "pywrapfst.pyx":2949
*
* cdef Fst _init_XFst(FstClass_ptr tfst):
* if tfst.Properties(fst.kMutable, True) == fst.kMutable: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2953
+ /* "pywrapfst.pyx":2952
* return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
* else:
* return _init_Fst(tfst) # <<<<<<<<<<<<<<
*/
/*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_Fst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2953, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_Fst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2952, __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":2949
+ /* "pywrapfst.pyx":2948
*
*
* cdef Fst _init_XFst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2956
+/* "pywrapfst.pyx":2955
*
*
* cpdef Fst _read_Fst(source): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_read_Fst", 0);
- /* "pywrapfst.pyx":2958
+ /* "pywrapfst.pyx":2957
* cpdef Fst _read_Fst(source):
* cdef unique_ptr[fst.FstClass] _tfst
* _tfst.reset(fst.FstClass.Read(path_tostring(source))) # <<<<<<<<<<<<<<
* if _tfst.get() == NULL:
* raise FstIOError(f"Read failed: {source!r}")
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2958, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2957, __pyx_L1_error)
__pyx_v__tfst.reset(fst::script::FstClass::Read(__pyx_t_1));
- /* "pywrapfst.pyx":2959
+ /* "pywrapfst.pyx":2958
* cdef unique_ptr[fst.FstClass] _tfst
* _tfst.reset(fst.FstClass.Read(path_tostring(source)))
* if _tfst.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v__tfst.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":2960
+ /* "pywrapfst.pyx":2959
* _tfst.reset(fst.FstClass.Read(path_tostring(source)))
* if _tfst.get() == NULL:
* raise FstIOError(f"Read failed: {source!r}") # <<<<<<<<<<<<<<
* return _init_XFst(_tfst.release())
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2960, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2959, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2960, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2959, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2960, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2959, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2960, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2959, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2960, __pyx_L1_error)
+ __PYX_ERR(0, 2959, __pyx_L1_error)
- /* "pywrapfst.pyx":2959
+ /* "pywrapfst.pyx":2958
* cdef unique_ptr[fst.FstClass] _tfst
* _tfst.reset(fst.FstClass.Read(path_tostring(source)))
* if _tfst.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2961
+ /* "pywrapfst.pyx":2960
* if _tfst.get() == NULL:
* raise FstIOError(f"Read failed: {source!r}")
* return _init_XFst(_tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2961, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2960, __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":2956
+ /* "pywrapfst.pyx":2955
*
*
* cpdef Fst _read_Fst(source): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_read_Fst", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst(__pyx_v_source, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2956, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst(__pyx_v_source, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2955, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2964
+/* "pywrapfst.pyx":2963
*
*
* cpdef Fst _read_Fst_from_string(string state): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_read_Fst_from_string", 0);
- /* "pywrapfst.pyx":2966
+ /* "pywrapfst.pyx":2965
* cpdef Fst _read_Fst_from_string(string state):
* cdef stringstream _sstrm
* _sstrm << state # <<<<<<<<<<<<<<
*/
(void)((__pyx_v__sstrm << __pyx_v_state));
- /* "pywrapfst.pyx":2968
+ /* "pywrapfst.pyx":2967
* _sstrm << state
* cdef unique_ptr[fst.FstClass] _tfst
* _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>")) # <<<<<<<<<<<<<<
*/
__pyx_v__tfst.reset(fst::script::FstClass::Read(__pyx_v__sstrm, __pyx_k_pywrapfst));
- /* "pywrapfst.pyx":2969
+ /* "pywrapfst.pyx":2968
* cdef unique_ptr[fst.FstClass] _tfst
* _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>"))
* if _tfst.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_1 = ((__pyx_v__tfst.get() == NULL) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2970
+ /* "pywrapfst.pyx":2969
* _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>"))
* if _tfst.get() == NULL:
* raise FstIOError("Read from string failed") # <<<<<<<<<<<<<<
* return _init_XFst(_tfst.release())
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2970, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Read_from_string_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Read_from_string_failed);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2970, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2969, __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, 2970, __pyx_L1_error)
+ __PYX_ERR(0, 2969, __pyx_L1_error)
- /* "pywrapfst.pyx":2969
+ /* "pywrapfst.pyx":2968
* cdef unique_ptr[fst.FstClass] _tfst
* _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>"))
* if _tfst.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2971
+ /* "pywrapfst.pyx":2970
* if _tfst.get() == NULL:
* raise FstIOError("Read from string failed")
* return _init_XFst(_tfst.release()) # <<<<<<<<<<<<<<
*
*/
__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, 2971, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2970, __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":2964
+ /* "pywrapfst.pyx":2963
*
*
* cpdef Fst _read_Fst_from_string(string state): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_read_Fst_from_string (wrapper)", 0);
assert(__pyx_arg_state); {
- __pyx_v_state = __pyx_convert_string_from_py_std__in_string(__pyx_arg_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2964, __pyx_L3_error)
+ __pyx_v_state = __pyx_convert_string_from_py_std__in_string(__pyx_arg_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2963, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_read_Fst_from_string", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2964, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2963, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3084
+/* "pywrapfst.pyx":3089
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3085
+ /* "pywrapfst.pyx":3090
*
* def __repr__(self):
* return f"<Arc at 0x{id(self):x}>" # <<<<<<<<<<<<<<
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3085, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3090, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__pyx_t_2 += 10;
__Pyx_GIVEREF(__pyx_kp_u_Arc_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Arc_at_0x);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3085, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3090, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3085, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3090, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3085, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3090, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3084
+ /* "pywrapfst.pyx":3089
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3087
+/* "pywrapfst.pyx":3092
* return f"<Arc at 0x{id(self):x}>"
*
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate): # <<<<<<<<<<<<<<
- * cdef fst.WeightClass _weight = _get_WeightClass_or_One(b"tropical", weight)
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_one(b"tropical", weight)
* self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
*/
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_olabel)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 3087, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 3092, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 3087, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 3092, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nextstate)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 3087, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 3092, __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, 3087, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3092, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3087, __pyx_L3_error)
- __pyx_v_olabel = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_olabel == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3087, __pyx_L3_error)
+ __pyx_v_ilabel = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_ilabel == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3092, __pyx_L3_error)
+ __pyx_v_olabel = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_olabel == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3092, __pyx_L3_error)
__pyx_v_weight = values[2];
- __pyx_v_nextstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nextstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3087, __pyx_L3_error)
+ __pyx_v_nextstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nextstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3092, __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, 3087, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3092, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Arc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":3088
+ /* "pywrapfst.pyx":3093
*
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
- * cdef fst.WeightClass _weight = _get_WeightClass_or_One(b"tropical", weight) # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_one(b"tropical", weight) # <<<<<<<<<<<<<<
* self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
*
*/
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3088, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_one(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3093, __pyx_L1_error)
__pyx_v__weight = __pyx_t_1;
- /* "pywrapfst.pyx":3089
+ /* "pywrapfst.pyx":3094
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
- * cdef fst.WeightClass _weight = _get_WeightClass_or_One(b"tropical", weight)
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_one(b"tropical", weight)
* self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate)) # <<<<<<<<<<<<<<
*
* cpdef Arc copy(self):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 3089, __pyx_L1_error)
+ __PYX_ERR(0, 3094, __pyx_L1_error)
}
__pyx_v_self->_arc.reset(new fst::script::ArcClass(__pyx_v_ilabel, __pyx_v_olabel, __pyx_v__weight, __pyx_v_nextstate));
- /* "pywrapfst.pyx":3087
+ /* "pywrapfst.pyx":3092
* return f"<Arc at 0x{id(self):x}>"
*
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate): # <<<<<<<<<<<<<<
- * cdef fst.WeightClass _weight = _get_WeightClass_or_One(b"tropical", weight)
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_one(b"tropical", weight)
* self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
*/
return __pyx_r;
}
-/* "pywrapfst.pyx":3091
+/* "pywrapfst.pyx":3096
* self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
*
* cpdef Arc copy(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3091, __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, 3096, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_3Arc_5copy)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3091, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3096, __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, 3091, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Arc))))) __PYX_ERR(0, 3096, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3092
+ /* "pywrapfst.pyx":3097
*
* 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, 3092, __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, 3097, __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, 3092, __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, 3097, __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, 3092, __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, 3097, __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, 3092, __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, 3097, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3092, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3097, __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, 3092, __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, 3097, __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":3091
+ /* "pywrapfst.pyx":3096
* self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
*
* cpdef Arc copy(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3091, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Arc_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3096, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3096
+/* "pywrapfst.pyx":3101
* property ilabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":3097
+ /* "pywrapfst.pyx":3102
*
* def __get__(self):
* return deref(self._arc).ilabel # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 3097, __pyx_L1_error)
+ __PYX_ERR(0, 3102, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3097, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3096
+ /* "pywrapfst.pyx":3101
* property ilabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3099
+/* "pywrapfst.pyx":3104
* 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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3099, __pyx_L3_error)
+ __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3104, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":3100
+ /* "pywrapfst.pyx":3105
*
* def __set__(self, int64 value):
* deref(self._arc).ilabel = value # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 3100, __pyx_L1_error)
+ __PYX_ERR(0, 3105, __pyx_L1_error)
}
(*__pyx_v_self->_arc).ilabel = __pyx_v_value;
- /* "pywrapfst.pyx":3099
+ /* "pywrapfst.pyx":3104
* return deref(self._arc).ilabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3104
+/* "pywrapfst.pyx":3109
* property olabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":3105
+ /* "pywrapfst.pyx":3110
*
* def __get__(self):
* return deref(self._arc).olabel # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 3105, __pyx_L1_error)
+ __PYX_ERR(0, 3110, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3105, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3110, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3104
+ /* "pywrapfst.pyx":3109
* property olabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3107
+/* "pywrapfst.pyx":3112
* 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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3107, __pyx_L3_error)
+ __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3112, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":3108
+ /* "pywrapfst.pyx":3113
*
* def __set__(self, int64 value):
* deref(self._arc).olabel = value # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 3108, __pyx_L1_error)
+ __PYX_ERR(0, 3113, __pyx_L1_error)
}
(*__pyx_v_self->_arc).olabel = __pyx_v_value;
- /* "pywrapfst.pyx":3107
+ /* "pywrapfst.pyx":3112
* return deref(self._arc).olabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3112
+/* "pywrapfst.pyx":3117
* property weight:
*
* def __get__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":3113
+ /* "pywrapfst.pyx":3118
*
* def __get__(self):
* cdef Weight _weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* _weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
* return _weight
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3113, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3118, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":3114
+ /* "pywrapfst.pyx":3119
* def __get__(self):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(deref(self._arc).weight)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 3114, __pyx_L1_error)
+ __PYX_ERR(0, 3119, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 3114, __pyx_L1_error)
+ __PYX_ERR(0, 3119, __pyx_L1_error)
}
__pyx_v__weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_arc).weight));
- /* "pywrapfst.pyx":3115
+ /* "pywrapfst.pyx":3120
* 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":3112
+ /* "pywrapfst.pyx":3117
* property weight:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3117
+/* "pywrapfst.pyx":3122
* return _weight
*
* def __set__(self, weight): # <<<<<<<<<<<<<<
- * deref(self._arc).weight = _get_WeightClass_or_One(b"tropical", weight)
+ * deref(self._arc).weight = _get_WeightClass_or_one(b"tropical", weight)
*
*/
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":3118
+ /* "pywrapfst.pyx":3123
*
* def __set__(self, weight):
- * deref(self._arc).weight = _get_WeightClass_or_One(b"tropical", weight) # <<<<<<<<<<<<<<
+ * deref(self._arc).weight = _get_WeightClass_or_one(b"tropical", weight) # <<<<<<<<<<<<<<
*
* property nextstate:
*/
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3118, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_one(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3123, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 3118, __pyx_L1_error)
+ __PYX_ERR(0, 3123, __pyx_L1_error)
}
(*__pyx_v_self->_arc).weight = __pyx_t_1;
- /* "pywrapfst.pyx":3117
+ /* "pywrapfst.pyx":3122
* return _weight
*
* def __set__(self, weight): # <<<<<<<<<<<<<<
- * deref(self._arc).weight = _get_WeightClass_or_One(b"tropical", weight)
+ * deref(self._arc).weight = _get_WeightClass_or_one(b"tropical", weight)
*
*/
return __pyx_r;
}
-/* "pywrapfst.pyx":3122
+/* "pywrapfst.pyx":3127
* property nextstate:
*
* def __get__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "pywrapfst.pyx":3123
+ /* "pywrapfst.pyx":3128
*
* def __get__(self):
* return deref(self._arc).nextstate # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 3123, __pyx_L1_error)
+ __PYX_ERR(0, 3128, __pyx_L1_error)
}
- __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3123, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3122
+ /* "pywrapfst.pyx":3127
* property nextstate:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3125
+/* "pywrapfst.pyx":3130
* 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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3125, __pyx_L3_error)
+ __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3130, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":3126
+ /* "pywrapfst.pyx":3131
*
* def __set__(self, int64 value):
* deref(self._arc).nextstate = value # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 3126, __pyx_L1_error)
+ __PYX_ERR(0, 3131, __pyx_L1_error)
}
(*__pyx_v_self->_arc).nextstate = __pyx_v_value;
- /* "pywrapfst.pyx":3125
+ /* "pywrapfst.pyx":3130
* return deref(self._arc).nextstate
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3129
+/* "pywrapfst.pyx":3134
*
*
* cdef Arc _init_Arc(const fst.ArcClass &arc): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_Arc", 0);
- /* "pywrapfst.pyx":3130
+ /* "pywrapfst.pyx":3135
*
* cdef Arc _init_Arc(const fst.ArcClass &arc):
* cdef Weight _weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
* _weight._weight.reset(new fst.WeightClass(arc.weight))
* return Arc(arc.ilabel, arc.olabel, _weight, arc.nextstate)
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3130, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3135, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":3131
+ /* "pywrapfst.pyx":3136
* cdef Arc _init_Arc(const fst.ArcClass &arc):
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(arc.weight)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 3131, __pyx_L1_error)
+ __PYX_ERR(0, 3136, __pyx_L1_error)
}
__pyx_v__weight->_weight.reset(new fst::script::WeightClass(__pyx_v_arc.weight));
- /* "pywrapfst.pyx":3132
+ /* "pywrapfst.pyx":3137
* cdef Weight _weight = Weight.__new__(Weight)
* _weight._weight.reset(new fst.WeightClass(arc.weight))
* return Arc(arc.ilabel, arc.olabel, _weight, arc.nextstate) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3132, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.olabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3132, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.olabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.nextstate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3132, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.nextstate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3132, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3137, __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, 3132, __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, 3137, __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":3129
+ /* "pywrapfst.pyx":3134
*
*
* cdef Arc _init_Arc(const fst.ArcClass &arc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3143
+/* "pywrapfst.pyx":3148
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3144
+ /* "pywrapfst.pyx":3149
*
* def __repr__(self):
* return f"<ArcIterator at 0x{id(self):x}>" # <<<<<<<<<<<<<<
* def __init__(self, Fst ifst, int64 state):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3144, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__pyx_t_2 += 18;
__Pyx_GIVEREF(__pyx_kp_u_ArcIterator_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_ArcIterator_at_0x);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3144, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3144, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3144, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3143
+ /* "pywrapfst.pyx":3148
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3146
+/* "pywrapfst.pyx":3151
* return f"<ArcIterator at 0x{id(self):x}>"
*
* def __init__(self, Fst ifst, int64 state): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3146, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3151, __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, 3146, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3151, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3146, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3151, __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, 3146, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3151, __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, 3146, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3151, __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 */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":3147
+ /* "pywrapfst.pyx":3152
*
* def __init__(self, Fst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3147, __pyx_L1_error)
+ __PYX_ERR(0, 3152, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_ifst->_fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":3148
+ /* "pywrapfst.pyx":3153
* def __init__(self, Fst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._fst = ifst._fst
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3148, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3148, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3153, __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, 3148, __pyx_L1_error)
+ __PYX_ERR(0, 3153, __pyx_L1_error)
- /* "pywrapfst.pyx":3147
+ /* "pywrapfst.pyx":3152
*
* def __init__(self, Fst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3150
+ /* "pywrapfst.pyx":3155
* raise FstIndexError("State index out of range")
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._fst = ifst._fst # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3150, __pyx_L1_error)
+ __PYX_ERR(0, 3155, __pyx_L1_error)
}
__pyx_t_5 = __pyx_v_ifst->_fst;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3150, __pyx_L1_error)
+ __PYX_ERR(0, 3155, __pyx_L1_error)
}
__pyx_v_self->_fst = __pyx_t_5;
- /* "pywrapfst.pyx":3151
+ /* "pywrapfst.pyx":3156
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._fst = ifst._fst
* self._aiter.reset(new fst.ArcIteratorClass(deref(self._fst), state)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3151, __pyx_L1_error)
+ __PYX_ERR(0, 3156, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3151, __pyx_L1_error)
+ __PYX_ERR(0, 3156, __pyx_L1_error)
}
__pyx_v_self->_aiter.reset(new fst::script::ArcIteratorClass((*__pyx_v_self->_fst), __pyx_v_state));
- /* "pywrapfst.pyx":3146
+ /* "pywrapfst.pyx":3151
* return f"<ArcIterator at 0x{id(self):x}>"
*
* def __init__(self, Fst ifst, int64 state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3154
+/* "pywrapfst.pyx":3159
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":3155
+ /* "pywrapfst.pyx":3160
* # 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":3154
+ /* "pywrapfst.pyx":3159
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3158
+/* "pywrapfst.pyx":3163
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "pywrapfst.pyx":3159
+ /* "pywrapfst.pyx":3164
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
- __PYX_ERR(0, 3159, __pyx_L1_error)
+ __PYX_ERR(0, 3164, __pyx_L1_error)
}
__pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":3160
+ /* "pywrapfst.pyx":3165
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* self.next()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 3160, __pyx_L1_error)
+ __PYX_ERR(0, 3165, __pyx_L1_error)
- /* "pywrapfst.pyx":3159
+ /* "pywrapfst.pyx":3164
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3161
+ /* "pywrapfst.pyx":3166
* if self.done():
* raise StopIteration
* result = self.value() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "value");
- __PYX_ERR(0, 3161, __pyx_L1_error)
+ __PYX_ERR(0, 3166, __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, 3161, __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, 3166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":3162
+ /* "pywrapfst.pyx":3167
* raise StopIteration
* result = self.value()
* self.next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
- __PYX_ERR(0, 3162, __pyx_L1_error)
+ __PYX_ERR(0, 3167, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3163
+ /* "pywrapfst.pyx":3168
* result = self.value()
* self.next()
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":3158
+ /* "pywrapfst.pyx":3163
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3165
+/* "pywrapfst.pyx":3170
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3165, __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, 3170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_9done)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3165, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3170, __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, 3165, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3170, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3174
+ /* "pywrapfst.pyx":3179
* True if the iterator is exhausted, False otherwise.
* """
* return self._aiter.get().Done() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3174, __pyx_L1_error)
+ __PYX_ERR(0, 3179, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3165
+ /* "pywrapfst.pyx":3170
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3165, __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, 3170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3176
+/* "pywrapfst.pyx":3181
* return self._aiter.get().Done()
*
* cpdef uint8 flags(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3176, __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, 3181, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_11flags)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3176, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3181, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3176, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3181, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3185
+ /* "pywrapfst.pyx":3190
* The current iterator behavioral flags as an integer.
* """
* return self._aiter.get().Flags() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3185, __pyx_L1_error)
+ __PYX_ERR(0, 3190, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":3176
+ /* "pywrapfst.pyx":3181
* return self._aiter.get().Done()
*
* cpdef uint8 flags(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("flags", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_f_9pywrapfst_11ArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3176, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_f_9pywrapfst_11ArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3181, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3187
+/* "pywrapfst.pyx":3192
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3187, __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, 3192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_13next)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3187, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3193
+ /* "pywrapfst.pyx":3198
* Advances the iterator.
* """
* self._aiter.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3193, __pyx_L1_error)
+ __PYX_ERR(0, 3198, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Next();
- /* "pywrapfst.pyx":3187
+ /* "pywrapfst.pyx":3192
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3187, __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, 3192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3195
+/* "pywrapfst.pyx":3200
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3195, __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, 3200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_15position)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3195, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3195, __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, 3200, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3204
+ /* "pywrapfst.pyx":3209
* The iterator's position, expressed as an integer.
* """
* return self._aiter.get().Position() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3204, __pyx_L1_error)
+ __PYX_ERR(0, 3209, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Position();
goto __pyx_L0;
- /* "pywrapfst.pyx":3195
+ /* "pywrapfst.pyx":3200
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3195, __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, 3200, __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
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3206, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_17reset)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3206, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3212
+ /* "pywrapfst.pyx":3217
* Resets the iterator to the initial position.
* """
* self._aiter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3212, __pyx_L1_error)
+ __PYX_ERR(0, 3217, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Reset();
- /* "pywrapfst.pyx":3206
+ /* "pywrapfst.pyx":3211
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3206, __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, 3211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3214
+/* "pywrapfst.pyx":3219
* self._aiter.get().Reset()
*
* cpdef void seek(self, size_t a): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3214, __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, 3219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_19seek)) {
- __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3214, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3214, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3223
+ /* "pywrapfst.pyx":3228
* a: The position to seek to.
* """
* self._aiter.get().Seek(a) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3223, __pyx_L1_error)
+ __PYX_ERR(0, 3228, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Seek(__pyx_v_a);
- /* "pywrapfst.pyx":3214
+ /* "pywrapfst.pyx":3219
* 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, 3214, __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, 3219, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__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, 3214, __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, 3219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3225
+/* "pywrapfst.pyx":3230
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint8 flags, uint8 mask): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3225, __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, 3230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_21set_flags)) {
- __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3225, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3225, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3230, __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, 3225, __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, 3230, __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, 3225, __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, 3230, __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, 3225, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3230, __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, 3225, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
#endif
}
- /* "pywrapfst.pyx":3235
+ /* "pywrapfst.pyx":3240
* mask: A mask to be applied to the `flags` argument before setting them.
* """
* self._aiter.get().SetFlags(flags, mask) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3235, __pyx_L1_error)
+ __PYX_ERR(0, 3240, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);
- /* "pywrapfst.pyx":3225
+ /* "pywrapfst.pyx":3230
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint8 flags, uint8 mask): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3225, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3230, __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, 3225, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3230, __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_uint8_t(values[0]); if (unlikely((__pyx_v_flags == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3225, __pyx_L3_error)
- __pyx_v_mask = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_mask == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3225, __pyx_L3_error)
+ __pyx_v_flags = __Pyx_PyInt_As_uint8_t(values[0]); if (unlikely((__pyx_v_flags == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3230, __pyx_L3_error)
+ __pyx_v_mask = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_mask == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3230, __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, 3225, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3230, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.ArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__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, 3225, __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, 3230, __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
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef object value(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3237, __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, 3242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_11ArcIterator_23value)) {
__Pyx_XDECREF(__pyx_r);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3237, __pyx_L1_error)
+ 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_r = __pyx_t_2;
#endif
}
- /* "pywrapfst.pyx":3243
+ /* "pywrapfst.pyx":3248
* Returns the current arc.
* """
* return _init_Arc(self._aiter.get().Value()) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3243, __pyx_L1_error)
+ __PYX_ERR(0, 3248, __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, 3243, __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, 3248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3237
+ /* "pywrapfst.pyx":3242
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef object value(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3237, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_11ArcIterator_value(__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":3255
+/* "pywrapfst.pyx":3260
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3256
+ /* "pywrapfst.pyx":3261
*
* def __repr__(self):
* return f"<MutableArcIterator at 0x{id(self):x}>" # <<<<<<<<<<<<<<
* def __init__(self, MutableFst ifst, int64 state):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3256, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__pyx_t_2 += 25;
__Pyx_GIVEREF(__pyx_kp_u_MutableArcIterator_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_MutableArcIterator_at_0x);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3256, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3256, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3256, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3255
+ /* "pywrapfst.pyx":3260
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3258
+/* "pywrapfst.pyx":3263
* return f"<MutableArcIterator at 0x{id(self):x}>"
*
* def __init__(self, MutableFst ifst, int64 state): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3258, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3263, __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, 3258, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3263, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3258, __pyx_L3_error)
+ __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3263, __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, 3258, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3263, __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, 3258, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_MutableFst, 1, "ifst", 0))) __PYX_ERR(0, 3263, __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 */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":3259
+ /* "pywrapfst.pyx":3264
*
* def __init__(self, MutableFst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3259, __pyx_L1_error)
+ __PYX_ERR(0, 3264, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_ifst->__pyx_base._fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":3260
+ /* "pywrapfst.pyx":3265
* def __init__(self, MutableFst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._mfst = ifst._mfst
*/
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3260, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3265, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3260, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3265, __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, 3260, __pyx_L1_error)
+ __PYX_ERR(0, 3265, __pyx_L1_error)
- /* "pywrapfst.pyx":3259
+ /* "pywrapfst.pyx":3264
*
* def __init__(self, MutableFst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3262
+ /* "pywrapfst.pyx":3267
* raise FstIndexError("State index out of range")
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._mfst = ifst._mfst # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 3262, __pyx_L1_error)
+ __PYX_ERR(0, 3267, __pyx_L1_error)
}
__pyx_t_5 = __pyx_v_ifst->_mfst;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 3262, __pyx_L1_error)
+ __PYX_ERR(0, 3267, __pyx_L1_error)
}
__pyx_v_self->_mfst = __pyx_t_5;
- /* "pywrapfst.pyx":3263
+ /* "pywrapfst.pyx":3268
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._mfst = ifst._mfst
* self._aiter.reset(new fst.MutableArcIteratorClass(ifst._mfst.get(), state)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3263, __pyx_L1_error)
+ __PYX_ERR(0, 3268, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 3263, __pyx_L1_error)
+ __PYX_ERR(0, 3268, __pyx_L1_error)
}
__pyx_v_self->_aiter.reset(new fst::script::MutableArcIteratorClass(__pyx_v_ifst->_mfst.get(), __pyx_v_state));
- /* "pywrapfst.pyx":3258
+ /* "pywrapfst.pyx":3263
* return f"<MutableArcIterator at 0x{id(self):x}>"
*
* def __init__(self, MutableFst ifst, int64 state): # <<<<<<<<<<<<<<
}
static PyObject *__pyx_gb_9pywrapfst_18MutableArcIterator_6generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
-/* "pywrapfst.pyx":3266
+/* "pywrapfst.pyx":3271
*
* # Magic method used to get a Pythonic Iterator API out of the C++ API.
* def __iter__(self): # <<<<<<<<<<<<<<
if (unlikely(!__pyx_cur_scope)) {
__pyx_cur_scope = ((struct __pyx_obj_9pywrapfst___pyx_scope_struct____iter__ *)Py_None);
__Pyx_INCREF(Py_None);
- __PYX_ERR(0, 3266, __pyx_L1_error)
+ __PYX_ERR(0, 3271, __pyx_L1_error)
} else {
__Pyx_GOTREF(__pyx_cur_scope);
}
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_9pywrapfst_18MutableArcIterator_6generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_MutableArcIterator___iter, __pyx_n_s_pywrapfst_2); if (unlikely(!gen)) __PYX_ERR(0, 3266, __pyx_L1_error)
+ __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_9pywrapfst_18MutableArcIterator_6generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_MutableArcIterator___iter, __pyx_n_s_pywrapfst_2); if (unlikely(!gen)) __PYX_ERR(0, 3271, __pyx_L1_error)
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3266, __pyx_L1_error)
+ if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3271, __pyx_L1_error)
- /* "pywrapfst.pyx":3267
+ /* "pywrapfst.pyx":3272
* # Magic method used to get a Pythonic Iterator API out of the C++ API.
* def __iter__(self):
* while not self.done(): # <<<<<<<<<<<<<<
while (1) {
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
- __PYX_ERR(0, 3267, __pyx_L1_error)
+ __PYX_ERR(0, 3272, __pyx_L1_error)
}
__pyx_t_1 = ((!(((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->done(__pyx_cur_scope->__pyx_v_self, 0) != 0)) != 0);
if (!__pyx_t_1) break;
- /* "pywrapfst.pyx":3268
+ /* "pywrapfst.pyx":3273
* def __iter__(self):
* while not self.done():
* yield self.value() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "value");
- __PYX_ERR(0, 3268, __pyx_L1_error)
+ __PYX_ERR(0, 3273, __pyx_L1_error)
}
- __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->value(__pyx_cur_scope->__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3268, __pyx_L1_error)
+ __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->value(__pyx_cur_scope->__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_generator->resume_label = 1;
return __pyx_r;
__pyx_L6_resume_from_yield:;
- if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3268, __pyx_L1_error)
+ if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3273, __pyx_L1_error)
- /* "pywrapfst.pyx":3269
+ /* "pywrapfst.pyx":3274
* while not self.done():
* yield self.value()
* self.next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
- __PYX_ERR(0, 3269, __pyx_L1_error)
+ __PYX_ERR(0, 3274, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->next(__pyx_cur_scope->__pyx_v_self, 0);
}
CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
- /* "pywrapfst.pyx":3266
+ /* "pywrapfst.pyx":3271
*
* # Magic method used to get a Pythonic Iterator API out of the C++ API.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3271
+/* "pywrapfst.pyx":3276
* self.next()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3271, __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, 3276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_8done)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3271, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3276, __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, 3271, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3276, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3280
+ /* "pywrapfst.pyx":3285
* True if the iterator is exhausted, False otherwise.
* """
* return self._aiter.get().Done() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3280, __pyx_L1_error)
+ __PYX_ERR(0, 3285, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3271
+ /* "pywrapfst.pyx":3276
* self.next()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3271, __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, 3276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3282
+/* "pywrapfst.pyx":3287
* return self._aiter.get().Done()
*
* cpdef uint8 flags(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3282, __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, 3287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_10flags)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3282, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3282, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3287, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3291
+ /* "pywrapfst.pyx":3296
* The current iterator behavioral flags as an integer.
* """
* return self._aiter.get().Flags() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3291, __pyx_L1_error)
+ __PYX_ERR(0, 3296, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":3282
+ /* "pywrapfst.pyx":3287
* return self._aiter.get().Done()
*
* cpdef uint8 flags(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("flags", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_f_9pywrapfst_18MutableArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3282, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_f_9pywrapfst_18MutableArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3293
+/* "pywrapfst.pyx":3298
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3293, __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, 3298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_12next)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3293, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3299
+ /* "pywrapfst.pyx":3304
* Advances the iterator.
* """
* self._aiter.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3299, __pyx_L1_error)
+ __PYX_ERR(0, 3304, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Next();
- /* "pywrapfst.pyx":3293
+ /* "pywrapfst.pyx":3298
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3293, __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, 3298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3301
+/* "pywrapfst.pyx":3306
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3301, __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, 3306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_14position)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3301, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3306, __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, 3301, __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, 3306, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3310
+ /* "pywrapfst.pyx":3315
* The iterator's position, expressed as an integer.
* """
* return self._aiter.get().Position() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3310, __pyx_L1_error)
+ __PYX_ERR(0, 3315, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Position();
goto __pyx_L0;
- /* "pywrapfst.pyx":3301
+ /* "pywrapfst.pyx":3306
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3301, __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, 3306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3312
+/* "pywrapfst.pyx":3317
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3312, __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, 3317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_16reset)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3312, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3318
+ /* "pywrapfst.pyx":3323
* Resets the iterator to the initial position.
* """
* self._aiter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3318, __pyx_L1_error)
+ __PYX_ERR(0, 3323, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Reset();
- /* "pywrapfst.pyx":3312
+ /* "pywrapfst.pyx":3317
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3312, __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, 3317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3320
+/* "pywrapfst.pyx":3325
* self._aiter.get().Reset()
*
* cpdef void seek(self, size_t a): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3320, __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, 3325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_18seek)) {
- __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3320, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3320, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3329
+ /* "pywrapfst.pyx":3334
* a: The position to seek to.
* """
* self._aiter.get().Seek(a) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3329, __pyx_L1_error)
+ __PYX_ERR(0, 3334, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Seek(__pyx_v_a);
- /* "pywrapfst.pyx":3320
+ /* "pywrapfst.pyx":3325
* 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, 3320, __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, 3325, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
int __pyx_clineno = 0;
__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, 3320, __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, 3325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3331
+/* "pywrapfst.pyx":3336
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint8 flags, uint8 mask): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3331, __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, 3336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_20set_flags)) {
- __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3331, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3331, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3336, __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, 3331, __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, 3336, __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, 3331, __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, 3336, __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, 3331, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3336, __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, 3331, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
#endif
}
- /* "pywrapfst.pyx":3341
+ /* "pywrapfst.pyx":3346
* mask: A mask to be applied to the `flags` argument before setting them.
* """
* self._aiter.get().SetFlags(flags, mask) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3341, __pyx_L1_error)
+ __PYX_ERR(0, 3346, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);
- /* "pywrapfst.pyx":3331
+ /* "pywrapfst.pyx":3336
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint8 flags, uint8 mask): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3331, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3336, __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, 3331, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3336, __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_uint8_t(values[0]); if (unlikely((__pyx_v_flags == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3331, __pyx_L3_error)
- __pyx_v_mask = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_mask == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3331, __pyx_L3_error)
+ __pyx_v_flags = __Pyx_PyInt_As_uint8_t(values[0]); if (unlikely((__pyx_v_flags == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3336, __pyx_L3_error)
+ __pyx_v_mask = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_mask == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3336, __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, 3331, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3336, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__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, 3331, __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, 3336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3343
+/* "pywrapfst.pyx":3348
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef void set_value(self, Arc arc): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3343, __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, 3348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_22set_value)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_arc)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_arc));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3343, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3352
+ /* "pywrapfst.pyx":3357
* arc: The arc to replace the current arc with.
* """
* self._aiter.get().SetValue(deref(arc._arc)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3352, __pyx_L1_error)
+ __PYX_ERR(0, 3357, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
- __PYX_ERR(0, 3352, __pyx_L1_error)
+ __PYX_ERR(0, 3357, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetValue((*__pyx_v_arc->_arc));
- /* "pywrapfst.pyx":3343
+ /* "pywrapfst.pyx":3348
* 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, 3343, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 3348, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_21set_value(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_arc));
/* function exit code */
int __pyx_clineno = 0;
__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, 3343, __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, 3348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3354
+/* "pywrapfst.pyx":3359
* self._aiter.get().SetValue(deref(arc._arc))
*
* cpdef object value(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3354, __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, 3359, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_18MutableArcIterator_24value)) {
__Pyx_XDECREF(__pyx_r);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3354, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3359, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
#endif
}
- /* "pywrapfst.pyx":3360
+ /* "pywrapfst.pyx":3365
* Returns the current arc.
* """
* return _init_Arc(self._aiter.get().Value()) # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
- __PYX_ERR(0, 3360, __pyx_L1_error)
+ __PYX_ERR(0, 3365, __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, 3360, __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, 3365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3354
+ /* "pywrapfst.pyx":3359
* self._aiter.get().SetValue(deref(arc._arc))
*
* cpdef object value(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3354, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_18MutableArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3359, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3374
+/* "pywrapfst.pyx":3379
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3375
+ /* "pywrapfst.pyx":3380
*
* def __repr__(self):
* return f"<StateIterator at 0x{id(self):x}>" # <<<<<<<<<<<<<<
* def __init__(self, Fst ifst):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3375, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__pyx_t_2 += 20;
__Pyx_GIVEREF(__pyx_kp_u_StateIterator_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_StateIterator_at_0x);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3375, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3375, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3375, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3374
+ /* "pywrapfst.pyx":3379
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3377
+/* "pywrapfst.pyx":3382
* return f"<StateIterator at 0x{id(self):x}>"
*
* 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, 3377, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3382, __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, 3377, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3382, __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, 3377, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3382, __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 */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":3379
+ /* "pywrapfst.pyx":3384
* def __init__(self, Fst ifst):
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._fst = ifst._fst # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3379, __pyx_L1_error)
+ __PYX_ERR(0, 3384, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_ifst->_fst;
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3379, __pyx_L1_error)
+ __PYX_ERR(0, 3384, __pyx_L1_error)
}
__pyx_v_self->_fst = __pyx_t_1;
- /* "pywrapfst.pyx":3380
+ /* "pywrapfst.pyx":3385
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
* self._fst = ifst._fst
* self._siter.reset(new fst.StateIteratorClass(deref(self._fst))) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 3380, __pyx_L1_error)
+ __PYX_ERR(0, 3385, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3380, __pyx_L1_error)
+ __PYX_ERR(0, 3385, __pyx_L1_error)
}
__pyx_v_self->_siter.reset(new fst::script::StateIteratorClass((*__pyx_v_self->_fst)));
- /* "pywrapfst.pyx":3377
+ /* "pywrapfst.pyx":3382
* return f"<StateIterator at 0x{id(self):x}>"
*
* def __init__(self, Fst ifst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3383
+/* "pywrapfst.pyx":3388
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":3384
+ /* "pywrapfst.pyx":3389
* # 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":3383
+ /* "pywrapfst.pyx":3388
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3387
+/* "pywrapfst.pyx":3392
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "pywrapfst.pyx":3388
+ /* "pywrapfst.pyx":3393
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
- __PYX_ERR(0, 3388, __pyx_L1_error)
+ __PYX_ERR(0, 3393, __pyx_L1_error)
}
__pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":3389
+ /* "pywrapfst.pyx":3394
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* self.next()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 3389, __pyx_L1_error)
+ __PYX_ERR(0, 3394, __pyx_L1_error)
- /* "pywrapfst.pyx":3388
+ /* "pywrapfst.pyx":3393
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3390
+ /* "pywrapfst.pyx":3395
* if self.done():
* raise StopIteration
* cdef int64 result = self.value() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "value");
- __PYX_ERR(0, 3390, __pyx_L1_error)
+ __PYX_ERR(0, 3395, __pyx_L1_error)
}
__pyx_v_result = ((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3391
+ /* "pywrapfst.pyx":3396
* raise StopIteration
* cdef int64 result = self.value()
* self.next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
- __PYX_ERR(0, 3391, __pyx_L1_error)
+ __PYX_ERR(0, 3396, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3392
+ /* "pywrapfst.pyx":3397
* 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, 3392, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3397, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3387
+ /* "pywrapfst.pyx":3392
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3394
+/* "pywrapfst.pyx":3399
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3394, __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, 3399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_13StateIterator_9done)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3394, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3399, __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, 3394, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3399, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3403
+ /* "pywrapfst.pyx":3408
* True if the iterator is exhausted, False otherwise.
* """
* return self._siter.get().Done() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 3403, __pyx_L1_error)
+ __PYX_ERR(0, 3408, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3394
+ /* "pywrapfst.pyx":3399
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3394, __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, 3399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3405
+/* "pywrapfst.pyx":3410
* return self._siter.get().Done()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3405, __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, 3410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_13StateIterator_11next)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3405, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3411
+ /* "pywrapfst.pyx":3416
* Advances the iterator.
* """
* self._siter.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 3411, __pyx_L1_error)
+ __PYX_ERR(0, 3416, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Next();
- /* "pywrapfst.pyx":3405
+ /* "pywrapfst.pyx":3410
* return self._siter.get().Done()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3405, __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, 3410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3413
+/* "pywrapfst.pyx":3418
* self._siter.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3413, __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, 3418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_13StateIterator_13reset)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3413, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":3419
+ /* "pywrapfst.pyx":3424
* Resets the iterator to the initial position.
* """
* self._siter.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 3419, __pyx_L1_error)
+ __PYX_ERR(0, 3424, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Reset();
- /* "pywrapfst.pyx":3413
+ /* "pywrapfst.pyx":3418
* self._siter.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3413, __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, 3418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3421
+/* "pywrapfst.pyx":3426
* self._siter.get().Reset()
*
* cpdef int64 value(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3421, __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, 3426, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_13StateIterator_15value)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3421, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3426, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3421, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3426, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":3427
+ /* "pywrapfst.pyx":3432
* Returns the current state index.
* """
* return self._siter.get().Value() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 3427, __pyx_L1_error)
+ __PYX_ERR(0, 3432, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Value();
goto __pyx_L0;
- /* "pywrapfst.pyx":3421
+ /* "pywrapfst.pyx":3426
* self._siter.get().Reset()
*
* cpdef int64 value(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 3421, __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, 3426, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3433
+/* "pywrapfst.pyx":3438
*
*
* cdef Fst _map(Fst ifst, # <<<<<<<<<<<<<<
PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_u_identity);
double __pyx_v_power = ((double)1.);
- /* "pywrapfst.pyx":3437
+ /* "pywrapfst.pyx":3442
* map_type="identity",
* double power=1.,
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3439
+ /* "pywrapfst.pyx":3444
* weight=None):
* cdef fst.MapType _map_type
* if not fst.GetMapType(tostring(map_type), addr(_map_type)): # <<<<<<<<<<<<<<
* raise FstArgError(f"Unknown map type: {map_type!r}")
* cdef fst.WeightClass _weight
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_map_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3439, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_map_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3444, __pyx_L1_error)
__pyx_t_2 = ((!(fst::script::GetMapType(__pyx_t_1, (&__pyx_v__map_type)) != 0)) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":3440
+ /* "pywrapfst.pyx":3445
* cdef fst.MapType _map_type
* if not fst.GetMapType(tostring(map_type), addr(_map_type)):
* raise FstArgError(f"Unknown map type: {map_type!r}") # <<<<<<<<<<<<<<
* cdef fst.WeightClass _weight
* if _map_type == fst.TIMES_MAPPER:
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3440, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3445, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_map_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3440, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_map_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3445, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_map_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3440, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_map_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3445, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3440, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3445, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 3440, __pyx_L1_error)
+ __PYX_ERR(0, 3445, __pyx_L1_error)
- /* "pywrapfst.pyx":3439
+ /* "pywrapfst.pyx":3444
* weight=None):
* cdef fst.MapType _map_type
* if not fst.GetMapType(tostring(map_type), addr(_map_type)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3442
+ /* "pywrapfst.pyx":3447
* raise FstArgError(f"Unknown map type: {map_type!r}")
* cdef fst.WeightClass _weight
* if _map_type == fst.TIMES_MAPPER: # <<<<<<<<<<<<<<
- * _weight = _get_WeightClass_or_One(ifst.weight_type(), weight)
+ * _weight = _get_WeightClass_or_one(ifst.weight_type(), weight)
* else:
*/
__pyx_t_2 = ((__pyx_v__map_type == fst::script::TIMES_MAPPER) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":3443
+ /* "pywrapfst.pyx":3448
* cdef fst.WeightClass _weight
* if _map_type == fst.TIMES_MAPPER:
- * _weight = _get_WeightClass_or_One(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
+ * _weight = _get_WeightClass_or_one(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
* else:
- * _weight = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
+ * _weight = _get_WeightClass_or_zero(ifst.weight_type(), weight)
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 3443, __pyx_L1_error)
+ __PYX_ERR(0, 3448, __pyx_L1_error)
}
- __pyx_t_7 = __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, 3443, __pyx_L1_error)
+ __pyx_t_7 = __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, 3448, __pyx_L1_error)
__pyx_v__weight = __pyx_t_7;
- /* "pywrapfst.pyx":3442
+ /* "pywrapfst.pyx":3447
* raise FstArgError(f"Unknown map type: {map_type!r}")
* cdef fst.WeightClass _weight
* if _map_type == fst.TIMES_MAPPER: # <<<<<<<<<<<<<<
- * _weight = _get_WeightClass_or_One(ifst.weight_type(), weight)
+ * _weight = _get_WeightClass_or_one(ifst.weight_type(), weight)
* else:
*/
goto __pyx_L4;
}
- /* "pywrapfst.pyx":3445
- * _weight = _get_WeightClass_or_One(ifst.weight_type(), weight)
+ /* "pywrapfst.pyx":3450
+ * _weight = _get_WeightClass_or_one(ifst.weight_type(), weight)
* else:
- * _weight = _get_WeightClass_or_Zero(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
+ * _weight = _get_WeightClass_or_zero(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
* return _init_XFst(fst.Map(deref(ifst._fst), _map_type, delta, power, _weight))
*
*/
/*else*/ {
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 3445, __pyx_L1_error)
+ __PYX_ERR(0, 3450, __pyx_L1_error)
}
- __pyx_t_7 = __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, 3445, __pyx_L1_error)
+ __pyx_t_7 = __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, 3450, __pyx_L1_error)
__pyx_v__weight = __pyx_t_7;
}
__pyx_L4:;
- /* "pywrapfst.pyx":3446
+ /* "pywrapfst.pyx":3451
* else:
- * _weight = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
+ * _weight = _get_WeightClass_or_zero(ifst.weight_type(), weight)
* return _init_XFst(fst.Map(deref(ifst._fst), _map_type, delta, power, _weight)) # <<<<<<<<<<<<<<
*
*
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3446, __pyx_L1_error)
+ __PYX_ERR(0, 3451, __pyx_L1_error)
}
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(fst::script::Map((*__pyx_v_ifst->_fst), __pyx_v__map_type, __pyx_v_delta, __pyx_v_power, __pyx_v__weight))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3446, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(fst::script::Map((*__pyx_v_ifst->_fst), __pyx_v__map_type, __pyx_v_delta, __pyx_v_power, __pyx_v__weight))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3451, __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":3433
+ /* "pywrapfst.pyx":3438
*
*
* cdef Fst _map(Fst ifst, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3449
+/* "pywrapfst.pyx":3454
*
*
* cpdef Fst arcmap(Fst ifst, # <<<<<<<<<<<<<<
PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_u_identity);
double __pyx_v_power = ((double)1.);
- /* "pywrapfst.pyx":3453
+ /* "pywrapfst.pyx":3458
* map_type="identity",
* double power=1.,
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3493
+ /* "pywrapfst.pyx":3498
* FstArgError: Unknown map type.
* """
* return _map(ifst, delta, map_type, power, weight) # <<<<<<<<<<<<<<
__pyx_t_2.map_type = __pyx_v_map_type;
__pyx_t_2.power = __pyx_v_power;
__pyx_t_2.weight = __pyx_v_weight;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__map(__pyx_v_ifst, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3493, __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, 3498, __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":3449
+ /* "pywrapfst.pyx":3454
*
*
* cpdef Fst arcmap(Fst ifst, # <<<<<<<<<<<<<<
PyObject* values[5] = {0,0,0,0,0};
values[2] = ((PyObject *)__pyx_n_u_identity);
- /* "pywrapfst.pyx":3453
+ /* "pywrapfst.pyx":3458
* map_type="identity",
* double power=1.,
* weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcmap") < 0)) __PYX_ERR(0, 3449, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcmap") < 0)) __PYX_ERR(0, 3454, __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, 3450, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3455, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__33;
}
__pyx_v_map_type = values[2];
if (values[3]) {
- __pyx_v_power = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_power == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3452, __pyx_L3_error)
+ __pyx_v_power = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_power == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3457, __pyx_L3_error)
} else {
__pyx_v_power = ((double)1.);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3449, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3454, __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, 3449, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3454, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_20arcmap(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_map_type, __pyx_v_power, __pyx_v_weight);
- /* "pywrapfst.pyx":3449
+ /* "pywrapfst.pyx":3454
*
*
* cpdef Fst arcmap(Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_2.map_type = __pyx_v_map_type;
__pyx_t_2.power = __pyx_v_power;
__pyx_t_2.weight = __pyx_v_weight;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_arcmap(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3449, __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, 3454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3496
+/* "pywrapfst.pyx":3501
*
*
* 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_u_auto);
- /* "pywrapfst.pyx":3499
+ /* "pywrapfst.pyx":3504
* Fst ifst2,
* compose_filter="auto",
* bool connect=True): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3523
+ /* "pywrapfst.pyx":3528
* """
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3523, __pyx_L1_error)
+ __PYX_ERR(0, 3528, __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":3527
+ /* "pywrapfst.pyx":3532
* _opts.reset(
* new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter)))) # <<<<<<<<<<<<<<
* fst.Compose(deref(ifst1._fst), deref(ifst2._fst), _tfst.get(), deref(_opts))
* return _init_MutableFst(_tfst.release())
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3527, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3527, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3532, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3532, __pyx_L1_error)
- /* "pywrapfst.pyx":3525
+ /* "pywrapfst.pyx":3530
* _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
* cdef unique_ptr[fst.ComposeOptions] _opts
* _opts.reset( # <<<<<<<<<<<<<<
*/
__pyx_v__opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
- /* "pywrapfst.pyx":3528
+ /* "pywrapfst.pyx":3533
* new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter))))
* fst.Compose(deref(ifst1._fst), deref(ifst2._fst), _tfst.get(), deref(_opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3528, __pyx_L1_error)
+ __PYX_ERR(0, 3533, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3528, __pyx_L1_error)
+ __PYX_ERR(0, 3533, __pyx_L1_error)
}
fst::script::Compose((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":3529
+ /* "pywrapfst.pyx":3534
* _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, 3529, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3534, __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":3496
+ /* "pywrapfst.pyx":3501
*
*
* cpdef MutableFst compose(Fst ifst1, # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, 1); __PYX_ERR(0, 3496, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, 1); __PYX_ERR(0, 3501, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(0, 3496, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(0, 3501, __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, 3499, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3504, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3499
+ /* "pywrapfst.pyx":3504
* Fst ifst2,
* compose_filter="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, 3496, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3501, __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, 3496, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3497, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3501, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3502, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_22compose(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);
- /* "pywrapfst.pyx":3496
+ /* "pywrapfst.pyx":3501
*
*
* 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, 3496, __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, 3501, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3532
+/* "pywrapfst.pyx":3537
*
*
* cpdef Fst convert(Fst ifst, fst_type=""): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3549
+ /* "pywrapfst.pyx":3554
* FstOpError: Conversion failed.
* """
* cdef string _fst_type = tostring(fst_type) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.FstClass] _tfst
* _tfst.reset(fst.Convert(deref(ifst._fst), _fst_type))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3549, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3554, __pyx_L1_error)
__pyx_v__fst_type = __pyx_t_1;
- /* "pywrapfst.pyx":3551
+ /* "pywrapfst.pyx":3556
* cdef string _fst_type = tostring(fst_type)
* cdef unique_ptr[fst.FstClass] _tfst
* _tfst.reset(fst.Convert(deref(ifst._fst), _fst_type)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3551, __pyx_L1_error)
+ __PYX_ERR(0, 3556, __pyx_L1_error)
}
__pyx_v__tfst.reset(fst::script::Convert((*__pyx_v_ifst->_fst), __pyx_v__fst_type));
- /* "pywrapfst.pyx":3553
+ /* "pywrapfst.pyx":3558
* _tfst.reset(fst.Convert(deref(ifst._fst), _fst_type))
* # Script-land Convert returns a null pointer to signal failure.
* if _tfst.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_2 = ((__pyx_v__tfst.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":3554
+ /* "pywrapfst.pyx":3559
* # Script-land Convert returns a null pointer to signal failure.
* if _tfst.get() == NULL:
* raise FstOpError(f"Conversion to {fst_type!r} failed") # <<<<<<<<<<<<<<
* return _init_XFst(_tfst.release())
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3554, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3554, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = 0;
__pyx_t_7 = 127;
__pyx_t_6 += 14;
__Pyx_GIVEREF(__pyx_kp_u_Conversion_to);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Conversion_to);
- __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_fst_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3554, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_fst_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
__pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
__pyx_t_6 += 7;
__Pyx_GIVEREF(__pyx_kp_u_failed);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_failed);
- __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3554, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3554, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 3554, __pyx_L1_error)
+ __PYX_ERR(0, 3559, __pyx_L1_error)
- /* "pywrapfst.pyx":3553
+ /* "pywrapfst.pyx":3558
* _tfst.reset(fst.Convert(deref(ifst._fst), _fst_type))
* # Script-land Convert returns a null pointer to signal failure.
* if _tfst.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3555
+ /* "pywrapfst.pyx":3560
* if _tfst.get() == NULL:
* raise FstOpError(f"Conversion to {fst_type!r} failed")
* return _init_XFst(_tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3555, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3560, __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":3532
+ /* "pywrapfst.pyx":3537
*
*
* cpdef Fst convert(Fst ifst, fst_type=""): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 3532, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 3537, __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, 3532, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("convert", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3537, __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, 3532, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3537, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_24convert(__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, 3532, __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, 3537, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3558
+/* "pywrapfst.pyx":3563
*
*
* cpdef MutableFst determinize(Fst ifst, # <<<<<<<<<<<<<<
int64 __pyx_v_nstate = __pyx_k__35;
int64 __pyx_v_subsequential_label = ((int64)0);
- /* "pywrapfst.pyx":3563
+ /* "pywrapfst.pyx":3568
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None, # <<<<<<<<<<<<<<
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- /* "pywrapfst.pyx":3564
+ /* "pywrapfst.pyx":3569
* int64 subsequential_label=0,
* weight=None,
* bool increment_subsequential_label=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3598
+ /* "pywrapfst.pyx":3603
* """
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
* # Threshold is set to semiring Zero (no pruning) if weight unspecified.
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3598, __pyx_L1_error)
+ __PYX_ERR(0, 3603, __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":3600
+ /* "pywrapfst.pyx":3605
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* # Threshold is set to semiring Zero (no pruning) if weight unspecified.
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(), # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(), # <<<<<<<<<<<<<<
* weight)
* cdef fst.DeterminizeType _det_type
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 3600, __pyx_L1_error)
+ __PYX_ERR(0, 3605, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3601
+ /* "pywrapfst.pyx":3606
* # Threshold is set to semiring Zero (no pruning) if weight unspecified.
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
* weight) # <<<<<<<<<<<<<<
* cdef fst.DeterminizeType _det_type
* if not fst.GetDeterminizeType(tostring(det_type), addr(_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, 3600, __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, 3605, __pyx_L1_error)
__pyx_v__weight = __pyx_t_1;
- /* "pywrapfst.pyx":3603
+ /* "pywrapfst.pyx":3608
* weight)
* cdef fst.DeterminizeType _det_type
* if not fst.GetDeterminizeType(tostring(det_type), addr(_det_type)): # <<<<<<<<<<<<<<
* raise FstArgError(f"Unknown determinization type: {det_type!r}")
* cdef unique_ptr[fst.DeterminizeOptions] _opts
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_det_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3603, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_det_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3608, __pyx_L1_error)
__pyx_t_3 = ((!(fst::script::GetDeterminizeType(__pyx_t_2, (&__pyx_v__det_type)) != 0)) != 0);
if (unlikely(__pyx_t_3)) {
- /* "pywrapfst.pyx":3604
+ /* "pywrapfst.pyx":3609
* cdef fst.DeterminizeType _det_type
* if not fst.GetDeterminizeType(tostring(det_type), addr(_det_type)):
* raise FstArgError(f"Unknown determinization type: {det_type!r}") # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.DeterminizeOptions] _opts
* _opts.reset(
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3604, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_det_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3604, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_det_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_determinization_type, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3604, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_determinization_type, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3604, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 3604, __pyx_L1_error)
+ __PYX_ERR(0, 3609, __pyx_L1_error)
- /* "pywrapfst.pyx":3603
+ /* "pywrapfst.pyx":3608
* weight)
* cdef fst.DeterminizeType _det_type
* if not fst.GetDeterminizeType(tostring(det_type), addr(_det_type)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3606
+ /* "pywrapfst.pyx":3611
* raise FstArgError(f"Unknown determinization type: {det_type!r}")
* cdef unique_ptr[fst.DeterminizeOptions] _opts
* _opts.reset( # <<<<<<<<<<<<<<
*/
__pyx_v__opts.reset(new fst::script::DeterminizeOptions(__pyx_v_delta, __pyx_v__weight, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v__det_type, __pyx_v_increment_subsequential_label));
- /* "pywrapfst.pyx":3613
+ /* "pywrapfst.pyx":3618
* _det_type,
* increment_subsequential_label))
* fst.Determinize(deref(ifst._fst), _tfst.get(), deref(_opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3613, __pyx_L1_error)
+ __PYX_ERR(0, 3618, __pyx_L1_error)
}
fst::script::Determinize((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":3614
+ /* "pywrapfst.pyx":3619
* 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, 3614, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3619, __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":3558
+ /* "pywrapfst.pyx":3563
*
*
* cpdef MutableFst determinize(Fst ifst, # <<<<<<<<<<<<<<
PyObject* values[7] = {0,0,0,0,0,0,0};
values[2] = ((PyObject *)__pyx_n_u_functional);
- /* "pywrapfst.pyx":3563
+ /* "pywrapfst.pyx":3568
* 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, 3558, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "determinize") < 0)) __PYX_ERR(0, 3563, __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, 3559, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3564, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__34;
}
__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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3561, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3566, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__35;
}
if (values[4]) {
- __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_subsequential_label == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3562, __pyx_L3_error)
+ __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_subsequential_label == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3567, __pyx_L3_error)
} else {
__pyx_v_subsequential_label = ((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, 3564, __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, 3569, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3564
+ /* "pywrapfst.pyx":3569
* int64 subsequential_label=0,
* weight=None,
* bool increment_subsequential_label=False): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3558, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3563, __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, 3558, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3563, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_26determinize(__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":3558
+ /* "pywrapfst.pyx":3563
*
*
* 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, 3558, __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, 3563, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3617
+/* "pywrapfst.pyx":3622
*
*
* 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_u_auto);
- /* "pywrapfst.pyx":3620
+ /* "pywrapfst.pyx":3625
* Fst ifst2,
* compose_filter="auto",
* bool connect=True): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3645
+ /* "pywrapfst.pyx":3650
* """
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3645, __pyx_L1_error)
+ __PYX_ERR(0, 3650, __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":3649
+ /* "pywrapfst.pyx":3654
* _opts.reset(
* new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter)))) # <<<<<<<<<<<<<<
* fst.Difference(deref(ifst1._fst),
* deref(ifst2._fst),
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3649, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3649, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3654, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3654, __pyx_L1_error)
- /* "pywrapfst.pyx":3647
+ /* "pywrapfst.pyx":3652
* _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
* cdef unique_ptr[fst.ComposeOptions] _opts
* _opts.reset( # <<<<<<<<<<<<<<
*/
__pyx_v__opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
- /* "pywrapfst.pyx":3650
+ /* "pywrapfst.pyx":3655
* new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter))))
* fst.Difference(deref(ifst1._fst), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3650, __pyx_L1_error)
+ __PYX_ERR(0, 3655, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3651
+ /* "pywrapfst.pyx":3656
* _get_compose_filter(tostring(compose_filter))))
* fst.Difference(deref(ifst1._fst),
* deref(ifst2._fst), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3651, __pyx_L1_error)
+ __PYX_ERR(0, 3656, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3650
+ /* "pywrapfst.pyx":3655
* new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter))))
* fst.Difference(deref(ifst1._fst), # <<<<<<<<<<<<<<
*/
fst::script::Difference((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":3654
+ /* "pywrapfst.pyx":3659
* _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, 3654, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3659, __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":3617
+ /* "pywrapfst.pyx":3622
*
*
* cpdef MutableFst difference(Fst ifst1, # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, 1); __PYX_ERR(0, 3617, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, 1); __PYX_ERR(0, 3622, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(0, 3617, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(0, 3622, __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, 3620, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3625, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3620
+ /* "pywrapfst.pyx":3625
* Fst ifst2,
* compose_filter="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, 3617, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3622, __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, 3617, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3618, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3622, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3623, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_28difference(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);
- /* "pywrapfst.pyx":3617
+ /* "pywrapfst.pyx":3622
*
*
* 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, 3617, __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, 3622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3657
+/* "pywrapfst.pyx":3662
*
*
* cpdef MutableFst disambiguate(Fst ifst, # <<<<<<<<<<<<<<
int64 __pyx_v_nstate = __pyx_k__37;
int64 __pyx_v_subsequential_label = ((int64)0);
- /* "pywrapfst.pyx":3661
+ /* "pywrapfst.pyx":3666
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3686
+ /* "pywrapfst.pyx":3691
* """
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3686, __pyx_L1_error)
+ __PYX_ERR(0, 3691, __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":3688
+ /* "pywrapfst.pyx":3693
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(), # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(), # <<<<<<<<<<<<<<
* weight)
* cdef unique_ptr[fst.DisambiguateOptions] _opts
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 3688, __pyx_L1_error)
+ __PYX_ERR(0, 3693, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3689
+ /* "pywrapfst.pyx":3694
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
* weight) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.DisambiguateOptions] _opts
* _opts.reset(
*/
- __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_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, 3693, __pyx_L1_error)
__pyx_v__weight = __pyx_t_1;
- /* "pywrapfst.pyx":3691
+ /* "pywrapfst.pyx":3696
* weight)
* cdef unique_ptr[fst.DisambiguateOptions] _opts
* _opts.reset( # <<<<<<<<<<<<<<
*/
__pyx_v__opts.reset(new fst::script::DisambiguateOptions(__pyx_v_delta, __pyx_v__weight, __pyx_v_nstate, __pyx_v_subsequential_label));
- /* "pywrapfst.pyx":3696
+ /* "pywrapfst.pyx":3701
* nstate,
* subsequential_label))
* fst.Disambiguate(deref(ifst._fst), _tfst.get(), deref(_opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3696, __pyx_L1_error)
+ __PYX_ERR(0, 3701, __pyx_L1_error)
}
fst::script::Disambiguate((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":3697
+ /* "pywrapfst.pyx":3702
* 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, 3697, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3702, __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":3657
+ /* "pywrapfst.pyx":3662
*
*
* cpdef MutableFst disambiguate(Fst ifst, # <<<<<<<<<<<<<<
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_subsequential_label,&__pyx_n_s_weight,0};
PyObject* values[5] = {0,0,0,0,0};
- /* "pywrapfst.pyx":3661
+ /* "pywrapfst.pyx":3666
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "disambiguate") < 0)) __PYX_ERR(0, 3657, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "disambiguate") < 0)) __PYX_ERR(0, 3662, __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, 3658, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3663, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__36;
}
if (values[2]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3659, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3664, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__37;
}
if (values[3]) {
- __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_subsequential_label == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3660, __pyx_L3_error)
+ __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_subsequential_label == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3665, __pyx_L3_error)
} else {
__pyx_v_subsequential_label = ((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, 3657, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("disambiguate", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3662, __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, 3657, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3662, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_30disambiguate(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_weight);
- /* "pywrapfst.pyx":3657
+ /* "pywrapfst.pyx":3662
*
*
* 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, 3657, __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, 3662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3700
+/* "pywrapfst.pyx":3705
*
*
* cpdef MutableFst epsnormalize(Fst ifst, bool eps_norm_output=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3721
+ /* "pywrapfst.pyx":3726
* """
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3721, __pyx_L1_error)
+ __PYX_ERR(0, 3726, __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":3723
+ /* "pywrapfst.pyx":3728
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.EpsNormalize(
* deref(ifst._fst), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3723, __pyx_L1_error)
+ __PYX_ERR(0, 3728, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3725
+ /* "pywrapfst.pyx":3730
* 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":3722
+ /* "pywrapfst.pyx":3727
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.EpsNormalize( # <<<<<<<<<<<<<<
*/
fst::script::EpsNormalize((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_t_1);
- /* "pywrapfst.pyx":3726
+ /* "pywrapfst.pyx":3731
* _tfst.get(),
* fst.EPS_NORM_OUTPUT if 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, 3726, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3731, __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":3700
+ /* "pywrapfst.pyx":3705
*
*
* 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, 3700, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "epsnormalize") < 0)) __PYX_ERR(0, 3705, __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, 3700, __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, 3705, __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, 3700, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("epsnormalize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3705, __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, 3700, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3705, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_32epsnormalize(__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, 3700, __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, 3705, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3729
+/* "pywrapfst.pyx":3734
*
*
* cpdef bool equal(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3747
+ /* "pywrapfst.pyx":3752
* True if the FSTs satisfy the above condition, else False.
* """
* return fst.Equal(deref(ifst1._fst), deref(ifst2._fst), delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3747, __pyx_L1_error)
+ __PYX_ERR(0, 3752, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3747, __pyx_L1_error)
+ __PYX_ERR(0, 3752, __pyx_L1_error)
}
__pyx_r = fst::script::Equal((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3729
+ /* "pywrapfst.pyx":3734
*
*
* cpdef bool equal(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, 1); __PYX_ERR(0, 3729, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, 1); __PYX_ERR(0, 3734, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(0, 3729, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(0, 3734, __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, 3729, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3734, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__38;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3729, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3734, __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, 3729, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3729, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3734, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3734, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_34equal(__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, 3729, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3734, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3750
+/* "pywrapfst.pyx":3755
*
*
* cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3768
+ /* "pywrapfst.pyx":3773
* True if the FSTs satisfy the above condition, else False.
* """
* return fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3768, __pyx_L1_error)
+ __PYX_ERR(0, 3773, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3768, __pyx_L1_error)
+ __PYX_ERR(0, 3773, __pyx_L1_error)
}
__pyx_r = fst::script::Equivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3750
+ /* "pywrapfst.pyx":3755
*
*
* cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, 1); __PYX_ERR(0, 3750, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, 1); __PYX_ERR(0, 3755, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equivalent") < 0)) __PYX_ERR(0, 3750, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equivalent") < 0)) __PYX_ERR(0, 3755, __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, 3750, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3755, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__39;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3750, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3755, __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, 3750, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3750, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3755, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3755, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_36equivalent(__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_equivalent(__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, 3750, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3755, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3771
+/* "pywrapfst.pyx":3776
*
*
* 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_u_auto);
- /* "pywrapfst.pyx":3774
+ /* "pywrapfst.pyx":3779
* Fst ifst2,
* compose_filter="auto",
* bool connect=True): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3797
+ /* "pywrapfst.pyx":3802
* """
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3797, __pyx_L1_error)
+ __PYX_ERR(0, 3802, __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":3801
+ /* "pywrapfst.pyx":3806
* _opts.reset(
* new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter)))) # <<<<<<<<<<<<<<
* fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), _tfst.get(), deref(_opts))
* return _init_MutableFst(_tfst.release())
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3801, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3801, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L1_error)
- /* "pywrapfst.pyx":3799
+ /* "pywrapfst.pyx":3804
* _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
* cdef unique_ptr[fst.ComposeOptions] _opts
* _opts.reset( # <<<<<<<<<<<<<<
*/
__pyx_v__opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
- /* "pywrapfst.pyx":3802
+ /* "pywrapfst.pyx":3807
* new fst.ComposeOptions(connect,
* _get_compose_filter(tostring(compose_filter))))
* fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), _tfst.get(), deref(_opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3802, __pyx_L1_error)
+ __PYX_ERR(0, 3807, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3802, __pyx_L1_error)
+ __PYX_ERR(0, 3807, __pyx_L1_error)
}
fst::script::Intersect((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":3803
+ /* "pywrapfst.pyx":3808
* _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, 3803, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3808, __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":3771
+ /* "pywrapfst.pyx":3776
*
*
* cpdef MutableFst intersect(Fst ifst1, # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, 1); __PYX_ERR(0, 3771, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, 1); __PYX_ERR(0, 3776, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersect") < 0)) __PYX_ERR(0, 3771, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersect") < 0)) __PYX_ERR(0, 3776, __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, 3774, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3779, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3774
+ /* "pywrapfst.pyx":3779
* Fst ifst2,
* compose_filter="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, 3771, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3776, __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, 3771, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3772, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3776, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3777, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_38intersect(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);
- /* "pywrapfst.pyx":3771
+ /* "pywrapfst.pyx":3776
*
*
* 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, 3771, __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, 3776, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3806
+/* "pywrapfst.pyx":3811
*
*
* cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3827
+ /* "pywrapfst.pyx":3832
* True if the two transducers satisfy the above condition, else False.
* """
* return fst.Isomorphic(deref(ifst1._fst), deref(ifst2._fst), delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3827, __pyx_L1_error)
+ __PYX_ERR(0, 3832, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3827, __pyx_L1_error)
+ __PYX_ERR(0, 3832, __pyx_L1_error)
}
__pyx_r = fst::script::Isomorphic((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3806
+ /* "pywrapfst.pyx":3811
*
*
* cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, 1); __PYX_ERR(0, 3806, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, 1); __PYX_ERR(0, 3811, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isomorphic") < 0)) __PYX_ERR(0, 3806, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isomorphic") < 0)) __PYX_ERR(0, 3811, __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, 3806, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3811, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__40;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3806, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3811, __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, 3806, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3806, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3811, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3811, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_40isomorphic(__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, 3806, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3811, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3830
+/* "pywrapfst.pyx":3835
*
*
* cpdef MutableFst prune(Fst ifst, # <<<<<<<<<<<<<<
float __pyx_v_delta = __pyx_k__41;
int64 __pyx_v_nstate = __pyx_k__42;
- /* "pywrapfst.pyx":3833
+ /* "pywrapfst.pyx":3838
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3855
+ /* "pywrapfst.pyx":3860
* """
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
* weight)
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3855, __pyx_L1_error)
+ __PYX_ERR(0, 3860, __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":3856
+ /* "pywrapfst.pyx":3861
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(), # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(), # <<<<<<<<<<<<<<
* weight)
* fst.Prune(deref(ifst._fst), _tfst.get(), _weight, nstate, delta)
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 3856, __pyx_L1_error)
+ __PYX_ERR(0, 3861, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3857
+ /* "pywrapfst.pyx":3862
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
* weight) # <<<<<<<<<<<<<<
* fst.Prune(deref(ifst._fst), _tfst.get(), _weight, nstate, delta)
* return _init_MutableFst(_tfst.release())
*/
- __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, 3856, __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, 3861, __pyx_L1_error)
__pyx_v__weight = __pyx_t_1;
- /* "pywrapfst.pyx":3858
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(),
+ /* "pywrapfst.pyx":3863
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
* weight)
* fst.Prune(deref(ifst._fst), _tfst.get(), _weight, nstate, delta) # <<<<<<<<<<<<<<
* return _init_MutableFst(_tfst.release())
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3858, __pyx_L1_error)
+ __PYX_ERR(0, 3863, __pyx_L1_error)
}
fst::script::Prune((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_v__weight, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":3859
+ /* "pywrapfst.pyx":3864
* weight)
* fst.Prune(deref(ifst._fst), _tfst.get(), _weight, 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, 3859, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3864, __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":3830
+ /* "pywrapfst.pyx":3835
*
*
* cpdef MutableFst prune(Fst ifst, # <<<<<<<<<<<<<<
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_weight,0};
PyObject* values[4] = {0,0,0,0};
- /* "pywrapfst.pyx":3833
+ /* "pywrapfst.pyx":3838
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 3830, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 3835, __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, 3831, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3836, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__41;
}
if (values[2]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3832, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3837, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__42;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3830, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3835, __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, 3830, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3835, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_42prune(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);
- /* "pywrapfst.pyx":3830
+ /* "pywrapfst.pyx":3835
*
*
* 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, 3830, __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, 3835, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3862
+/* "pywrapfst.pyx":3867
*
*
* 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__43;
- /* "pywrapfst.pyx":3864
+ /* "pywrapfst.pyx":3869
* cpdef MutableFst push(Fst ifst,
* float delta=fst.kDelta,
* bool push_weights=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_push_weights = ((bool)0);
- /* "pywrapfst.pyx":3865
+ /* "pywrapfst.pyx":3870
* float delta=fst.kDelta,
* bool push_weights=False,
* bool push_labels=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_push_labels = ((bool)0);
- /* "pywrapfst.pyx":3866
+ /* "pywrapfst.pyx":3871
* bool push_weights=False,
* bool push_labels=False,
* bool remove_common_affix=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_common_affix = ((bool)0);
- /* "pywrapfst.pyx":3867
+ /* "pywrapfst.pyx":3872
* bool push_labels=False,
* bool remove_common_affix=False,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_total_weight = ((bool)0);
- /* "pywrapfst.pyx":3868
+ /* "pywrapfst.pyx":3873
* bool remove_common_affix=False,
* bool remove_total_weight=False,
* bool to_final=False): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3905
+ /* "pywrapfst.pyx":3910
* """
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3905, __pyx_L1_error)
+ __PYX_ERR(0, 3910, __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":3906
+ /* "pywrapfst.pyx":3911
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* cdef uint8 flags = fst.GetPushFlags(push_weights, # <<<<<<<<<<<<<<
*/
__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":3910
+ /* "pywrapfst.pyx":3915
* remove_common_affix,
* remove_total_weight)
* fst.Push(deref(ifst._fst), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3910, __pyx_L1_error)
+ __PYX_ERR(0, 3915, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3914
+ /* "pywrapfst.pyx":3919
* 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":3915
+ /* "pywrapfst.pyx":3920
* 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, 3915, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3920, __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":3862
+ /* "pywrapfst.pyx":3867
*
*
* 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, 3862, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 3867, __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, 3863, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3868, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__43;
}
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, 3864, __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, 3869, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3864
+ /* "pywrapfst.pyx":3869
* 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, 3865, __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, 3870, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3865
+ /* "pywrapfst.pyx":3870
* 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, 3866, __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, 3871, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3866
+ /* "pywrapfst.pyx":3871
* 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, 3867, __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, 3872, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3867
+ /* "pywrapfst.pyx":3872
* 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, 3868, __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, 3873, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3868
+ /* "pywrapfst.pyx":3873
* 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, 3862, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("push", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3867, __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, 3862, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3867, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_44push(__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":3862
+ /* "pywrapfst.pyx":3867
*
*
* 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, 3862, __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, 3867, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3918
+/* "pywrapfst.pyx":3923
*
*
* cpdef bool randequivalent(Fst ifst1, # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":3951
+ /* "pywrapfst.pyx":3956
* True if the two transducers satisfy the above condition, else False.
* """
* cdef fst.RandArcSelection _select = _get_rand_arc_selection(tostring(select)) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
* # The three trailing options will be ignored by RandEquivalent.
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3951, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3951, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3956, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3956, __pyx_L1_error)
__pyx_v__select = __pyx_t_2;
- /* "pywrapfst.pyx":3954
+ /* "pywrapfst.pyx":3959
* cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
* # The three trailing options will be ignored by RandEquivalent.
* _opts.reset( # <<<<<<<<<<<<<<
*/
__pyx_v__opts.reset(new fst::RandGenOptions<enum fst::script::RandArcSelection> (__pyx_v__select, __pyx_v_max_length, 1, 0, 0));
- /* "pywrapfst.pyx":3960
+ /* "pywrapfst.pyx":3965
* False,
* False))
* if seed == 0: # <<<<<<<<<<<<<<
__pyx_t_3 = ((__pyx_v_seed == 0) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":3961
+ /* "pywrapfst.pyx":3966
* False))
* if seed == 0:
* seed = time(NULL) # <<<<<<<<<<<<<<
*/
__pyx_v_seed = time(NULL);
- /* "pywrapfst.pyx":3960
+ /* "pywrapfst.pyx":3965
* False,
* False))
* if seed == 0: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3962
+ /* "pywrapfst.pyx":3967
* if seed == 0:
* seed = time(NULL)
* return fst.RandEquivalent(deref(ifst1._fst), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3962, __pyx_L1_error)
+ __PYX_ERR(0, 3967, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3963
+ /* "pywrapfst.pyx":3968
* seed = time(NULL)
* return fst.RandEquivalent(deref(ifst1._fst),
* deref(ifst2._fst), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3963, __pyx_L1_error)
+ __PYX_ERR(0, 3968, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3962
+ /* "pywrapfst.pyx":3967
* if seed == 0:
* seed = time(NULL)
* return fst.RandEquivalent(deref(ifst1._fst), # <<<<<<<<<<<<<<
__pyx_r = fst::script::RandEquivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_npath, (*__pyx_v__opts), __pyx_v_delta, __pyx_v_seed);
goto __pyx_L0;
- /* "pywrapfst.pyx":3918
+ /* "pywrapfst.pyx":3923
*
*
* cpdef bool randequivalent(Fst ifst1, # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, 1); __PYX_ERR(0, 3918, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, 1); __PYX_ERR(0, 3923, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randequivalent") < 0)) __PYX_ERR(0, 3918, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randequivalent") < 0)) __PYX_ERR(0, 3923, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3920, __pyx_L3_error)
+ __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_npath == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3925, __pyx_L3_error)
} else {
__pyx_v_npath = ((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, 3921, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3926, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__44;
}
__pyx_v_select = values[4];
if (values[5]) {
- __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[5]); if (unlikely((__pyx_v_max_length == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3923, __pyx_L3_error)
+ __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[5]); if (unlikely((__pyx_v_max_length == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3928, __pyx_L3_error)
} else {
__pyx_v_max_length = __pyx_k__45;
}
if (values[6]) {
- __pyx_v_seed = __Pyx_PyInt_As_uint64_t(values[6]); if (unlikely((__pyx_v_seed == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3924, __pyx_L3_error)
+ __pyx_v_seed = __Pyx_PyInt_As_uint64_t(values[6]); if (unlikely((__pyx_v_seed == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3929, __pyx_L3_error)
} else {
__pyx_v_seed = ((uint64)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3918, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3923, __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, 3918, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3919, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3923, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3924, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_46randequivalent(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_npath, __pyx_v_delta, __pyx_v_select, __pyx_v_max_length, __pyx_v_seed);
/* function exit code */
__pyx_t_2.select = __pyx_v_select;
__pyx_t_2.max_length = __pyx_v_max_length;
__pyx_t_2.seed = __pyx_v_seed;
- __pyx_t_1 = __pyx_f_9pywrapfst_randequivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 3918, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3918, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_randequivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 3923, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3923, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3970
+/* "pywrapfst.pyx":3975
*
*
* cpdef MutableFst randgen(Fst ifst, # <<<<<<<<<<<<<<
PyObject *__pyx_v_select = ((PyObject *)__pyx_n_u_uniform);
int32 __pyx_v_max_length = __pyx_k__46;
- /* "pywrapfst.pyx":3974
+ /* "pywrapfst.pyx":3979
* select="uniform",
* int32 max_length=INT32_MAX,
* bool weighted=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_weighted = ((bool)0);
- /* "pywrapfst.pyx":3975
+ /* "pywrapfst.pyx":3980
* int32 max_length=INT32_MAX,
* bool weighted=False,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":4006
+ /* "pywrapfst.pyx":4011
* An FST containing one or more random paths.
* """
* cdef fst.RandArcSelection _select = _get_rand_arc_selection(tostring(select)) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
* _opts.reset(
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4006, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4006, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4011, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4011, __pyx_L1_error)
__pyx_v__select = __pyx_t_2;
- /* "pywrapfst.pyx":4008
+ /* "pywrapfst.pyx":4013
* cdef fst.RandArcSelection _select = _get_rand_arc_selection(tostring(select))
* cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
* _opts.reset( # <<<<<<<<<<<<<<
*/
__pyx_v__opts.reset(new fst::RandGenOptions<enum fst::script::RandArcSelection> (__pyx_v__select, __pyx_v_max_length, __pyx_v_npath, __pyx_v_weighted, __pyx_v_remove_total_weight));
- /* "pywrapfst.pyx":4015
+ /* "pywrapfst.pyx":4020
* remove_total_weight))
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 4015, __pyx_L1_error)
+ __PYX_ERR(0, 4020, __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":4016
+ /* "pywrapfst.pyx":4021
* 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":4017
+ /* "pywrapfst.pyx":4022
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* if seed == 0:
* seed = time(NULL) # <<<<<<<<<<<<<<
*/
__pyx_v_seed = time(NULL);
- /* "pywrapfst.pyx":4016
+ /* "pywrapfst.pyx":4021
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* if seed == 0: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4018
+ /* "pywrapfst.pyx":4023
* if seed == 0:
* seed = time(NULL)
* fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), seed) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4018, __pyx_L1_error)
+ __PYX_ERR(0, 4023, __pyx_L1_error)
}
fst::script::RandGen((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts), __pyx_v_seed);
- /* "pywrapfst.pyx":4019
+ /* "pywrapfst.pyx":4024
* seed = time(NULL)
* fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), seed)
* 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, 4019, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4024, __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":3970
+ /* "pywrapfst.pyx":3975
*
*
* 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, 3970, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randgen") < 0)) __PYX_ERR(0, 3975, __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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3971, __pyx_L3_error)
+ __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[1]); if (unlikely((__pyx_v_npath == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3976, __pyx_L3_error)
} else {
__pyx_v_npath = ((int32)1);
}
__pyx_v_select = values[2];
if (values[3]) {
- __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[3]); if (unlikely((__pyx_v_max_length == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3973, __pyx_L3_error)
+ __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[3]); if (unlikely((__pyx_v_max_length == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3978, __pyx_L3_error)
} else {
__pyx_v_max_length = __pyx_k__46;
}
if (values[4]) {
- __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3974, __pyx_L3_error)
+ __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3979, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3974
+ /* "pywrapfst.pyx":3979
* select="uniform",
* int32 max_length=INT32_MAX,
* bool weighted=False, # <<<<<<<<<<<<<<
__pyx_v_weighted = ((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, 3975, __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, 3980, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3975
+ /* "pywrapfst.pyx":3980
* int32 max_length=INT32_MAX,
* bool weighted=False,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
__pyx_v_remove_total_weight = ((bool)0);
}
if (values[6]) {
- __pyx_v_seed = __Pyx_PyInt_As_uint64_t(values[6]); if (unlikely((__pyx_v_seed == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3976, __pyx_L3_error)
+ __pyx_v_seed = __Pyx_PyInt_As_uint64_t(values[6]); if (unlikely((__pyx_v_seed == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3981, __pyx_L3_error)
} else {
__pyx_v_seed = ((uint64)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("randgen", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3970, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randgen", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3975, __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, 3970, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3975, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_48randgen(__pyx_self, __pyx_v_ifst, __pyx_v_npath, __pyx_v_select, __pyx_v_max_length, __pyx_v_weighted, __pyx_v_remove_total_weight, __pyx_v_seed);
- /* "pywrapfst.pyx":3970
+ /* "pywrapfst.pyx":3975
*
*
* cpdef MutableFst randgen(Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_2.remove_total_weight = __pyx_v_weighted;
__pyx_t_2.weighted = __pyx_v_remove_total_weight;
__pyx_t_2.seed = __pyx_v_seed;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_randgen(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3970, __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, 3975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4022
+/* "pywrapfst.pyx":4027
*
*
* cpdef MutableFst replace(pairs, # <<<<<<<<<<<<<<
PyObject *__pyx_v_call_arc_labeling = ((PyObject *)__pyx_n_u_input);
PyObject *__pyx_v_return_arc_labeling = ((PyObject *)__pyx_n_u_neither);
- /* "pywrapfst.pyx":4025
+ /* "pywrapfst.pyx":4030
* call_arc_labeling="input",
* return_arc_labeling="neither",
* bool epsilon_on_replace=False, # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":4066
+ /* "pywrapfst.pyx":4071
* cdef Fst _pfst
* cdef vector[fst.LabelFstClassPair] _pairs
* for (_label, _pfst) in pairs: # <<<<<<<<<<<<<<
__pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4066, __pyx_L1_error)
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4071, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4066, __pyx_L1_error)
+ __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4071, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_3)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4066, __pyx_L1_error)
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4071, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4066, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4071, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
} else {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4066, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4071, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4066, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4071, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 4066, __pyx_L1_error)
+ else __PYX_ERR(0, 4071, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 4066, __pyx_L1_error)
+ __PYX_ERR(0, 4071, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4066, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4071, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4066, __pyx_L1_error)
+ __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4071, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4066, __pyx_L1_error)
+ __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4071, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
__Pyx_GOTREF(__pyx_t_5);
index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 4066, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 4071, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 4066, __pyx_L1_error)
+ __PYX_ERR(0, 4071, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
- __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_9 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4066, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_9 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4071, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 4066, __pyx_L1_error)
+ if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 4071, __pyx_L1_error)
__pyx_v__label = __pyx_t_9;
__Pyx_XDECREF_SET(__pyx_v__pfst, ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_6));
__pyx_t_6 = 0;
- /* "pywrapfst.pyx":4067
+ /* "pywrapfst.pyx":4072
* cdef vector[fst.LabelFstClassPair] _pairs
* for (_label, _pfst) in pairs:
* _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v__pfst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4067, __pyx_L1_error)
+ __PYX_ERR(0, 4072, __pyx_L1_error)
}
try {
__pyx_t_10 = __pyx_t_10cpywrapfst_LabelFstClassPair(__pyx_v__label, __pyx_v__pfst->_fst.get());
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 4067, __pyx_L1_error)
+ __PYX_ERR(0, 4072, __pyx_L1_error)
}
try {
__pyx_v__pairs.push_back(__pyx_t_10);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 4067, __pyx_L1_error)
+ __PYX_ERR(0, 4072, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4066
+ /* "pywrapfst.pyx":4071
* cdef Fst _pfst
* cdef vector[fst.LabelFstClassPair] _pairs
* for (_label, _pfst) in pairs: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":4069
+ /* "pywrapfst.pyx":4074
* _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get()))
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType())) # <<<<<<<<<<<<<<
*/
__pyx_v__tfst.reset(new fst::script::VectorFstClass((__pyx_v__pairs[0]).second->ArcType()));
- /* "pywrapfst.pyx":4071
+ /* "pywrapfst.pyx":4076
* _tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))
* 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_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_call_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4071, __pyx_L1_error)
+ __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_call_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4076, __pyx_L1_error)
- /* "pywrapfst.pyx":4070
+ /* "pywrapfst.pyx":4075
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))
* cdef fst.ReplaceLabelType _cal = _get_replace_label_type( # <<<<<<<<<<<<<<
* tostring(call_arc_labeling),
* epsilon_on_replace)
*/
- __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, 4070, __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, 4075, __pyx_L1_error)
__pyx_v__cal = __pyx_t_12;
- /* "pywrapfst.pyx":4074
+ /* "pywrapfst.pyx":4079
* 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_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_return_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4074, __pyx_L1_error)
+ __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_return_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4079, __pyx_L1_error)
- /* "pywrapfst.pyx":4073
+ /* "pywrapfst.pyx":4078
* tostring(call_arc_labeling),
* epsilon_on_replace)
* cdef fst.ReplaceLabelType _ral = _get_replace_label_type( # <<<<<<<<<<<<<<
* tostring(return_arc_labeling),
* epsilon_on_replace)
*/
- __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, 4073, __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, 4078, __pyx_L1_error)
__pyx_v__ral = __pyx_t_12;
- /* "pywrapfst.pyx":4077
+ /* "pywrapfst.pyx":4082
* epsilon_on_replace)
* cdef unique_ptr[fst.ReplaceOptions] _opts
* _opts.reset(new fst.ReplaceOptions(_pairs[0].first, _cal, _ral, return_label)) # <<<<<<<<<<<<<<
*/
__pyx_v__opts.reset(new fst::script::ReplaceOptions((__pyx_v__pairs[0]).first, __pyx_v__cal, __pyx_v__ral, __pyx_v_return_label));
- /* "pywrapfst.pyx":4078
+ /* "pywrapfst.pyx":4083
* cdef unique_ptr[fst.ReplaceOptions] _opts
* _opts.reset(new fst.ReplaceOptions(_pairs[0].first, _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":4079
+ /* "pywrapfst.pyx":4084
* _opts.reset(new fst.ReplaceOptions(_pairs[0].first, _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, 4079, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4084, __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":4022
+ /* "pywrapfst.pyx":4027
*
*
* 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, 4022, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(0, 4027, __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, 4025, __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, 4030, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4025
+ /* "pywrapfst.pyx":4030
* call_arc_labeling="input",
* return_arc_labeling="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)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4026, __pyx_L3_error)
+ __pyx_v_return_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_return_label == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4031, __pyx_L3_error)
} else {
__pyx_v_return_label = ((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, 4022, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("replace", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4027, __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_50replace(__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":4022
+ /* "pywrapfst.pyx":4027
*
*
* 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, 4022, __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, 4027, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4082
+/* "pywrapfst.pyx":4087
*
*
* cpdef MutableFst reverse(Fst ifst, bool require_superinitial=True): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":4102
+ /* "pywrapfst.pyx":4107
* """
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 4102, __pyx_L1_error)
+ __PYX_ERR(0, 4107, __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":4103
+ /* "pywrapfst.pyx":4108
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.Reverse(deref(ifst._fst), _tfst.get(), require_superinitial) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4103, __pyx_L1_error)
+ __PYX_ERR(0, 4108, __pyx_L1_error)
}
fst::script::Reverse((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_v_require_superinitial);
- /* "pywrapfst.pyx":4104
+ /* "pywrapfst.pyx":4109
* _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, 4104, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4109, __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":4082
+ /* "pywrapfst.pyx":4087
*
*
* 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, 4082, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reverse") < 0)) __PYX_ERR(0, 4087, __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, 4082, __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, 4087, __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, 4082, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4087, __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, 4082, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4087, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_52reverse(__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, 4082, __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, 4087, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4110
+/* "pywrapfst.pyx":4115
*
*
* cdef void _shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
int64 __pyx_v_nstate = __pyx_k__48;
PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":4115
+ /* "pywrapfst.pyx":4120
* int64 nstate=fst.kNoStateId,
* queue_type="auto",
* bool reverse=False) except *: # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":4117
+ /* "pywrapfst.pyx":4122
* bool reverse=False) except *:
* cdef unique_ptr[fst.ShortestDistanceOptions] _opts
* if reverse: # <<<<<<<<<<<<<<
__pyx_t_1 = (__pyx_v_reverse != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":4120
+ /* "pywrapfst.pyx":4125
* # Only the simpler signature supports shortest distance to final states;
* # `nstate` and `queue_type` arguments are ignored.
* fst.ShortestDistance(deref(ifst._fst), distance, True, delta) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4120, __pyx_L1_error)
+ __PYX_ERR(0, 4125, __pyx_L1_error)
}
fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance, 1, __pyx_v_delta);
- /* "pywrapfst.pyx":4117
+ /* "pywrapfst.pyx":4122
* bool reverse=False) except *:
* cdef unique_ptr[fst.ShortestDistanceOptions] _opts
* if reverse: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":4122
+ /* "pywrapfst.pyx":4127
* fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
* else:
* _opts.reset( # <<<<<<<<<<<<<<
*/
/*else*/ {
- /* "pywrapfst.pyx":4123
+ /* "pywrapfst.pyx":4128
* else:
* _opts.reset(
* new fst.ShortestDistanceOptions(_get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
* fst.ANY_ARC_FILTER,
* nstate,
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4123, __pyx_L1_error)
- __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4123, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4128, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4128, __pyx_L1_error)
- /* "pywrapfst.pyx":4122
+ /* "pywrapfst.pyx":4127
* fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
* else:
* _opts.reset( # <<<<<<<<<<<<<<
*/
__pyx_v__opts.reset(new fst::script::ShortestDistanceOptions(__pyx_t_3, fst::script::ANY_ARC_FILTER, __pyx_v_nstate, __pyx_v_delta));
- /* "pywrapfst.pyx":4127
+ /* "pywrapfst.pyx":4132
* nstate,
* delta))
* fst.ShortestDistance(deref(ifst._fst), distance, deref(_opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4127, __pyx_L1_error)
+ __PYX_ERR(0, 4132, __pyx_L1_error)
}
fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance, (*__pyx_v__opts));
}
__pyx_L3:;
- /* "pywrapfst.pyx":4110
+ /* "pywrapfst.pyx":4115
*
*
* cdef void _shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":4130
+/* "pywrapfst.pyx":4135
*
*
* def shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 4130, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 4135, __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, 4131, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 4136, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__49;
}
if (values[2]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4132, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4137, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__50;
}
__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, 4134, __pyx_L3_error)
+ __pyx_v_reverse = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_reverse == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4139, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4134
+ /* "pywrapfst.pyx":4139
* int64 nstate=fst.kNoStateId,
* queue_type="auto",
* bool reverse=False): # <<<<<<<<<<<<<<
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4130, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4135, __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, 4130, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4135, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_54shortestdistance(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_queue_type, __pyx_v_reverse);
- /* "pywrapfst.pyx":4130
+ /* "pywrapfst.pyx":4135
*
*
* def shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("shortestdistance", 0);
- /* "pywrapfst.pyx":4162
+ /* "pywrapfst.pyx":4167
* """
* cdef vector[fst.WeightClass] _distance
* _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse) # <<<<<<<<<<<<<<
__pyx_t_1.nstate = __pyx_v_nstate;
__pyx_t_1.queue_type = __pyx_v_queue_type;
__pyx_t_1.reverse = __pyx_v_reverse;
- __pyx_f_9pywrapfst__shortestdistance(__pyx_v_ifst, (&__pyx_v__distance), &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4162, __pyx_L1_error)
+ __pyx_f_9pywrapfst__shortestdistance(__pyx_v_ifst, (&__pyx_v__distance), &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4167, __pyx_L1_error)
- /* "pywrapfst.pyx":4163
+ /* "pywrapfst.pyx":4168
* cdef vector[fst.WeightClass] _distance
* _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
* return [Weight(ifst._fst.get().WeightType(), weight.ToString()) # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
{ /* enter inner scope */
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4163, __pyx_L1_error)
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4164
+ /* "pywrapfst.pyx":4169
* _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
* return [Weight(ifst._fst.get().WeightType(), weight.ToString())
* for weight in _distance] # <<<<<<<<<<<<<<
++__pyx_t_3;
__pyx_7genexpr__pyx_v_weight = __pyx_t_4;
- /* "pywrapfst.pyx":4163
+ /* "pywrapfst.pyx":4168
* cdef vector[fst.WeightClass] _distance
* _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
* return [Weight(ifst._fst.get().WeightType(), weight.ToString()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4163, __pyx_L1_error)
+ __PYX_ERR(0, 4168, __pyx_L1_error)
}
- __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_ifst->_fst.get()->WeightType()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4163, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_ifst->_fst.get()->WeightType()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_7genexpr__pyx_v_weight.ToString()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4163, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_7genexpr__pyx_v_weight.ToString()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4163, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
__pyx_t_5 = 0;
__pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4163, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 4163, __pyx_L1_error)
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 4168, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "pywrapfst.pyx":4164
+ /* "pywrapfst.pyx":4169
* _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
* return [Weight(ifst._fst.get().WeightType(), weight.ToString())
* for weight in _distance] # <<<<<<<<<<<<<<
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4130
+ /* "pywrapfst.pyx":4135
*
*
* def shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4167
+/* "pywrapfst.pyx":4172
*
*
* cpdef MutableFst shortestpath(Fst ifst, # <<<<<<<<<<<<<<
int64 __pyx_v_nstate = __pyx_k__52;
PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":4172
+ /* "pywrapfst.pyx":4177
* int64 nstate=fst.kNoStateId,
* queue_type="auto",
* bool unique=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_unique = ((bool)0);
- /* "pywrapfst.pyx":4173
+ /* "pywrapfst.pyx":4178
* queue_type="auto",
* bool unique=False,
* weight=None): # <<<<<<<<<<<<<<
}
}
- /* "pywrapfst.pyx":4205
+ /* "pywrapfst.pyx":4210
* """
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 4205, __pyx_L1_error)
+ __PYX_ERR(0, 4210, __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":4207
+ /* "pywrapfst.pyx":4212
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(), # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _weight = _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 '%.30s'", "weight_type");
- __PYX_ERR(0, 4207, __pyx_L1_error)
+ __PYX_ERR(0, 4212, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4208
+ /* "pywrapfst.pyx":4213
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
* weight) # <<<<<<<<<<<<<<
* cdef unique_ptr[fst.ShortestPathOptions] _opts
* _opts.reset(
*/
- __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, 4207, __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, 4212, __pyx_L1_error)
__pyx_v__weight = __pyx_t_1;
- /* "pywrapfst.pyx":4211
+ /* "pywrapfst.pyx":4216
* cdef unique_ptr[fst.ShortestPathOptions] _opts
* _opts.reset(
* new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
* nshortest,
* unique,
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4211, __pyx_L1_error)
- __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4211, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4216, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4216, __pyx_L1_error)
- /* "pywrapfst.pyx":4210
+ /* "pywrapfst.pyx":4215
* weight)
* cdef unique_ptr[fst.ShortestPathOptions] _opts
* _opts.reset( # <<<<<<<<<<<<<<
*/
__pyx_v__opts.reset(new fst::script::ShortestPathOptions(__pyx_t_3, __pyx_v_nshortest, __pyx_v_unique, __pyx_v_delta, __pyx_v__weight, __pyx_v_nstate));
- /* "pywrapfst.pyx":4217
+ /* "pywrapfst.pyx":4222
* _weight,
* nstate))
* fst.ShortestPath(deref(ifst._fst), _tfst.get(), deref(_opts)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4217, __pyx_L1_error)
+ __PYX_ERR(0, 4222, __pyx_L1_error)
}
fst::script::ShortestPath((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":4218
+ /* "pywrapfst.pyx":4223
* nstate))
* fst.ShortestPath(deref(ifst._fst), _tfst.get(), deref(_opts))
* return _init_MutableFst(_tfst.release()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4218, __pyx_L1_error)
+ __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4223, __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":4167
+ /* "pywrapfst.pyx":4172
*
*
* cpdef MutableFst shortestpath(Fst ifst, # <<<<<<<<<<<<<<
PyObject* values[7] = {0,0,0,0,0,0,0};
values[4] = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":4173
+ /* "pywrapfst.pyx":4178
* queue_type="auto",
* bool unique=False,
* weight=None): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestpath") < 0)) __PYX_ERR(0, 4167, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestpath") < 0)) __PYX_ERR(0, 4172, __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, 4168, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 4173, __pyx_L3_error)
} else {
__pyx_v_delta = __pyx_k__51;
}
if (values[2]) {
- __pyx_v_nshortest = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_nshortest == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4169, __pyx_L3_error)
+ __pyx_v_nshortest = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_nshortest == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4174, __pyx_L3_error)
} else {
__pyx_v_nshortest = ((int32)1);
}
if (values[3]) {
- __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4170, __pyx_L3_error)
+ __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4175, __pyx_L3_error)
} else {
__pyx_v_nstate = __pyx_k__52;
}
__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, 4172, __pyx_L3_error)
+ __pyx_v_unique = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_unique == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4177, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4172
+ /* "pywrapfst.pyx":4177
* int64 nstate=fst.kNoStateId,
* queue_type="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, 4167, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4172, __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, 4167, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4172, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_56shortestpath(__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":4167
+ /* "pywrapfst.pyx":4172
*
*
* cpdef MutableFst shortestpath(Fst ifst, # <<<<<<<<<<<<<<
__pyx_t_2.queue_type = __pyx_v_queue_type;
__pyx_t_2.unique = __pyx_v_unique;
__pyx_t_2.weight = __pyx_v_weight;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_shortestpath(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4167, __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, 4172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4221
+/* "pywrapfst.pyx":4226
*
*
* cpdef Fst statemap(Fst ifst, map_type): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("statemap", 0);
- /* "pywrapfst.pyx":4244
+ /* "pywrapfst.pyx":4249
* FstArgError: Unknown map type.
* """
* return _map(ifst, fst.kDelta, map_type, 1., None) # <<<<<<<<<<<<<<
__pyx_t_2.map_type = __pyx_v_map_type;
__pyx_t_2.power = 1.;
__pyx_t_2.weight = Py_None;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__map(__pyx_v_ifst, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4244, __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, 4249, __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":4221
+ /* "pywrapfst.pyx":4226
*
*
* cpdef Fst statemap(Fst ifst, map_type): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_map_type)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4221, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4226, __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, 4221, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "statemap") < 0)) __PYX_ERR(0, 4226, __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, 4221, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4226, __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, 4221, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4226, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_58statemap(__pyx_self, __pyx_v_ifst, __pyx_v_map_type);
/* function exit code */
int __pyx_clineno = 0;
__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, 4221, __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, 4226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4247
+/* "pywrapfst.pyx":4252
*
*
* cpdef MutableFst synchronize(Fst ifst): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("synchronize", 0);
- /* "pywrapfst.pyx":4267
+ /* "pywrapfst.pyx":4272
* """
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 4267, __pyx_L1_error)
+ __PYX_ERR(0, 4272, __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":4268
+ /* "pywrapfst.pyx":4273
* cdef unique_ptr[fst.VectorFstClass] _tfst
* _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.Synchronize(deref(ifst._fst), _tfst.get()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4268, __pyx_L1_error)
+ __PYX_ERR(0, 4273, __pyx_L1_error)
}
fst::script::Synchronize((*__pyx_v_ifst->_fst), __pyx_v__tfst.get());
- /* "pywrapfst.pyx":4269
+ /* "pywrapfst.pyx":4274
* _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, 4269, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4274, __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":4247
+ /* "pywrapfst.pyx":4252
*
*
* cpdef MutableFst synchronize(Fst ifst): # <<<<<<<<<<<<<<
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("synchronize (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4247, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4252, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_60synchronize(__pyx_self, ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_ifst));
/* function exit code */
int __pyx_clineno = 0;
__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, 4247, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_synchronize(__pyx_v_ifst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4326
+/* "pywrapfst.pyx":4331
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
values[0] = ((PyObject*)__pyx_n_u_vector);
values[1] = ((PyObject*)__pyx_n_u_standard);
- /* "pywrapfst.pyx":4329
+ /* "pywrapfst.pyx":4334
* str fst_type="vector",
* str arc_type="standard",
* SymbolTable isymbols=None, # <<<<<<<<<<<<<<
*/
values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
- /* "pywrapfst.pyx":4330
+ /* "pywrapfst.pyx":4335
* str arc_type="standard",
* SymbolTable isymbols=None,
* SymbolTable osymbols=None, # <<<<<<<<<<<<<<
*/
values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
- /* "pywrapfst.pyx":4331
+ /* "pywrapfst.pyx":4336
* 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, 4326, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 4331, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
__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, 4332, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4337, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4332
+ /* "pywrapfst.pyx":4337
* 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, 4333, __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, 4338, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4333
+ /* "pywrapfst.pyx":4338
* 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, 4334, __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, 4339, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4334
+ /* "pywrapfst.pyx":4339
* 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, 4335, __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, 4340, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4335
+ /* "pywrapfst.pyx":4340
* 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, 4336, __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, 4341, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4336
+ /* "pywrapfst.pyx":4341
* 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, 4326, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4331, __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_fst_type), (&PyUnicode_Type), 1, "fst_type", 1))) __PYX_ERR(0, 4327, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc_type), (&PyUnicode_Type), 1, "arc_type", 1))) __PYX_ERR(0, 4328, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 4329, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4330, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4331, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst_type), (&PyUnicode_Type), 1, "fst_type", 1))) __PYX_ERR(0, 4332, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc_type), (&PyUnicode_Type), 1, "arc_type", 1))) __PYX_ERR(0, 4333, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 4334, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4335, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4336, __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":4326
+ /* "pywrapfst.pyx":4331
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "pywrapfst.pyx":4337
+ /* "pywrapfst.pyx":4342
* bool keep_state_numbering=False,
* bool allow_negative_labels=False):
* self._sstrm.reset(new stringstream()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
- __PYX_ERR(0, 4337, __pyx_L1_error)
+ __PYX_ERR(0, 4342, __pyx_L1_error)
}
__pyx_v_self->_sstrm.reset(new std::stringstream());
- /* "pywrapfst.pyx":4338
+ /* "pywrapfst.pyx":4343
* 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_f_9pywrapfst_tostring(__pyx_v_fst_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4338, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst_type");
- __PYX_ERR(0, 4338, __pyx_L1_error)
+ __PYX_ERR(0, 4343, __pyx_L1_error)
}
__pyx_v_self->_fst_type = __pyx_t_1;
- /* "pywrapfst.pyx":4339
+ /* "pywrapfst.pyx":4344
* 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_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4339, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4344, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc_type");
- __PYX_ERR(0, 4339, __pyx_L1_error)
+ __PYX_ERR(0, 4344, __pyx_L1_error)
}
__pyx_v_self->_arc_type = __pyx_t_1;
- /* "pywrapfst.pyx":4340
+ /* "pywrapfst.pyx":4345
* self._fst_type = tostring(fst_type)
* self._arc_type = tostring(arc_type)
* self._isymbols = NULL # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
- __PYX_ERR(0, 4340, __pyx_L1_error)
+ __PYX_ERR(0, 4345, __pyx_L1_error)
}
__pyx_v_self->_isymbols = NULL;
- /* "pywrapfst.pyx":4341
+ /* "pywrapfst.pyx":4346
* self._arc_type = tostring(arc_type)
* self._isymbols = NULL
* if isymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":4342
+ /* "pywrapfst.pyx":4347
* self._isymbols = NULL
* if isymbols is not None:
* self._isymbols = isymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 4342, __pyx_L1_error)
+ __PYX_ERR(0, 4347, __pyx_L1_error)
}
- __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_isymbols->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raw_ptr_or_raise(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_isymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4342, __pyx_L1_error)
+ __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_isymbols->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raw_ptr_or_raise(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_isymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4347, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
- __PYX_ERR(0, 4342, __pyx_L1_error)
+ __PYX_ERR(0, 4347, __pyx_L1_error)
}
__pyx_v_self->_isymbols = __pyx_t_4;
- /* "pywrapfst.pyx":4341
+ /* "pywrapfst.pyx":4346
* self._arc_type = tostring(arc_type)
* self._isymbols = NULL
* if isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4343
+ /* "pywrapfst.pyx":4348
* if isymbols is not None:
* self._isymbols = isymbols._raw_ptr_or_raise()
* self._osymbols = NULL # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
- __PYX_ERR(0, 4343, __pyx_L1_error)
+ __PYX_ERR(0, 4348, __pyx_L1_error)
}
__pyx_v_self->_osymbols = NULL;
- /* "pywrapfst.pyx":4344
+ /* "pywrapfst.pyx":4349
* self._isymbols = isymbols._raw_ptr_or_raise()
* self._osymbols = NULL
* if osymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":4345
+ /* "pywrapfst.pyx":4350
* self._osymbols = NULL
* if osymbols is not None:
* self._osymbols = osymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 4345, __pyx_L1_error)
+ __PYX_ERR(0, 4350, __pyx_L1_error)
}
- __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_osymbols->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raw_ptr_or_raise(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_osymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4345, __pyx_L1_error)
+ __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_osymbols->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raw_ptr_or_raise(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_osymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4350, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
- __PYX_ERR(0, 4345, __pyx_L1_error)
+ __PYX_ERR(0, 4350, __pyx_L1_error)
}
__pyx_v_self->_osymbols = __pyx_t_4;
- /* "pywrapfst.pyx":4344
+ /* "pywrapfst.pyx":4349
* self._isymbols = isymbols._raw_ptr_or_raise()
* self._osymbols = NULL
* if osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4346
+ /* "pywrapfst.pyx":4351
* if osymbols is not None:
* self._osymbols = osymbols._raw_ptr_or_raise()
* self._ssymbols = NULL # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
- __PYX_ERR(0, 4346, __pyx_L1_error)
+ __PYX_ERR(0, 4351, __pyx_L1_error)
}
__pyx_v_self->_ssymbols = NULL;
- /* "pywrapfst.pyx":4347
+ /* "pywrapfst.pyx":4352
* self._osymbols = osymbols._raw_ptr_or_raise()
* self._ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":4348
+ /* "pywrapfst.pyx":4353
* self._ssymbols = NULL
* if ssymbols is not None:
* self._ssymbols = ssymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
- __PYX_ERR(0, 4348, __pyx_L1_error)
+ __PYX_ERR(0, 4353, __pyx_L1_error)
}
- __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_ssymbols->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raw_ptr_or_raise(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_ssymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4348, __pyx_L1_error)
+ __pyx_t_4 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_ssymbols->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raw_ptr_or_raise(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_ssymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4353, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
- __PYX_ERR(0, 4348, __pyx_L1_error)
+ __PYX_ERR(0, 4353, __pyx_L1_error)
}
__pyx_v_self->_ssymbols = __pyx_t_4;
- /* "pywrapfst.pyx":4347
+ /* "pywrapfst.pyx":4352
* self._osymbols = osymbols._raw_ptr_or_raise()
* self._ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4349
+ /* "pywrapfst.pyx":4354
* if ssymbols is not None:
* self._ssymbols = ssymbols._raw_ptr_or_raise()
* self._acceptor = acceptor # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_acceptor");
- __PYX_ERR(0, 4349, __pyx_L1_error)
+ __PYX_ERR(0, 4354, __pyx_L1_error)
}
__pyx_v_self->_acceptor = __pyx_v_acceptor;
- /* "pywrapfst.pyx":4350
+ /* "pywrapfst.pyx":4355
* self._ssymbols = ssymbols._raw_ptr_or_raise()
* self._acceptor = acceptor
* self._keep_isymbols = keep_isymbols # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_isymbols");
- __PYX_ERR(0, 4350, __pyx_L1_error)
+ __PYX_ERR(0, 4355, __pyx_L1_error)
}
__pyx_v_self->_keep_isymbols = __pyx_v_keep_isymbols;
- /* "pywrapfst.pyx":4351
+ /* "pywrapfst.pyx":4356
* self._acceptor = acceptor
* self._keep_isymbols = keep_isymbols
* self._keep_osymbols = keep_osymbols # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_osymbols");
- __PYX_ERR(0, 4351, __pyx_L1_error)
+ __PYX_ERR(0, 4356, __pyx_L1_error)
}
__pyx_v_self->_keep_osymbols = __pyx_v_keep_osymbols;
- /* "pywrapfst.pyx":4352
+ /* "pywrapfst.pyx":4357
* self._keep_isymbols = keep_isymbols
* self._keep_osymbols = keep_osymbols
* self._keep_state_numbering = keep_state_numbering # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_state_numbering");
- __PYX_ERR(0, 4352, __pyx_L1_error)
+ __PYX_ERR(0, 4357, __pyx_L1_error)
}
__pyx_v_self->_keep_state_numbering = __pyx_v_keep_state_numbering;
- /* "pywrapfst.pyx":4353
+ /* "pywrapfst.pyx":4358
* self._keep_osymbols = keep_osymbols
* self._keep_state_numbering = keep_state_numbering
* self._allow_negative_labels = allow_negative_labels # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_allow_negative_labels");
- __PYX_ERR(0, 4353, __pyx_L1_error)
+ __PYX_ERR(0, 4358, __pyx_L1_error)
}
__pyx_v_self->_allow_negative_labels = __pyx_v_allow_negative_labels;
- /* "pywrapfst.pyx":4326
+ /* "pywrapfst.pyx":4331
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4355
+/* "pywrapfst.pyx":4360
* self._allow_negative_labels = allow_negative_labels
*
* cpdef Fst compile(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4355, __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, 4360, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_8Compiler_3compile)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4355, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4360, __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, 4355, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 4360, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4370
+ /* "pywrapfst.pyx":4375
* """
* cdef unique_ptr[fst.FstClass] _tfst
* _tfst.reset(fst.CompileFstInternal(deref(self._sstrm), # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
- __PYX_ERR(0, 4370, __pyx_L1_error)
+ __PYX_ERR(0, 4375, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4372
+ /* "pywrapfst.pyx":4377
* _tfst.reset(fst.CompileFstInternal(deref(self._sstrm),
* b"<pywrapfst>",
* self._fst_type, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst_type");
- __PYX_ERR(0, 4372, __pyx_L1_error)
+ __PYX_ERR(0, 4377, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4373
+ /* "pywrapfst.pyx":4378
* b"<pywrapfst>",
* self._fst_type,
* self._arc_type, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc_type");
- __PYX_ERR(0, 4373, __pyx_L1_error)
+ __PYX_ERR(0, 4378, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4374
+ /* "pywrapfst.pyx":4379
* self._fst_type,
* self._arc_type,
* self._isymbols, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
- __PYX_ERR(0, 4374, __pyx_L1_error)
+ __PYX_ERR(0, 4379, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4375
+ /* "pywrapfst.pyx":4380
* self._arc_type,
* self._isymbols,
* self._osymbols, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
- __PYX_ERR(0, 4375, __pyx_L1_error)
+ __PYX_ERR(0, 4380, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4376
+ /* "pywrapfst.pyx":4381
* self._isymbols,
* self._osymbols,
* self._ssymbols, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
- __PYX_ERR(0, 4376, __pyx_L1_error)
+ __PYX_ERR(0, 4381, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4377
+ /* "pywrapfst.pyx":4382
* self._osymbols,
* self._ssymbols,
* self._acceptor, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_acceptor");
- __PYX_ERR(0, 4377, __pyx_L1_error)
+ __PYX_ERR(0, 4382, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4378
+ /* "pywrapfst.pyx":4383
* self._ssymbols,
* self._acceptor,
* self._keep_isymbols, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_isymbols");
- __PYX_ERR(0, 4378, __pyx_L1_error)
+ __PYX_ERR(0, 4383, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4379
+ /* "pywrapfst.pyx":4384
* self._acceptor,
* self._keep_isymbols,
* self._keep_osymbols, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_osymbols");
- __PYX_ERR(0, 4379, __pyx_L1_error)
+ __PYX_ERR(0, 4384, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4380
+ /* "pywrapfst.pyx":4385
* self._keep_isymbols,
* self._keep_osymbols,
* self._keep_state_numbering, # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_state_numbering");
- __PYX_ERR(0, 4380, __pyx_L1_error)
+ __PYX_ERR(0, 4385, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4381
+ /* "pywrapfst.pyx":4386
* self._keep_osymbols,
* self._keep_state_numbering,
* self._allow_negative_labels)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_allow_negative_labels");
- __PYX_ERR(0, 4381, __pyx_L1_error)
+ __PYX_ERR(0, 4386, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4370
+ /* "pywrapfst.pyx":4375
* """
* cdef unique_ptr[fst.FstClass] _tfst
* _tfst.reset(fst.CompileFstInternal(deref(self._sstrm), # <<<<<<<<<<<<<<
*/
__pyx_v__tfst.reset(fst::script::CompileFstInternal((*__pyx_v_self->_sstrm), __pyx_k_pywrapfst, __pyx_v_self->_fst_type, __pyx_v_self->_arc_type, __pyx_v_self->_isymbols, __pyx_v_self->_osymbols, __pyx_v_self->_ssymbols, __pyx_v_self->_acceptor, __pyx_v_self->_keep_isymbols, __pyx_v_self->_keep_osymbols, __pyx_v_self->_keep_state_numbering, __pyx_v_self->_allow_negative_labels));
- /* "pywrapfst.pyx":4382
+ /* "pywrapfst.pyx":4387
* self._keep_state_numbering,
* self._allow_negative_labels))
* self._sstrm.reset(new stringstream()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
- __PYX_ERR(0, 4382, __pyx_L1_error)
+ __PYX_ERR(0, 4387, __pyx_L1_error)
}
__pyx_v_self->_sstrm.reset(new std::stringstream());
- /* "pywrapfst.pyx":4383
+ /* "pywrapfst.pyx":4388
* self._allow_negative_labels))
* self._sstrm.reset(new stringstream())
* if _tfst.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_5 = ((__pyx_v__tfst.get() == NULL) != 0);
if (unlikely(__pyx_t_5)) {
- /* "pywrapfst.pyx":4384
+ /* "pywrapfst.pyx":4389
* self._sstrm.reset(new stringstream())
* if _tfst.get() == NULL:
* raise FstOpError("Compilation failed") # <<<<<<<<<<<<<<
* return _init_XFst(_tfst.release())
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4384, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Compilation_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Compilation_failed);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4384, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4389, __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, 4384, __pyx_L1_error)
+ __PYX_ERR(0, 4389, __pyx_L1_error)
- /* "pywrapfst.pyx":4383
+ /* "pywrapfst.pyx":4388
* self._allow_negative_labels))
* self._sstrm.reset(new stringstream())
* if _tfst.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4385
+ /* "pywrapfst.pyx":4390
* if _tfst.get() == NULL:
* raise FstOpError("Compilation failed")
* return _init_XFst(_tfst.release()) # <<<<<<<<<<<<<<
* cpdef void write(self, expression):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4385, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4390, __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":4355
+ /* "pywrapfst.pyx":4360
* self._allow_negative_labels = allow_negative_labels
*
* cpdef Fst compile(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 4355, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_8Compiler_compile(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4360, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4387
+/* "pywrapfst.pyx":4392
* return _init_XFst(_tfst.release())
*
* cpdef void write(self, expression): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4387, __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, 4392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_8Compiler_5write)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_expression) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_expression);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4387, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":4403
+ /* "pywrapfst.pyx":4408
* expression: A string expression to add to compiler string buffer.
* """
* cdef string _line = tostring(expression) # <<<<<<<<<<<<<<
* if not _line.empty() and _line.back() != b'\n':
* _line.append(b'\n')
*/
- __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4403, __pyx_L1_error)
+ __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4408, __pyx_L1_error)
__pyx_v__line = __pyx_t_5;
- /* "pywrapfst.pyx":4404
+ /* "pywrapfst.pyx":4409
* """
* cdef string _line = tostring(expression)
* if not _line.empty() and _line.back() != b'\n': # <<<<<<<<<<<<<<
__pyx_L4_bool_binop_done:;
if (__pyx_t_6) {
- /* "pywrapfst.pyx":4405
+ /* "pywrapfst.pyx":4410
* cdef string _line = tostring(expression)
* if not _line.empty() and _line.back() != b'\n':
* _line.append(b'\n') # <<<<<<<<<<<<<<
*/
(void)(__pyx_v__line.append(((char const *)"\n")));
- /* "pywrapfst.pyx":4404
+ /* "pywrapfst.pyx":4409
* """
* cdef string _line = tostring(expression)
* if not _line.empty() and _line.back() != b'\n': # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4406
+ /* "pywrapfst.pyx":4411
* if not _line.empty() and _line.back() != b'\n':
* _line.append(b'\n')
* deref(self._sstrm) << _line # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
- __PYX_ERR(0, 4406, __pyx_L1_error)
+ __PYX_ERR(0, 4411, __pyx_L1_error)
}
(void)(((*__pyx_v_self->_sstrm) << __pyx_v__line));
- /* "pywrapfst.pyx":4387
+ /* "pywrapfst.pyx":4392
* return _init_XFst(_tfst.release())
*
* cpdef void write(self, expression): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 4387, __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, 4392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4428
+/* "pywrapfst.pyx":4433
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":4429
+ /* "pywrapfst.pyx":4434
*
* def __init__(self):
* raise NotImplementedError(f"Cannot construct {self.__class__.__name__}") # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4429, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4429, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4429, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_construct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4429, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_construct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4429, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4434, __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, 4429, __pyx_L1_error)
+ __PYX_ERR(0, 4434, __pyx_L1_error)
- /* "pywrapfst.pyx":4428
+ /* "pywrapfst.pyx":4433
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4431
+/* "pywrapfst.pyx":4436
* raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":4432
+ /* "pywrapfst.pyx":4437
*
* def __repr__(self):
* return f"<{self.far_type()} FarReader at 0x{id(self):x}>" # <<<<<<<<<<<<<<
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4432, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "far_type");
- __PYX_ERR(0, 4432, __pyx_L1_error)
+ __PYX_ERR(0, 4437, __pyx_L1_error)
}
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4432, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__pyx_t_2 += 16;
__Pyx_GIVEREF(__pyx_kp_u_FarReader_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_FarReader_at_0x);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4432, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4432, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4432, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4431
+ /* "pywrapfst.pyx":4436
* raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4435
+/* "pywrapfst.pyx":4440
*
* @classmethod
* def open(cls, *sources): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("open", 0);
- /* "pywrapfst.pyx":4453
+ /* "pywrapfst.pyx":4458
* FstIOError: Read failed.
* """
* cdef vector[string] _sources = [path_tostring(source) for source in sources] # <<<<<<<<<<<<<<
* _tfar.reset(fst.FarReaderClass.Open(_sources))
*/
{ /* enter inner scope */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4453, __pyx_L5_error)
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4458, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_v_sources; __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, 4453, __pyx_L5_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, 4458, __pyx_L5_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4453, __pyx_L5_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4458, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_source, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_5 = __pyx_f_9pywrapfst_path_tostring(__pyx_8genexpr1__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4453, __pyx_L5_error)
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4453, __pyx_L5_error)
+ __pyx_t_5 = __pyx_f_9pywrapfst_path_tostring(__pyx_8genexpr1__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4458, __pyx_L5_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4458, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4453, __pyx_L5_error)
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4458, __pyx_L5_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L1_error;
__pyx_L8_exit_scope:;
} /* exit inner scope */
- __pyx_t_6 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4453, __pyx_L1_error)
+ __pyx_t_6 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4458, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v__sources = __pyx_t_6;
- /* "pywrapfst.pyx":4455
+ /* "pywrapfst.pyx":4460
* cdef vector[string] _sources = [path_tostring(source) for source in sources]
* cdef unique_ptr[fst.FarReaderClass] _tfar
* _tfar.reset(fst.FarReaderClass.Open(_sources)) # <<<<<<<<<<<<<<
*/
__pyx_v__tfar.reset(fst::script::FarReaderClass::Open(__pyx_v__sources));
- /* "pywrapfst.pyx":4456
+ /* "pywrapfst.pyx":4461
* cdef unique_ptr[fst.FarReaderClass] _tfar
* _tfar.reset(fst.FarReaderClass.Open(_sources))
* if _tfar.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_7 = ((__pyx_v__tfar.get() == NULL) != 0);
if (unlikely(__pyx_t_7)) {
- /* "pywrapfst.pyx":4457
+ /* "pywrapfst.pyx":4462
* _tfar.reset(fst.FarReaderClass.Open(_sources))
* if _tfar.get() == NULL:
* raise FstIOError(f"Read failed: {sources!r}") # <<<<<<<<<<<<<<
* cdef FarReader reader = FarReader.__new__(FarReader)
* reader._reader.reset(_tfar.release())
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4457, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_sources), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4457, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_sources), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4457, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4457, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4462, __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, 4457, __pyx_L1_error)
+ __PYX_ERR(0, 4462, __pyx_L1_error)
- /* "pywrapfst.pyx":4456
+ /* "pywrapfst.pyx":4461
* cdef unique_ptr[fst.FarReaderClass] _tfar
* _tfar.reset(fst.FarReaderClass.Open(_sources))
* if _tfar.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4458
+ /* "pywrapfst.pyx":4463
* if _tfar.get() == NULL:
* raise FstIOError(f"Read failed: {sources!r}")
* cdef FarReader reader = FarReader.__new__(FarReader) # <<<<<<<<<<<<<<
* reader._reader.reset(_tfar.release())
* return reader
*/
- __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_FarReader(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarReader), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4458, __pyx_L1_error)
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_FarReader(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarReader), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4463, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v_reader = ((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":4459
+ /* "pywrapfst.pyx":4464
* raise FstIOError(f"Read failed: {sources!r}")
* cdef FarReader reader = FarReader.__new__(FarReader)
* reader._reader.reset(_tfar.release()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_reader) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4459, __pyx_L1_error)
+ __PYX_ERR(0, 4464, __pyx_L1_error)
}
__pyx_v_reader->_reader.reset(__pyx_v__tfar.release());
- /* "pywrapfst.pyx":4460
+ /* "pywrapfst.pyx":4465
* cdef FarReader reader = FarReader.__new__(FarReader)
* reader._reader.reset(_tfar.release())
* return reader # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_reader);
goto __pyx_L0;
- /* "pywrapfst.pyx":4435
+ /* "pywrapfst.pyx":4440
*
* @classmethod
* def open(cls, *sources): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4462
+/* "pywrapfst.pyx":4467
* return reader
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4462, __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, 4467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_7arc_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4462, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4467, __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, 4462, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4467, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4468
+ /* "pywrapfst.pyx":4473
* Returns a string indicating the arc type.
* """
* return self._reader.get().ArcType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4468, __pyx_L1_error)
+ __PYX_ERR(0, 4473, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":4462
+ /* "pywrapfst.pyx":4467
* return reader
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arc_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4462, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4470
+/* "pywrapfst.pyx":4475
* return self._reader.get().ArcType()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4470, __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, 4475, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_9done)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4470, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4475, __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, 4470, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4475, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4479
+ /* "pywrapfst.pyx":4484
* True if the iterator is exhausted, False otherwise.
* """
* return self._reader.get().Done() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4479, __pyx_L1_error)
+ __PYX_ERR(0, 4484, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":4470
+ /* "pywrapfst.pyx":4475
* return self._reader.get().ArcType()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 4470, __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, 4475, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4481
+/* "pywrapfst.pyx":4486
* return self._reader.get().Done()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4481, __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, 4486, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_11error)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4481, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4486, __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, 4481, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4486, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4490
+ /* "pywrapfst.pyx":4495
* True if the FarReader is in an errorful state, False otherwise.
* """
* return self._reader.get().Error() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4490, __pyx_L1_error)
+ __PYX_ERR(0, 4495, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->Error();
goto __pyx_L0;
- /* "pywrapfst.pyx":4481
+ /* "pywrapfst.pyx":4486
* return self._reader.get().Done()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 4481, __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, 4486, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4492
+/* "pywrapfst.pyx":4497
* return self._reader.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4492, __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, 4497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_13far_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4492, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4497, __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, 4492, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4497, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4493
+ /* "pywrapfst.pyx":4498
*
* cpdef string far_type(self):
* return fst.GetFarTypeString(self._reader.get().Type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4493, __pyx_L1_error)
+ __PYX_ERR(0, 4498, __pyx_L1_error)
}
__pyx_r = fst::GetFarTypeString(__pyx_v_self->_reader.get()->Type());
goto __pyx_L0;
- /* "pywrapfst.pyx":4492
+ /* "pywrapfst.pyx":4497
* return self._reader.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("far_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4492, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4495
+/* "pywrapfst.pyx":4500
* return fst.GetFarTypeString(self._reader.get().Type())
*
* cpdef bool find(self, key): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4495, __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, 4500, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_15find)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4495, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4500, __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, 4495, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4500, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4508
+ /* "pywrapfst.pyx":4513
* True if the key was found, False otherwise.
* """
* return self._reader.get().Find(tostring(key)) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4508, __pyx_L1_error)
+ __PYX_ERR(0, 4513, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4508, __pyx_L1_error)
+ __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4513, __pyx_L1_error)
__pyx_r = __pyx_v_self->_reader.get()->Find(__pyx_t_6);
goto __pyx_L0;
- /* "pywrapfst.pyx":4495
+ /* "pywrapfst.pyx":4500
* return fst.GetFarTypeString(self._reader.get().Type())
*
* cpdef bool find(self, key): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 4495, __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, 4500, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4510
+/* "pywrapfst.pyx":4515
* return self._reader.get().Find(tostring(key))
*
* cpdef Fst get_fst(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4510, __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, 4515, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_17get_fst)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4510, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4515, __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, 4510, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 4515, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4519
+ /* "pywrapfst.pyx":4524
* A copy of the FST at the current position.
* """
* return _init_XFst(new fst.FstClass(deref(self._reader.get().GetFstClass()))) # <<<<<<<<<<<<<<
__Pyx_XDECREF(((PyObject *)__pyx_r));
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4519, __pyx_L1_error)
+ __PYX_ERR(0, 4524, __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, 4519, __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, 4524, __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":4510
+ /* "pywrapfst.pyx":4515
* return self._reader.get().Find(tostring(key))
*
* cpdef Fst get_fst(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 4510, __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, 4515, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4521
+/* "pywrapfst.pyx":4526
* return _init_XFst(new fst.FstClass(deref(self._reader.get().GetFstClass())))
*
* cpdef string get_key(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4521, __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, 4526, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_19get_key)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4521, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4526, __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, 4521, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4526, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4530
+ /* "pywrapfst.pyx":4535
* The string key at the current position.
* """
* return self._reader.get().GetKey() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4530, __pyx_L1_error)
+ __PYX_ERR(0, 4535, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->GetKey();
goto __pyx_L0;
- /* "pywrapfst.pyx":4521
+ /* "pywrapfst.pyx":4526
* return _init_XFst(new fst.FstClass(deref(self._reader.get().GetFstClass())))
*
* cpdef string get_key(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_key", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_get_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4521, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_get_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4526, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4532
+/* "pywrapfst.pyx":4537
* return self._reader.get().GetKey()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4532, __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, 4537, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_21next)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4532, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4537, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":4538
+ /* "pywrapfst.pyx":4543
* Advances the iterator.
* """
* self._reader.get().Next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4538, __pyx_L1_error)
+ __PYX_ERR(0, 4543, __pyx_L1_error)
}
__pyx_v_self->_reader.get()->Next();
- /* "pywrapfst.pyx":4532
+ /* "pywrapfst.pyx":4537
* return self._reader.get().GetKey()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 4532, __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, 4537, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4540
+/* "pywrapfst.pyx":4545
* self._reader.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4540, __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, 4545, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarReader_23reset)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4540, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4545, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":4546
+ /* "pywrapfst.pyx":4551
* Resets the iterator to the initial position.
* """
* self._reader.get().Reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4546, __pyx_L1_error)
+ __PYX_ERR(0, 4551, __pyx_L1_error)
}
__pyx_v_self->_reader.get()->Reset();
- /* "pywrapfst.pyx":4540
+ /* "pywrapfst.pyx":4545
* self._reader.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 4540, __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, 4545, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4548
+/* "pywrapfst.pyx":4553
* self._reader.get().Reset()
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "pywrapfst.pyx":4549
+ /* "pywrapfst.pyx":4554
*
* def __getitem__(self, key):
* if self._reader.get().Find(tostring(key)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4549, __pyx_L1_error)
+ __PYX_ERR(0, 4554, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4549, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4554, __pyx_L1_error)
__pyx_t_2 = (__pyx_v_self->_reader.get()->Find(__pyx_t_1) != 0);
if (likely(__pyx_t_2)) {
- /* "pywrapfst.pyx":4550
+ /* "pywrapfst.pyx":4555
* def __getitem__(self, key):
* if self._reader.get().Find(tostring(key)):
* return self.get_fst() # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_r);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get_fst");
- __PYX_ERR(0, 4550, __pyx_L1_error)
+ __PYX_ERR(0, 4555, __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, 4550, __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, 4555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4549
+ /* "pywrapfst.pyx":4554
*
* def __getitem__(self, key):
* if self._reader.get().Find(tostring(key)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4552
+ /* "pywrapfst.pyx":4557
* return self.get_fst()
* else:
* raise KeyError(key) # <<<<<<<<<<<<<<
* def __next__(self):
*/
/*else*/ {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4552, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4557, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 4552, __pyx_L1_error)
+ __PYX_ERR(0, 4557, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4548
+ /* "pywrapfst.pyx":4553
* self._reader.get().Reset()
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4554
+/* "pywrapfst.pyx":4559
* raise KeyError(key)
*
* def __next__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "pywrapfst.pyx":4555
+ /* "pywrapfst.pyx":4560
*
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
- __PYX_ERR(0, 4555, __pyx_L1_error)
+ __PYX_ERR(0, 4560, __pyx_L1_error)
}
__pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":4556
+ /* "pywrapfst.pyx":4561
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* cdef Fst _fst = self.get_fst()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 4556, __pyx_L1_error)
+ __PYX_ERR(0, 4561, __pyx_L1_error)
- /* "pywrapfst.pyx":4555
+ /* "pywrapfst.pyx":4560
*
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4557
+ /* "pywrapfst.pyx":4562
* if self.done():
* raise StopIteration
* cdef string _key = self.get_key() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get_key");
- __PYX_ERR(0, 4557, __pyx_L1_error)
+ __PYX_ERR(0, 4562, __pyx_L1_error)
}
__pyx_v__key = ((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_key(__pyx_v_self, 0);
- /* "pywrapfst.pyx":4558
+ /* "pywrapfst.pyx":4563
* raise StopIteration
* cdef string _key = self.get_key()
* cdef Fst _fst = self.get_fst() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get_fst");
- __PYX_ERR(0, 4558, __pyx_L1_error)
+ __PYX_ERR(0, 4563, __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, 4558, __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, 4563, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v__fst = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":4559
+ /* "pywrapfst.pyx":4564
* cdef string _key = self.get_key()
* cdef Fst _fst = self.get_fst()
* self.next() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
- __PYX_ERR(0, 4559, __pyx_L1_error)
+ __PYX_ERR(0, 4564, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":4560
+ /* "pywrapfst.pyx":4565
* cdef Fst _fst = self.get_fst()
* self.next()
* return (_key, _fst) # <<<<<<<<<<<<<<
* # This just registers this class as a possible iterator.
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v__key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4560, __pyx_L1_error)
+ __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v__key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4565, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4560, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4565, __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":4554
+ /* "pywrapfst.pyx":4559
* raise KeyError(key)
*
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4563
+/* "pywrapfst.pyx":4568
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":4564
+ /* "pywrapfst.pyx":4569
* # 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":4563
+ /* "pywrapfst.pyx":4568
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4587
+/* "pywrapfst.pyx":4592
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":4588
+ /* "pywrapfst.pyx":4593
*
* def __init__(self):
* raise NotImplementedError(f"Cannot construct {self.__class__.__name__}") # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4588, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4588, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4588, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_construct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4588, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_construct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4588, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4593, __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, 4588, __pyx_L1_error)
+ __PYX_ERR(0, 4593, __pyx_L1_error)
- /* "pywrapfst.pyx":4587
+ /* "pywrapfst.pyx":4592
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4590
+/* "pywrapfst.pyx":4595
* raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
*
* def __repr__(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":4591
+ /* "pywrapfst.pyx":4596
*
* def __repr__(self):
* return f"<{self.far_type()} FarWriter at 0x{id(self):x}>" # <<<<<<<<<<<<<<
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4591, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "far_type");
- __PYX_ERR(0, 4591, __pyx_L1_error)
+ __PYX_ERR(0, 4596, __pyx_L1_error)
}
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4591, __pyx_L1_error)
+ __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__pyx_t_2 += 16;
__Pyx_GIVEREF(__pyx_kp_u_FarWriter_at_0x);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_FarWriter_at_0x);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4591, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4591, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4591, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4590
+ /* "pywrapfst.pyx":4595
* raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
*
* def __repr__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4594
+/* "pywrapfst.pyx":4599
*
* @classmethod
* def create(cls, source, arc_type="standard", far_type="default"): # <<<<<<<<<<<<<<
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 4594, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 4599, __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, 4594, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4599, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.FarWriter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create", 0);
- /* "pywrapfst.pyx":4617
+ /* "pywrapfst.pyx":4622
* cdef unique_ptr[fst.FarWriterClass] _tfar
* _tfar.reset(fst.FarWriterClass.Create(
* path_tostring(source), # <<<<<<<<<<<<<<
* tostring(arc_type),
* _get_far_type(tostring(far_type))))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4617, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4622, __pyx_L1_error)
- /* "pywrapfst.pyx":4618
+ /* "pywrapfst.pyx":4623
* _tfar.reset(fst.FarWriterClass.Create(
* path_tostring(source),
* tostring(arc_type), # <<<<<<<<<<<<<<
* _get_far_type(tostring(far_type))))
* if _tfar.get() == NULL:
*/
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4618, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4623, __pyx_L1_error)
- /* "pywrapfst.pyx":4619
+ /* "pywrapfst.pyx":4624
* path_tostring(source),
* tostring(arc_type),
* _get_far_type(tostring(far_type)))) # <<<<<<<<<<<<<<
* if _tfar.get() == NULL:
* raise FstIOError(f"Open failed: {source!r}")
*/
- __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_far_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4619, __pyx_L1_error)
- __pyx_t_4 = __pyx_f_9pywrapfst__get_far_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4619, __pyx_L1_error)
+ __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_far_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4624, __pyx_L1_error)
+ __pyx_t_4 = __pyx_f_9pywrapfst__get_far_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4624, __pyx_L1_error)
- /* "pywrapfst.pyx":4616
+ /* "pywrapfst.pyx":4621
* """
* cdef unique_ptr[fst.FarWriterClass] _tfar
* _tfar.reset(fst.FarWriterClass.Create( # <<<<<<<<<<<<<<
*/
__pyx_v__tfar.reset(fst::script::FarWriterClass::Create(__pyx_t_1, __pyx_t_2, __pyx_t_4));
- /* "pywrapfst.pyx":4620
+ /* "pywrapfst.pyx":4625
* tostring(arc_type),
* _get_far_type(tostring(far_type))))
* if _tfar.get() == NULL: # <<<<<<<<<<<<<<
__pyx_t_5 = ((__pyx_v__tfar.get() == NULL) != 0);
if (unlikely(__pyx_t_5)) {
- /* "pywrapfst.pyx":4621
+ /* "pywrapfst.pyx":4626
* _get_far_type(tostring(far_type))))
* if _tfar.get() == NULL:
* raise FstIOError(f"Open failed: {source!r}") # <<<<<<<<<<<<<<
* cdef FarWriter writer = FarWriter.__new__(FarWriter)
* writer._writer = move(_tfar)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4621, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4621, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Open_failed, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4621, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Open_failed, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = NULL;
__pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4621, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __PYX_ERR(0, 4621, __pyx_L1_error)
+ __PYX_ERR(0, 4626, __pyx_L1_error)
- /* "pywrapfst.pyx":4620
+ /* "pywrapfst.pyx":4625
* tostring(arc_type),
* _get_far_type(tostring(far_type))))
* if _tfar.get() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4622
+ /* "pywrapfst.pyx":4627
* if _tfar.get() == NULL:
* raise FstIOError(f"Open failed: {source!r}")
* cdef FarWriter writer = FarWriter.__new__(FarWriter) # <<<<<<<<<<<<<<
* writer._writer = move(_tfar)
* return writer
*/
- __pyx_t_6 = ((PyObject *)__pyx_tp_new_9pywrapfst_FarWriter(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarWriter), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4622, __pyx_L1_error)
+ __pyx_t_6 = ((PyObject *)__pyx_tp_new_9pywrapfst_FarWriter(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarWriter), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4627, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
__pyx_v_writer = ((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_t_6);
__pyx_t_6 = 0;
- /* "pywrapfst.pyx":4623
+ /* "pywrapfst.pyx":4628
* raise FstIOError(f"Open failed: {source!r}")
* cdef FarWriter writer = FarWriter.__new__(FarWriter)
* writer._writer = move(_tfar) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_writer) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4623, __pyx_L1_error)
+ __PYX_ERR(0, 4628, __pyx_L1_error)
}
__pyx_v_writer->_writer = fst::move<std::unique_ptr<fst::script::FarWriterClass> >(__pyx_v__tfar);
- /* "pywrapfst.pyx":4624
+ /* "pywrapfst.pyx":4629
* cdef FarWriter writer = FarWriter.__new__(FarWriter)
* writer._writer = move(_tfar)
* return writer # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_writer);
goto __pyx_L0;
- /* "pywrapfst.pyx":4594
+ /* "pywrapfst.pyx":4599
*
* @classmethod
* def create(cls, source, arc_type="standard", far_type="default"): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":4628
+/* "pywrapfst.pyx":4633
* # NB: Invoking this method may be dangerous: calling any other method on the
* # instance after this is invoked may result in a null dereference.
* cdef void close(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("close", 0);
- /* "pywrapfst.pyx":4629
+ /* "pywrapfst.pyx":4634
* # instance after this is invoked may result in a null dereference.
* cdef void close(self):
* self._writer.reset() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4629, __pyx_L1_error)
+ __PYX_ERR(0, 4634, __pyx_L1_error)
}
__pyx_v_self->_writer.reset();
- /* "pywrapfst.pyx":4628
+ /* "pywrapfst.pyx":4633
* # NB: Invoking this method may be dangerous: calling any other method on the
* # instance after this is invoked may result in a null dereference.
* cdef void close(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":4631
+/* "pywrapfst.pyx":4636
* self._writer.reset()
*
* cpdef void add(self, key, Fst ifst) except *: # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4631, __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, 4636, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarWriter_7add)) {
__Pyx_INCREF(__pyx_t_1);
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, ((PyObject *)__pyx_v_ifst)};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4631, __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, 4636, __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, 4631, __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, 4636, __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, 4631, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4636, __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, 4631, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4636, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
#endif
}
- /* "pywrapfst.pyx":4649
+ /* "pywrapfst.pyx":4654
* # Failure here results from passing an FST with a different arc type than
* # used by the FAR was initialized to use.
* if not self._writer.get().Add(tostring(key), deref(ifst._fst)): # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4649, __pyx_L1_error)
+ __PYX_ERR(0, 4654, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4649, __pyx_L1_error)
+ __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4654, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4649, __pyx_L1_error)
+ __PYX_ERR(0, 4654, __pyx_L1_error)
}
__pyx_t_8 = ((!(__pyx_v_self->_writer.get()->Add(__pyx_t_7, (*__pyx_v_ifst->_fst)) != 0)) != 0);
if (unlikely(__pyx_t_8)) {
- /* "pywrapfst.pyx":4650
+ /* "pywrapfst.pyx":4655
* # 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") # <<<<<<<<<<<<<<
*
* cpdef string arc_type(self):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4650, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4655, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Incompatible_or_invalid_arc_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Incompatible_or_invalid_arc_type);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4650, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4655, __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, 4650, __pyx_L1_error)
+ __PYX_ERR(0, 4655, __pyx_L1_error)
- /* "pywrapfst.pyx":4649
+ /* "pywrapfst.pyx":4654
* # 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":4631
+ /* "pywrapfst.pyx":4636
* self._writer.reset()
*
* cpdef void add(self, key, Fst ifst) except *: # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 4631, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 4636, __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, 4631, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 4636, __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, 4631, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4636, __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, 4631, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4636, __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 */
int __pyx_clineno = 0;
__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, 4631, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4631, __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, 4636, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4636, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4652
+/* "pywrapfst.pyx":4657
* raise FstOpError("Incompatible or invalid arc type")
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4652, __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, 4657, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarWriter_9arc_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4652, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4657, __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, 4652, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4657, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4658
+ /* "pywrapfst.pyx":4663
* Returns a string indicating the arc type.
* """
* return self._writer.get().ArcType() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4658, __pyx_L1_error)
+ __PYX_ERR(0, 4663, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_writer.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":4652
+ /* "pywrapfst.pyx":4657
* raise FstOpError("Incompatible or invalid arc type")
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arc_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4652, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4657, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4660
+/* "pywrapfst.pyx":4665
* return self._writer.get().ArcType()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4660, __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, 4665, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarWriter_11error)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4660, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4665, __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, 4660, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4665, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4669
+ /* "pywrapfst.pyx":4674
* True if the FarWriter is in an errorful state, False otherwise.
* """
* return self._writer.get().Error() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4669, __pyx_L1_error)
+ __PYX_ERR(0, 4674, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_writer.get()->Error();
goto __pyx_L0;
- /* "pywrapfst.pyx":4660
+ /* "pywrapfst.pyx":4665
* return self._writer.get().ArcType()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__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, 4660, __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, 4665, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4671
+/* "pywrapfst.pyx":4676
* return self._writer.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4671, __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, 4676, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_9FarWriter_13far_type)) {
__Pyx_INCREF(__pyx_t_1);
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4671, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4676, __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, 4671, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4676, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#endif
}
- /* "pywrapfst.pyx":4677
+ /* "pywrapfst.pyx":4682
* Returns a string indicating the FAR type.
* """
* return fst.GetFarTypeString(self._writer.get().Type()) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4677, __pyx_L1_error)
+ __PYX_ERR(0, 4682, __pyx_L1_error)
}
__pyx_r = fst::GetFarTypeString(__pyx_v_self->_writer.get()->Type());
goto __pyx_L0;
- /* "pywrapfst.pyx":4671
+ /* "pywrapfst.pyx":4676
* return self._writer.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("far_type", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4671, __pyx_L1_error)
+ __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4676, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4680
+/* "pywrapfst.pyx":4685
*
* # 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, 4680, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst), __pyx_ptype_9pywrapfst_Fst, 1, "fst", 0))) __PYX_ERR(0, 4685, __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 */
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "pywrapfst.pyx":4681
+ /* "pywrapfst.pyx":4686
* # Dictionary-like assignment.
* def __setitem__(self, key, Fst fst):
* self.add(key, fst) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
- __PYX_ERR(0, 4681, __pyx_L1_error)
+ __PYX_ERR(0, 4686, __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, 4681, __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, 4686, __pyx_L1_error)
- /* "pywrapfst.pyx":4680
+ /* "pywrapfst.pyx":4685
*
* # Dictionary-like assignment.
* def __setitem__(self, key, Fst fst): # <<<<<<<<<<<<<<
static PyMethodDef __pyx_methods_9pywrapfst_Weight[] = {
{"copy", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_9copy, METH_NOARGS, __pyx_doc_9pywrapfst_6Weight_8copy},
- {"Zero", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_11Zero, METH_O, __pyx_doc_9pywrapfst_6Weight_10Zero},
- {"One", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_13One, METH_O, __pyx_doc_9pywrapfst_6Weight_12One},
- {"NoWeight", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_15NoWeight, METH_O, __pyx_doc_9pywrapfst_6Weight_14NoWeight},
+ {"zero", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_11zero, METH_O, __pyx_doc_9pywrapfst_6Weight_10zero},
+ {"one", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_13one, METH_O, __pyx_doc_9pywrapfst_6Weight_12one},
+ {"no_weight", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_15no_weight, METH_O, __pyx_doc_9pywrapfst_6Weight_14no_weight},
{"to_string", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_21to_string, METH_NOARGS, 0},
{"type", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_23type, METH_NOARGS, __pyx_doc_9pywrapfst_6Weight_22type},
{"member", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_25member, METH_NOARGS, 0},
{&__pyx_n_s_FarType, __pyx_k_FarType, sizeof(__pyx_k_FarType), 0, 0, 1, 1},
{&__pyx_n_s_FarWriter, __pyx_k_FarWriter, sizeof(__pyx_k_FarWriter), 0, 0, 1, 1},
{&__pyx_kp_u_FarWriter_at_0x, __pyx_k_FarWriter_at_0x, sizeof(__pyx_k_FarWriter_at_0x), 0, 1, 0, 0},
+ {&__pyx_n_s_Flag, __pyx_k_Flag, sizeof(__pyx_k_Flag), 0, 0, 1, 1},
{&__pyx_n_s_Fst, __pyx_k_Fst, sizeof(__pyx_k_Fst), 0, 0, 1, 1},
{&__pyx_n_s_FstArgError, __pyx_k_FstArgError, sizeof(__pyx_k_FstArgError), 0, 0, 1, 1},
{&__pyx_n_s_FstBadWeightError, __pyx_k_FstBadWeightError, sizeof(__pyx_k_FstBadWeightError), 0, 0, 1, 1},
{&__pyx_n_s_FstIOError, __pyx_k_FstIOError, sizeof(__pyx_k_FstIOError), 0, 0, 1, 1},
{&__pyx_n_s_FstIndexError, __pyx_k_FstIndexError, sizeof(__pyx_k_FstIndexError), 0, 0, 1, 1},
{&__pyx_n_s_FstOpError, __pyx_k_FstOpError, sizeof(__pyx_k_FstOpError), 0, 0, 1, 1},
+ {&__pyx_n_s_FstProperties, __pyx_k_FstProperties, sizeof(__pyx_k_FstProperties), 0, 0, 1, 1},
{&__pyx_n_s_FstSymbolTableView, __pyx_k_FstSymbolTableView, sizeof(__pyx_k_FstSymbolTableView), 0, 0, 1, 1},
{&__pyx_kp_u_Fst_SymbolTableView, __pyx_k_Fst_SymbolTableView, sizeof(__pyx_k_Fst_SymbolTableView), 0, 1, 0, 0},
{&__pyx_kp_u_Fst_at_0x, __pyx_k_Fst_at_0x, sizeof(__pyx_k_Fst_at_0x), 0, 1, 0, 0},
{&__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_u_No_new_SymbolTables_specified, __pyx_k_No_new_SymbolTables_specified, sizeof(__pyx_k_No_new_SymbolTables_specified), 0, 1, 0, 0},
{&__pyx_kp_u_No_relabeling_pairs_specified, __pyx_k_No_relabeling_pairs_specified, sizeof(__pyx_k_No_relabeling_pairs_specified), 0, 1, 0, 0},
{&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
{&__pyx_n_s_O_EPSILONS, __pyx_k_O_EPSILONS, sizeof(__pyx_k_O_EPSILONS), 0, 0, 1, 1},
{&__pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_k_O_LABEL_INVARIANT_PROPERTIES, sizeof(__pyx_k_O_LABEL_INVARIANT_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_O_LABEL_SORTED, __pyx_k_O_LABEL_SORTED, sizeof(__pyx_k_O_LABEL_SORTED), 0, 0, 1, 1},
- {&__pyx_n_s_One, __pyx_k_One, sizeof(__pyx_k_One), 0, 0, 1, 1},
{&__pyx_kp_u_Open_failed, __pyx_k_Open_failed, sizeof(__pyx_k_Open_failed), 0, 1, 0, 0},
{&__pyx_kp_u_Operation_failed, __pyx_k_Operation_failed, sizeof(__pyx_k_Operation_failed), 0, 1, 0, 0},
{&__pyx_n_s_PIPE, __pyx_k_PIPE, sizeof(__pyx_k_PIPE), 0, 0, 1, 1},
{&__pyx_kp_u_Weight_type_not_found, __pyx_k_Weight_type_not_found, sizeof(__pyx_k_Weight_type_not_found), 0, 1, 0, 0},
{&__pyx_kp_u_Write_failed, __pyx_k_Write_failed, sizeof(__pyx_k_Write_failed), 0, 1, 0, 0},
{&__pyx_kp_u_Write_to_string_failed, __pyx_k_Write_to_string_failed, sizeof(__pyx_k_Write_to_string_failed), 0, 1, 0, 0},
- {&__pyx_n_s_Zero, __pyx_k_Zero, sizeof(__pyx_k_Zero), 0, 0, 1, 1},
{&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0},
{&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
{&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
{&__pyx_n_s_draw, __pyx_k_draw, sizeof(__pyx_k_draw), 0, 0, 1, 1},
{&__pyx_n_s_encode_labels, __pyx_k_encode_labels, sizeof(__pyx_k_encode_labels), 0, 0, 1, 1},
{&__pyx_n_s_encode_weights, __pyx_k_encode_weights, sizeof(__pyx_k_encode_weights), 0, 0, 1, 1},
+ {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
{&__pyx_n_s_eps_norm_output, __pyx_k_eps_norm_output, sizeof(__pyx_k_eps_norm_output), 0, 0, 1, 1},
{&__pyx_n_s_epsilon_on_replace, __pyx_k_epsilon_on_replace, sizeof(__pyx_k_epsilon_on_replace), 0, 0, 1, 1},
{&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 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_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
{&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 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_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
{&__pyx_n_s_max_length, __pyx_k_max_length, sizeof(__pyx_k_max_length), 0, 0, 1, 1},
{&__pyx_n_s_member, __pyx_k_member, sizeof(__pyx_k_member), 0, 0, 1, 1},
+ {&__pyx_n_s_members, __pyx_k_members, sizeof(__pyx_k_members), 0, 0, 1, 1},
{&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
{&__pyx_n_s_missing_sym, __pyx_k_missing_sym, sizeof(__pyx_k_missing_sym), 0, 0, 1, 1},
{&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
{&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
{&__pyx_n_s_nextstate, __pyx_k_nextstate, sizeof(__pyx_k_nextstate), 0, 0, 1, 1},
{&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
+ {&__pyx_n_s_no_weight, __pyx_k_no_weight, sizeof(__pyx_k_no_weight), 0, 0, 1, 1},
{&__pyx_n_s_nodesep, __pyx_k_nodesep, sizeof(__pyx_k_nodesep), 0, 0, 1, 1},
{&__pyx_n_s_npath, __pyx_k_npath, sizeof(__pyx_k_npath), 0, 0, 1, 1},
{&__pyx_n_s_nshortest, __pyx_k_nshortest, sizeof(__pyx_k_nshortest), 0, 0, 1, 1},
{&__pyx_n_s_olabel, __pyx_k_olabel, sizeof(__pyx_k_olabel), 0, 0, 1, 1},
{&__pyx_n_s_old_isymbols, __pyx_k_old_isymbols, sizeof(__pyx_k_old_isymbols), 0, 0, 1, 1},
{&__pyx_n_s_old_osymbols, __pyx_k_old_osymbols, sizeof(__pyx_k_old_osymbols), 0, 0, 1, 1},
+ {&__pyx_n_s_one, __pyx_k_one, sizeof(__pyx_k_one), 0, 0, 1, 1},
{&__pyx_n_s_opairs, __pyx_k_opairs, sizeof(__pyx_k_opairs), 0, 0, 1, 1},
{&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
{&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
{&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 0, 0, 1, 1},
{&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
{&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
- {&__pyx_n_s_properties, __pyx_k_properties, sizeof(__pyx_k_properties), 0, 0, 1, 1},
{&__pyx_n_s_props, __pyx_k_props, sizeof(__pyx_k_props), 0, 0, 1, 1},
{&__pyx_n_s_push_labels, __pyx_k_push_labels, sizeof(__pyx_k_push_labels), 0, 0, 1, 1},
{&__pyx_n_s_push_weights, __pyx_k_push_weights, sizeof(__pyx_k_push_weights), 0, 0, 1, 1},
{&__pyx_n_s_write_text, __pyx_k_write_text, sizeof(__pyx_k_write_text), 0, 0, 1, 1},
{&__pyx_n_s_write_to_string, __pyx_k_write_to_string, sizeof(__pyx_k_write_to_string), 0, 0, 1, 1},
{&__pyx_n_u_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 1, 0, 1},
+ {&__pyx_n_s_zero, __pyx_k_zero, sizeof(__pyx_k_zero), 0, 0, 1, 1},
{0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 146, __pyx_L1_error)
- __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 156, __pyx_L1_error)
- __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 161, __pyx_L1_error)
- __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 166, __pyx_L1_error)
- __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 1418, __pyx_L1_error)
- __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 195, __pyx_L1_error)
- __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 424, __pyx_L1_error)
- __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 745, __pyx_L1_error)
- __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 1285, __pyx_L1_error)
- __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 4552, __pyx_L1_error)
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 147, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 157, __pyx_L1_error)
+ __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 162, __pyx_L1_error)
+ __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 167, __pyx_L1_error)
+ __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 1420, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 196, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 425, __pyx_L1_error)
+ __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 746, __pyx_L1_error)
+ __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 1286, __pyx_L1_error)
+ __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 4557, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
- /* "pywrapfst.pyx":1576
+ /* "pywrapfst.pyx":1578
* @staticmethod
* cdef string _local_render_svg(const string &dot):
* proc = subprocess.Popen(("dot", "-Tsvg"), # <<<<<<<<<<<<<<
* stdin=subprocess.PIPE,
* stdout=subprocess.PIPE)
*/
- __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_u_dot, __pyx_kp_u_Tsvg); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1576, __pyx_L1_error)
+ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_u_dot, __pyx_kp_u_Tsvg); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__9);
__Pyx_GIVEREF(__pyx_tuple__9);
- __pyx_tuple__10 = PyTuple_Pack(1, __pyx_tuple__9); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1576, __pyx_L1_error)
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_tuple__9); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__10);
__Pyx_GIVEREF(__pyx_tuple__10);
__Pyx_GOTREF(__pyx_tuple__58);
__Pyx_GIVEREF(__pyx_tuple__58);
- /* "pywrapfst.pyx":513
+ /* "pywrapfst.pyx":514
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* plus(lhs, rhs)
*/
- __pyx_tuple__59 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_weight_2); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 513, __pyx_L1_error)
+ __pyx_tuple__59 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_weight_2); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__59);
__Pyx_GIVEREF(__pyx_tuple__59);
- __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_plus, 513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 513, __pyx_L1_error)
+ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_plus, 514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 514, __pyx_L1_error)
- /* "pywrapfst.pyx":545
+ /* "pywrapfst.pyx":546
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* times(lhs, rhs)
*/
- __pyx_tuple__61 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_weight_2); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 545, __pyx_L1_error)
+ __pyx_tuple__61 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_weight_2); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 546, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__61);
__Pyx_GIVEREF(__pyx_tuple__61);
- __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_times, 545, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 545, __pyx_L1_error)
+ __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_times, 546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 546, __pyx_L1_error)
- /* "pywrapfst.pyx":577
+ /* "pywrapfst.pyx":578
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* divide(lhs, rhs)
*/
- __pyx_tuple__63 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_weight_2); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 577, __pyx_L1_error)
+ __pyx_tuple__63 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_weight_2); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__63);
__Pyx_GIVEREF(__pyx_tuple__63);
- __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_divide, 577, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 577, __pyx_L1_error)
+ __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_divide, 578, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 578, __pyx_L1_error)
- /* "pywrapfst.pyx":610
+ /* "pywrapfst.pyx":611
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
* """
* power(lhs, rhs)
*/
- __pyx_tuple__65 = PyTuple_Pack(3, __pyx_n_s_w, __pyx_n_s_n, __pyx_n_s_weight_2); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 610, __pyx_L1_error)
+ __pyx_tuple__65 = PyTuple_Pack(3, __pyx_n_s_w, __pyx_n_s_n, __pyx_n_s_weight_2); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 611, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__65);
__Pyx_GIVEREF(__pyx_tuple__65);
- __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_power, 610, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 610, __pyx_L1_error)
+ __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_power, 611, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 611, __pyx_L1_error)
- /* "pywrapfst.pyx":1419
+ /* "pywrapfst.pyx":1421
*
* @staticmethod
* def read_from_string(state): # <<<<<<<<<<<<<<
* """
* read_from_string(state)
*/
- __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1419, __pyx_L1_error)
+ __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__67);
__Pyx_GIVEREF(__pyx_tuple__67);
- __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_read_from_string, 1419, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 1419, __pyx_L1_error)
+ __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_read_from_string, 1421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 1421, __pyx_L1_error)
- /* "pywrapfst.pyx":4130
+ /* "pywrapfst.pyx":4135
*
*
* def shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kShortestDelta,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_tuple__69 = PyTuple_Pack(7, __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); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 4130, __pyx_L1_error)
+ __pyx_tuple__69 = PyTuple_Pack(7, __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); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 4135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__69);
__Pyx_GIVEREF(__pyx_tuple__69);
- __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_shortestdistance, 4130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 4130, __pyx_L1_error)
+ __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_shortestdistance, 4135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 4135, __pyx_L1_error)
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
if (__Pyx_ExportFunction("_get_queue_type", (void (*)(void))__pyx_f_9pywrapfst__get_queue_type, "enum fst::QueueType (std::string const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_get_rand_arc_selection", (void (*)(void))__pyx_f_9pywrapfst__get_rand_arc_selection, "enum fst::script::RandArcSelection (std::string const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_get_replace_label_type", (void (*)(void))__pyx_f_9pywrapfst__get_replace_label_type, "enum fst::ReplaceLabelType (std::string const &, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- if (__Pyx_ExportFunction("_get_WeightClass_or_One", (void (*)(void))__pyx_f_9pywrapfst__get_WeightClass_or_One, "fst::script::WeightClass (std::string const &, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- if (__Pyx_ExportFunction("_get_WeightClass_or_Zero", (void (*)(void))__pyx_f_9pywrapfst__get_WeightClass_or_Zero, "fst::script::WeightClass (std::string const &, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- if (__Pyx_ExportFunction("_Zero", (void (*)(void))__pyx_f_9pywrapfst__Zero, "struct __pyx_obj_9pywrapfst_Weight *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- if (__Pyx_ExportFunction("_One", (void (*)(void))__pyx_f_9pywrapfst__One, "struct __pyx_obj_9pywrapfst_Weight *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- if (__Pyx_ExportFunction("_NoWeight", (void (*)(void))__pyx_f_9pywrapfst__NoWeight, "struct __pyx_obj_9pywrapfst_Weight *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_ExportFunction("_get_WeightClass_or_one", (void (*)(void))__pyx_f_9pywrapfst__get_WeightClass_or_one, "fst::script::WeightClass (std::string const &, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_ExportFunction("_get_WeightClass_or_zero", (void (*)(void))__pyx_f_9pywrapfst__get_WeightClass_or_zero, "fst::script::WeightClass (std::string const &, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_ExportFunction("_zero", (void (*)(void))__pyx_f_9pywrapfst__zero, "struct __pyx_obj_9pywrapfst_Weight *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_ExportFunction("_one", (void (*)(void))__pyx_f_9pywrapfst__one, "struct __pyx_obj_9pywrapfst_Weight *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_ExportFunction("_no_weight", (void (*)(void))__pyx_f_9pywrapfst__no_weight, "struct __pyx_obj_9pywrapfst_Weight *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_plus", (void (*)(void))__pyx_f_9pywrapfst__plus, "struct __pyx_obj_9pywrapfst_Weight *(struct __pyx_obj_9pywrapfst_Weight *, struct __pyx_obj_9pywrapfst_Weight *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_times", (void (*)(void))__pyx_f_9pywrapfst__times, "struct __pyx_obj_9pywrapfst_Weight *(struct __pyx_obj_9pywrapfst_Weight *, struct __pyx_obj_9pywrapfst_Weight *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_divide", (void (*)(void))__pyx_f_9pywrapfst__divide, "struct __pyx_obj_9pywrapfst_Weight *(struct __pyx_obj_9pywrapfst_Weight *, struct __pyx_obj_9pywrapfst_Weight *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__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;
__pyx_vtable_9pywrapfst_Weight.member = (bool (*)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_6Weight_member;
- if (PyType_Ready(&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 403, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_Weight.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_Weight.tp_dictoffset && __pyx_type_9pywrapfst_Weight.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_Weight.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Weight.tp_dict, __pyx_vtabptr_9pywrapfst_Weight) < 0) __PYX_ERR(0, 403, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Weight_2, (PyObject *)&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 403, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 403, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Weight.tp_dict, __pyx_vtabptr_9pywrapfst_Weight) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Weight_2, (PyObject *)&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
__pyx_ptype_9pywrapfst_Weight = &__pyx_type_9pywrapfst_Weight;
__pyx_vtabptr_9pywrapfst_SymbolTableView = &__pyx_vtable_9pywrapfst_SymbolTableView;
__pyx_vtable_9pywrapfst_SymbolTableView._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_15SymbolTableView__raw;
__pyx_vtable_9pywrapfst_SymbolTableView.write = (void (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_write;
__pyx_vtable_9pywrapfst_SymbolTableView.write_text = (void (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_write_text;
__pyx_vtable_9pywrapfst_SymbolTableView.write_to_string = (PyObject *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_write_to_string;
- if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 730, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_SymbolTableView.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_SymbolTableView.tp_dictoffset && __pyx_type_9pywrapfst_SymbolTableView.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_SymbolTableView.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_SymbolTableView.tp_dict, __pyx_vtabptr_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 730, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SymbolTableView, (PyObject *)&__pyx_type_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 730, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_SymbolTableView.tp_dict, __pyx_vtabptr_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SymbolTableView, (PyObject *)&__pyx_type_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
__pyx_ptype_9pywrapfst_SymbolTableView = &__pyx_type_9pywrapfst_SymbolTableView;
__pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTableView = &__pyx_vtable_9pywrapfst__EncodeMapperSymbolTableView;
__pyx_vtable_9pywrapfst__EncodeMapperSymbolTableView.__pyx_base = *__pyx_vtabptr_9pywrapfst_SymbolTableView;
__pyx_vtable_9pywrapfst__EncodeMapperSymbolTableView.__pyx_base._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_28_EncodeMapperSymbolTableView__raw;
__pyx_type_9pywrapfst__EncodeMapperSymbolTableView.tp_base = __pyx_ptype_9pywrapfst_SymbolTableView;
- if (PyType_Ready(&__pyx_type_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 933, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 934, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst__EncodeMapperSymbolTableView.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst__EncodeMapperSymbolTableView.tp_dictoffset && __pyx_type_9pywrapfst__EncodeMapperSymbolTableView.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst__EncodeMapperSymbolTableView.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst__EncodeMapperSymbolTableView.tp_dict, __pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 933, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EncodeMapperSymbolTableView, (PyObject *)&__pyx_type_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 933, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__EncodeMapperSymbolTableView.tp_dict, __pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 934, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EncodeMapperSymbolTableView, (PyObject *)&__pyx_type_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 934, __pyx_L1_error)
__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView = &__pyx_type_9pywrapfst__EncodeMapperSymbolTableView;
__pyx_vtabptr_9pywrapfst__FstSymbolTableView = &__pyx_vtable_9pywrapfst__FstSymbolTableView;
__pyx_vtable_9pywrapfst__FstSymbolTableView.__pyx_base = *__pyx_vtabptr_9pywrapfst_SymbolTableView;
__pyx_vtable_9pywrapfst__FstSymbolTableView.__pyx_base._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_19_FstSymbolTableView__raw;
__pyx_type_9pywrapfst__FstSymbolTableView.tp_base = __pyx_ptype_9pywrapfst_SymbolTableView;
- if (PyType_Ready(&__pyx_type_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 957, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 958, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst__FstSymbolTableView.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst__FstSymbolTableView.tp_dictoffset && __pyx_type_9pywrapfst__FstSymbolTableView.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst__FstSymbolTableView.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst__FstSymbolTableView.tp_dict, __pyx_vtabptr_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 957, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FstSymbolTableView, (PyObject *)&__pyx_type_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 957, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__FstSymbolTableView.tp_dict, __pyx_vtabptr_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 958, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FstSymbolTableView, (PyObject *)&__pyx_type_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 958, __pyx_L1_error)
__pyx_ptype_9pywrapfst__FstSymbolTableView = &__pyx_type_9pywrapfst__FstSymbolTableView;
__pyx_vtabptr_9pywrapfst__MutableSymbolTable = &__pyx_vtable_9pywrapfst__MutableSymbolTable;
__pyx_vtable_9pywrapfst__MutableSymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst_SymbolTableView;
__pyx_vtable_9pywrapfst__MutableSymbolTable.add_table = (void (*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, struct __pyx_obj_9pywrapfst_SymbolTableView *, 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_SymbolTableView;
- if (PyType_Ready(&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 980, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst__MutableSymbolTable.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst__MutableSymbolTable.tp_dictoffset && __pyx_type_9pywrapfst__MutableSymbolTable.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst__MutableSymbolTable.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 980, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableSymbolTable, (PyObject *)&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 980, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableSymbolTable, (PyObject *)&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
__pyx_ptype_9pywrapfst__MutableSymbolTable = &__pyx_type_9pywrapfst__MutableSymbolTable;
__pyx_vtabptr_9pywrapfst__MutableFstSymbolTableView = &__pyx_vtable_9pywrapfst__MutableFstSymbolTableView;
__pyx_vtable_9pywrapfst__MutableFstSymbolTableView.__pyx_base = *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
__pyx_vtable_9pywrapfst__MutableFstSymbolTableView.__pyx_base._mutable_raw = (fst::SymbolTable *(*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *))__pyx_f_9pywrapfst_26_MutableFstSymbolTableView__mutable_raw;
__pyx_type_9pywrapfst__MutableFstSymbolTableView.tp_base = __pyx_ptype_9pywrapfst__MutableSymbolTable;
- if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1053, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst__MutableFstSymbolTableView.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst__MutableFstSymbolTableView.tp_dictoffset && __pyx_type_9pywrapfst__MutableFstSymbolTableView.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst__MutableFstSymbolTableView.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableFstSymbolTableView.tp_dict, __pyx_vtabptr_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableFstSymbolTableView, (PyObject *)&__pyx_type_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableFstSymbolTableView.tp_dict, __pyx_vtabptr_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1053, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableFstSymbolTableView, (PyObject *)&__pyx_type_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1053, __pyx_L1_error)
__pyx_ptype_9pywrapfst__MutableFstSymbolTableView = &__pyx_type_9pywrapfst__MutableFstSymbolTableView;
__pyx_vtabptr_9pywrapfst_SymbolTable = &__pyx_vtable_9pywrapfst_SymbolTable;
__pyx_vtable_9pywrapfst_SymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
__pyx_vtable_9pywrapfst_SymbolTable.__pyx_base._mutable_raw = (fst::SymbolTable *(*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *))__pyx_f_9pywrapfst_11SymbolTable__mutable_raw;
__pyx_type_9pywrapfst_SymbolTable.tp_base = __pyx_ptype_9pywrapfst__MutableSymbolTable;
- if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1067, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1068, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_SymbolTable.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_SymbolTable.tp_dictoffset && __pyx_type_9pywrapfst_SymbolTable.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_SymbolTable.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_SymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1067, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SymbolTable_2, (PyObject *)&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1067, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_SymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1068, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SymbolTable_2, (PyObject *)&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1068, __pyx_L1_error)
__pyx_ptype_9pywrapfst_SymbolTable = &__pyx_type_9pywrapfst_SymbolTable;
- if (PyType_Ready(&__pyx_type_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1263, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1264, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst__SymbolTableIterator.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst__SymbolTableIterator.tp_dictoffset && __pyx_type_9pywrapfst__SymbolTableIterator.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst__SymbolTableIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SymbolTableIterator, (PyObject *)&__pyx_type_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1263, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1263, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SymbolTableIterator, (PyObject *)&__pyx_type_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1264, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1264, __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.weight_type = (std::string (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_weight_type;
__pyx_vtable_9pywrapfst_EncodeMapper.flags = (uint8 (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_flags;
- __pyx_vtable_9pywrapfst_EncodeMapper.properties = (uint64 (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, uint64, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_properties;
__pyx_vtable_9pywrapfst_EncodeMapper.write = (void (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_write;
__pyx_vtable_9pywrapfst_EncodeMapper.write_to_string = (PyObject *(*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_write_to_string;
__pyx_vtable_9pywrapfst_EncodeMapper.input_symbols = (struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *(*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_input_symbols;
__pyx_vtable_9pywrapfst_EncodeMapper.output_symbols = (struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *(*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_output_symbols;
__pyx_vtable_9pywrapfst_EncodeMapper._set_input_symbols = (void (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_12EncodeMapper__set_input_symbols;
__pyx_vtable_9pywrapfst_EncodeMapper._set_output_symbols = (void (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_12EncodeMapper__set_output_symbols;
- if (PyType_Ready(&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1295, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1296, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_EncodeMapper.tp_print = 0;
#endif
}
#if CYTHON_COMPILING_IN_CPYTHON
{
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9pywrapfst_EncodeMapper, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1295, __pyx_L1_error)
+ PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9pywrapfst_EncodeMapper, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1296, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_9pywrapfst_12EncodeMapper_4__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_9pywrapfst_12EncodeMapper_4__call__.doc = __pyx_doc_9pywrapfst_12EncodeMapper_4__call__;
}
}
#endif
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_EncodeMapper.tp_dict, __pyx_vtabptr_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1295, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EncodeMapper, (PyObject *)&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1295, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_EncodeMapper.tp_dict, __pyx_vtabptr_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1296, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EncodeMapper, (PyObject *)&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1296, __pyx_L1_error)
__pyx_ptype_9pywrapfst_EncodeMapper = &__pyx_type_9pywrapfst_EncodeMapper;
__pyx_vtabptr_9pywrapfst_Fst = &__pyx_vtable_9pywrapfst_Fst;
__pyx_vtable_9pywrapfst_Fst._local_render_svg = (std::string (*)(std::string const &))__pyx_f_9pywrapfst_3Fst__local_render_svg;
__pyx_vtable_9pywrapfst_Fst.num_output_epsilons = (size_t (*)(struct __pyx_obj_9pywrapfst_Fst *, int64, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_num_output_epsilons;
__pyx_vtable_9pywrapfst_Fst.output_symbols = (struct __pyx_obj_9pywrapfst__FstSymbolTableView *(*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_output_symbols;
__pyx_vtable_9pywrapfst_Fst.print = (std::string (*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_print *__pyx_optional_args))__pyx_f_9pywrapfst_3Fst_print;
- __pyx_vtable_9pywrapfst_Fst.properties = (uint64 (*)(struct __pyx_obj_9pywrapfst_Fst *, uint64, bool, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_properties;
__pyx_vtable_9pywrapfst_Fst.start = (int64 (*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_start;
__pyx_vtable_9pywrapfst_Fst.states = (struct __pyx_obj_9pywrapfst_StateIterator *(*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_states;
__pyx_vtable_9pywrapfst_Fst.verify = (bool (*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_verify;
__pyx_vtable_9pywrapfst_Fst.weight_type = (std::string (*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_weight_type;
__pyx_vtable_9pywrapfst_Fst.write = (void (*)(struct __pyx_obj_9pywrapfst_Fst *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_write;
__pyx_vtable_9pywrapfst_Fst.write_to_string = (PyObject *(*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_write_to_string;
- if (PyType_Ready(&__pyx_type_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1561, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1563, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_Fst.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_Fst.tp_dictoffset && __pyx_type_9pywrapfst_Fst.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_Fst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Fst.tp_dict, __pyx_vtabptr_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1561, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Fst, (PyObject *)&__pyx_type_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1561, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Fst.tp_dict, __pyx_vtabptr_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1563, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Fst, (PyObject *)&__pyx_type_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1563, __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._reweight = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, PyObject *, struct __pyx_opt_args_9pywrapfst_10MutableFst__reweight *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__reweight;
__pyx_vtable_9pywrapfst_MutableFst._rmepsilon = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__rmepsilon *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__rmepsilon;
__pyx_vtable_9pywrapfst_MutableFst._set_final = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, int64, struct __pyx_opt_args_9pywrapfst_10MutableFst__set_final *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__set_final;
- __pyx_vtable_9pywrapfst_MutableFst._set_properties = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, uint64, uint64))__pyx_f_9pywrapfst_10MutableFst__set_properties;
__pyx_vtable_9pywrapfst_MutableFst._set_start = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, int64))__pyx_f_9pywrapfst_10MutableFst__set_start;
__pyx_vtable_9pywrapfst_MutableFst._set_input_symbols = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_10MutableFst__set_input_symbols;
__pyx_vtable_9pywrapfst_MutableFst._set_output_symbols = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_10MutableFst__set_output_symbols;
__pyx_vtable_9pywrapfst_MutableFst._topsort = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *))__pyx_f_9pywrapfst_10MutableFst__topsort;
__pyx_type_9pywrapfst_MutableFst.tp_base = __pyx_ptype_9pywrapfst_Fst;
- if (PyType_Ready(&__pyx_type_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2026, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2028, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_MutableFst.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_MutableFst.tp_dictoffset && __pyx_type_9pywrapfst_MutableFst.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_MutableFst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_MutableFst.tp_dict, __pyx_vtabptr_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2026, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableFst, (PyObject *)&__pyx_type_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2026, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_MutableFst.tp_dict, __pyx_vtabptr_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2028, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableFst, (PyObject *)&__pyx_type_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2028, __pyx_L1_error)
__pyx_ptype_9pywrapfst_MutableFst = &__pyx_type_9pywrapfst_MutableFst;
__pyx_vtabptr_9pywrapfst_VectorFst = &__pyx_vtable_9pywrapfst_VectorFst;
__pyx_vtable_9pywrapfst_VectorFst.__pyx_base = *__pyx_vtabptr_9pywrapfst_MutableFst;
__pyx_type_9pywrapfst_VectorFst.tp_base = __pyx_ptype_9pywrapfst_MutableFst;
- if (PyType_Ready(&__pyx_type_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 2891, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 2890, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_VectorFst.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_VectorFst.tp_dictoffset && __pyx_type_9pywrapfst_VectorFst.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_VectorFst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_VectorFst.tp_dict, __pyx_vtabptr_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 2891, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_VectorFst, (PyObject *)&__pyx_type_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 2891, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_VectorFst.tp_dict, __pyx_vtabptr_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 2890, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_VectorFst, (PyObject *)&__pyx_type_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 2890, __pyx_L1_error)
__pyx_ptype_9pywrapfst_VectorFst = &__pyx_type_9pywrapfst_VectorFst;
__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, 3068, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3073, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_Arc.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_Arc.tp_dictoffset && __pyx_type_9pywrapfst_Arc.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_Arc.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Arc.tp_dict, __pyx_vtabptr_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3068, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Arc, (PyObject *)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3068, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3068, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Arc.tp_dict, __pyx_vtabptr_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3073, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Arc, (PyObject *)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3073, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3073, __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 *, uint8, uint8, 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, 3135, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 3140, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_ArcIterator.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_ArcIterator.tp_dictoffset && __pyx_type_9pywrapfst_ArcIterator.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_ArcIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_ArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 3135, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArcIterator, (PyObject *)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 3135, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 3135, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_ArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 3140, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArcIterator, (PyObject *)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 3140, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 3140, __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 *, uint8, uint8, 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, 3246, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3251, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_MutableArcIterator.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_MutableArcIterator.tp_dictoffset && __pyx_type_9pywrapfst_MutableArcIterator.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_MutableArcIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_MutableArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3246, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableArcIterator, (PyObject *)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3246, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3246, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_MutableArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3251, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableArcIterator, (PyObject *)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3251, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3251, __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 = (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, 3366, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3371, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_StateIterator.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_StateIterator.tp_dictoffset && __pyx_type_9pywrapfst_StateIterator.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_StateIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_StateIterator.tp_dict, __pyx_vtabptr_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3366, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StateIterator, (PyObject *)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3366, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3366, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_StateIterator.tp_dict, __pyx_vtabptr_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3371, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StateIterator, (PyObject *)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3371, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3371, __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, 4275, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4280, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_Compiler.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_Compiler.tp_dictoffset && __pyx_type_9pywrapfst_Compiler.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_Compiler.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Compiler.tp_dict, __pyx_vtabptr_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4275, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Compiler, (PyObject *)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4275, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4275, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Compiler.tp_dict, __pyx_vtabptr_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4280, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Compiler, (PyObject *)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4280, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4280, __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, 4412, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4417, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_FarReader.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_FarReader.tp_dictoffset && __pyx_type_9pywrapfst_FarReader.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_FarReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarReader.tp_dict, __pyx_vtabptr_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4412, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FarReader, (PyObject *)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4412, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4412, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarReader.tp_dict, __pyx_vtabptr_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4417, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FarReader, (PyObject *)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4417, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4417, __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, 4567, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4572, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst_FarWriter.tp_print = 0;
#endif
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9pywrapfst_FarWriter.tp_dictoffset && __pyx_type_9pywrapfst_FarWriter.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_9pywrapfst_FarWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
- if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarWriter.tp_dict, __pyx_vtabptr_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4567, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FarWriter, (PyObject *)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4567, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4567, __pyx_L1_error)
+ if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarWriter.tp_dict, __pyx_vtabptr_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4572, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FarWriter, (PyObject *)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4572, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4572, __pyx_L1_error)
__pyx_ptype_9pywrapfst_FarWriter = &__pyx_type_9pywrapfst_FarWriter;
- if (PyType_Ready(&__pyx_type_9pywrapfst___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 3266, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 3271, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst___pyx_scope_struct____iter__.tp_print = 0;
#endif
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_t_8;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
*
* # Python imports.
* import logging # <<<<<<<<<<<<<<
+ * import enum
* import numbers
- * import os
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
/* "pywrapfst.pyx":100
* # Python imports.
* import logging
- * import numbers # <<<<<<<<<<<<<<
+ * import enum # <<<<<<<<<<<<<<
+ * import numbers
* import os
- * import subprocess
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_enum, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_enum, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "pywrapfst.pyx":101
* import logging
+ * import enum
+ * import numbers # <<<<<<<<<<<<<<
+ * import os
+ * import subprocess
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "pywrapfst.pyx":102
+ * import enum
* import numbers
* import os # <<<<<<<<<<<<<<
* import subprocess
* import sys
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":102
+ /* "pywrapfst.pyx":103
* import numbers
* import os
* import subprocess # <<<<<<<<<<<<<<
* import sys
*
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_subprocess, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_subprocess, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_subprocess, __pyx_t_1) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_subprocess, __pyx_t_1) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":103
+ /* "pywrapfst.pyx":104
* import os
* import subprocess
* import sys # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":110
+ /* "pywrapfst.pyx":111
* # These defintions only ensure that these are defined to avoid attribute errors,
* # but don't actually contain the type definitions. Those are in _pywrapfst.pyi.
* import typing # <<<<<<<<<<<<<<
*
* ArcMapType = """typing.Literal["identity", "input_epsilon", "invert",
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_typing, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_typing, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_typing, __pyx_t_1) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_typing, __pyx_t_1) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":112
+ /* "pywrapfst.pyx":113
* import typing
*
* ArcMapType = """typing.Literal["identity", "input_epsilon", "invert", # <<<<<<<<<<<<<<
* "output_epsilon", "plus", "power", "quantize",
* "rmweight", "superfinal", "times", "to_log",
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArcMapType, __pyx_kp_u_typing_Literal_identity_input_ep) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArcMapType, __pyx_kp_u_typing_Literal_identity_input_ep) < 0) __PYX_ERR(0, 113, __pyx_L1_error)
- /* "pywrapfst.pyx":117
+ /* "pywrapfst.pyx":118
* # NOTE: Both spellings of "to_std"
* "to_log64", "to_std", "to_standard"]"""
* ComposeFilter = """typing.Literal["alt_sequence", "auto", "match", "no_match", # <<<<<<<<<<<<<<
* "null", "sequence", "trivial"]"""
* DeterminizeType = """typing.Literal["functional", "nonfunctional",
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ComposeFilter, __pyx_kp_u_typing_Literal_alt_sequence_auto) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ComposeFilter, __pyx_kp_u_typing_Literal_alt_sequence_auto) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
- /* "pywrapfst.pyx":119
+ /* "pywrapfst.pyx":120
* ComposeFilter = """typing.Literal["alt_sequence", "auto", "match", "no_match",
* "null", "sequence", "trivial"]"""
* DeterminizeType = """typing.Literal["functional", "nonfunctional", # <<<<<<<<<<<<<<
* "disambiguate"]"""
* DrawFloatFormat = """typing.Literal["e", "f", "g"]"""
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeterminizeType, __pyx_kp_u_typing_Literal_functional_nonfun) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeterminizeType, __pyx_kp_u_typing_Literal_functional_nonfun) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
- /* "pywrapfst.pyx":121
+ /* "pywrapfst.pyx":122
* DeterminizeType = """typing.Literal["functional", "nonfunctional",
* "disambiguate"]"""
* DrawFloatFormat = """typing.Literal["e", "f", "g"]""" # <<<<<<<<<<<<<<
* FarType = """typing.Literal[
* "fst",
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DrawFloatFormat, __pyx_kp_u_typing_Literal_e_f_g) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DrawFloatFormat, __pyx_kp_u_typing_Literal_e_f_g) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
- /* "pywrapfst.pyx":122
+ /* "pywrapfst.pyx":123
* "disambiguate"]"""
* DrawFloatFormat = """typing.Literal["e", "f", "g"]"""
* FarType = """typing.Literal[ # <<<<<<<<<<<<<<
* "fst",
* "stlist",
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FarType, __pyx_kp_u_typing_Literal_fst_stlist_sttabl) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FarType, __pyx_kp_u_typing_Literal_fst_stlist_sttabl) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
- /* "pywrapfst.pyx":128
+ /* "pywrapfst.pyx":129
* "default"
* ]"""
* ProjectType = """typing.Literal["input", "output"]""" # <<<<<<<<<<<<<<
* QueueType = """typing.Literal["auto", "fifo", "lifo", "shortest", "state",
* "top"]"""
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProjectType, __pyx_kp_u_typing_Literal_input_output) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProjectType, __pyx_kp_u_typing_Literal_input_output) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
- /* "pywrapfst.pyx":129
+ /* "pywrapfst.pyx":130
* ]"""
* ProjectType = """typing.Literal["input", "output"]"""
* QueueType = """typing.Literal["auto", "fifo", "lifo", "shortest", "state", # <<<<<<<<<<<<<<
* "top"]"""
* RandArcSelection = """typing.Literal["uniform", "log_prob", "fast_log_prob"]"""
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueType, __pyx_kp_u_typing_Literal_auto_fifo_lifo_sh) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueType, __pyx_kp_u_typing_Literal_auto_fifo_lifo_sh) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
- /* "pywrapfst.pyx":131
+ /* "pywrapfst.pyx":132
* QueueType = """typing.Literal["auto", "fifo", "lifo", "shortest", "state",
* "top"]"""
* RandArcSelection = """typing.Literal["uniform", "log_prob", "fast_log_prob"]""" # <<<<<<<<<<<<<<
* ReplaceLabelType = """typing.Literal["neither", "input", "output", "both"]"""
* SortType = """typing.Literal["ilabel", "olabel"]"""
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_RandArcSelection, __pyx_kp_u_typing_Literal_uniform_log_prob) < 0) __PYX_ERR(0, 131, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_RandArcSelection, __pyx_kp_u_typing_Literal_uniform_log_prob) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
- /* "pywrapfst.pyx":132
+ /* "pywrapfst.pyx":133
* "top"]"""
* RandArcSelection = """typing.Literal["uniform", "log_prob", "fast_log_prob"]"""
* ReplaceLabelType = """typing.Literal["neither", "input", "output", "both"]""" # <<<<<<<<<<<<<<
* SortType = """typing.Literal["ilabel", "olabel"]"""
* StateMapType = """typing.Literal["arc_sum", "arc_unique", "identity"]"""
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ReplaceLabelType, __pyx_kp_u_typing_Literal_neither_input_out) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ReplaceLabelType, __pyx_kp_u_typing_Literal_neither_input_out) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
- /* "pywrapfst.pyx":133
+ /* "pywrapfst.pyx":134
* RandArcSelection = """typing.Literal["uniform", "log_prob", "fast_log_prob"]"""
* ReplaceLabelType = """typing.Literal["neither", "input", "output", "both"]"""
* SortType = """typing.Literal["ilabel", "olabel"]""" # <<<<<<<<<<<<<<
* StateMapType = """typing.Literal["arc_sum", "arc_unique", "identity"]"""
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SortType, __pyx_kp_u_typing_Literal_ilabel_olabel) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SortType, __pyx_kp_u_typing_Literal_ilabel_olabel) < 0) __PYX_ERR(0, 134, __pyx_L1_error)
- /* "pywrapfst.pyx":134
+ /* "pywrapfst.pyx":135
* ReplaceLabelType = """typing.Literal["neither", "input", "output", "both"]"""
* SortType = """typing.Literal["ilabel", "olabel"]"""
* StateMapType = """typing.Literal["arc_sum", "arc_unique", "identity"]""" # <<<<<<<<<<<<<<
*
* WeightLike = "typing.Union[Weight, typing.Union[str, int, float]]"
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_StateMapType, __pyx_kp_u_typing_Literal_arc_sum_arc_uniqu) < 0) __PYX_ERR(0, 134, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_StateMapType, __pyx_kp_u_typing_Literal_arc_sum_arc_uniqu) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
- /* "pywrapfst.pyx":136
+ /* "pywrapfst.pyx":137
* StateMapType = """typing.Literal["arc_sum", "arc_unique", "identity"]"""
*
* WeightLike = "typing.Union[Weight, typing.Union[str, int, float]]" # <<<<<<<<<<<<<<
*
* ## Custom exceptions.
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WeightLike, __pyx_kp_u_typing_Union_Weight_typing_Union) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_WeightLike, __pyx_kp_u_typing_Union_Weight_typing_Union) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
- /* "pywrapfst.pyx":141
+ /* "pywrapfst.pyx":142
*
*
* class FstError(Exception): # <<<<<<<<<<<<<<
*
* pass
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __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, 141, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __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, 141, __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, 142, __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, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstError, __pyx_t_4) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstError, __pyx_t_4) < 0) __PYX_ERR(0, 142, __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":146
+ /* "pywrapfst.pyx":147
*
*
* class FstArgError(FstError, ValueError): # <<<<<<<<<<<<<<
*
* pass
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __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, 146, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __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, 146, __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, 147, __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, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstArgError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstArgError, __pyx_t_4) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstArgError, __pyx_t_4) < 0) __PYX_ERR(0, 147, __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":151
+ /* "pywrapfst.pyx":152
*
*
* class FstBadWeightError(FstError, ValueError): # <<<<<<<<<<<<<<
*
* pass
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __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, 151, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __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, 151, __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, 152, __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, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstBadWeightError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstBadWeightError, __pyx_t_4) < 0) __PYX_ERR(0, 151, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstBadWeightError, __pyx_t_4) < 0) __PYX_ERR(0, 152, __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":156
+ /* "pywrapfst.pyx":157
*
*
* class FstIndexError(FstError, IndexError): # <<<<<<<<<<<<<<
*
* pass
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __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_IndexError);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_IndexError);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __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, 156, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __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, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstIndexError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstIndexError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIndexError, __pyx_t_4) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIndexError, __pyx_t_4) < 0) __PYX_ERR(0, 157, __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":161
+ /* "pywrapfst.pyx":162
*
*
* class FstIOError(FstError, IOError): # <<<<<<<<<<<<<<
*
* pass
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __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_IOError);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_IOError);
__pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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, 161, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstIOError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstIOError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIOError, __pyx_t_4) < 0) __PYX_ERR(0, 161, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIOError, __pyx_t_4) < 0) __PYX_ERR(0, 162, __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":166
+ /* "pywrapfst.pyx":167
*
*
* class FstOpError(FstError, RuntimeError): # <<<<<<<<<<<<<<
*
* pass
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __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, 166, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __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, 166, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __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, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstOpError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstOpError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstOpError, __pyx_t_4) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstOpError, __pyx_t_4) < 0) __PYX_ERR(0, 167, __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":460
+ /* "pywrapfst.pyx":461
*
* @classmethod
- * def Zero(cls, weight_type): # <<<<<<<<<<<<<<
+ * def zero(cls, weight_type): # <<<<<<<<<<<<<<
* """
- * Weight.Zero(weight_type)
+ * Weight.zero(weight_type)
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_Zero); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_zero); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":459
+ /* "pywrapfst.pyx":460
* # C++ part out-of-class and then call it from within.
*
* @classmethod # <<<<<<<<<<<<<<
- * def Zero(cls, weight_type):
+ * def zero(cls, weight_type):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_Zero, __pyx_t_1) < 0) __PYX_ERR(0, 460, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_zero, __pyx_t_1) < 0) __PYX_ERR(0, 461, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Weight);
- /* "pywrapfst.pyx":469
+ /* "pywrapfst.pyx":470
*
* @classmethod
- * def One(cls, weight_type): # <<<<<<<<<<<<<<
+ * def one(cls, weight_type): # <<<<<<<<<<<<<<
* """
- * Weight.One(weight_type)
+ * Weight.one(weight_type)
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_One); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_one); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":468
- * return _Zero(weight_type)
+ /* "pywrapfst.pyx":469
+ * return _zero(weight_type)
*
* @classmethod # <<<<<<<<<<<<<<
- * def One(cls, weight_type):
+ * def one(cls, weight_type):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_One, __pyx_t_2) < 0) __PYX_ERR(0, 469, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_one, __pyx_t_2) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Weight);
- /* "pywrapfst.pyx":478
+ /* "pywrapfst.pyx":479
*
* @classmethod
- * def NoWeight(cls, weight_type): # <<<<<<<<<<<<<<
+ * def no_weight(cls, weight_type): # <<<<<<<<<<<<<<
* """
- * Weight.NoWeight(weight_type)
+ * Weight.no_weight(weight_type)
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_NoWeight); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_no_weight); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":477
- * return _One(weight_type)
+ /* "pywrapfst.pyx":478
+ * return _one(weight_type)
*
* @classmethod # <<<<<<<<<<<<<<
- * def NoWeight(cls, weight_type):
+ * def no_weight(cls, weight_type):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_NoWeight, __pyx_t_1) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_no_weight, __pyx_t_1) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Weight);
- /* "pywrapfst.pyx":513
+ /* "pywrapfst.pyx":514
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* plus(lhs, rhs)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_1plus, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_1plus, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_plus, __pyx_t_1) < 0) __PYX_ERR(0, 513, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_plus, __pyx_t_1) < 0) __PYX_ERR(0, 514, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":545
+ /* "pywrapfst.pyx":546
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* times(lhs, rhs)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_3times, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error)
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_3times, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_times, __pyx_t_1) < 0) __PYX_ERR(0, 545, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_times, __pyx_t_1) < 0) __PYX_ERR(0, 546, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":577
+ /* "pywrapfst.pyx":578
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* divide(lhs, rhs)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_5divide, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_5divide, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_divide, __pyx_t_1) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_divide, __pyx_t_1) < 0) __PYX_ERR(0, 578, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":610
+ /* "pywrapfst.pyx":611
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
* """
* power(lhs, rhs)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_7power, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error)
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_7power, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_power, __pyx_t_1) < 0) __PYX_ERR(0, 610, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_power, __pyx_t_1) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":1009
+ /* "pywrapfst.pyx":1010
* return mutable_raw
*
* cpdef int64 add_symbol(self, symbol, int64 key=fst.kNoSymbol) except *: # <<<<<<<<<<<<<<
__pyx_k__6 = fst::kNoSymbol;
__pyx_k__6 = fst::kNoSymbol;
- /* "pywrapfst.pyx":1094
+ /* "pywrapfst.pyx":1095
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
* """
* SymbolTable.read(source)
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":1093
+ /* "pywrapfst.pyx":1094
* return self._smart_table.get()
*
* @classmethod # <<<<<<<<<<<<<<
* def read(cls, source):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1093, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read, __pyx_t_2) < 0) __PYX_ERR(0, 1094, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read, __pyx_t_2) < 0) __PYX_ERR(0, 1095, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":1115
+ /* "pywrapfst.pyx":1116
*
* @classmethod
* def read_text(cls, source, bool allow_negative_labels=False): # <<<<<<<<<<<<<<
* """
* SymbolTable.read_text(source)
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":1114
+ /* "pywrapfst.pyx":1115
* return _init_SymbolTable(move(_symbols))
*
* @classmethod # <<<<<<<<<<<<<<
* def read_text(cls, source, bool allow_negative_labels=False):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_text, __pyx_t_1) < 0) __PYX_ERR(0, 1115, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_text, __pyx_t_1) < 0) __PYX_ERR(0, 1116, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":1141
+ /* "pywrapfst.pyx":1142
*
* @classmethod
* def read_fst(cls, source, bool input_table): # <<<<<<<<<<<<<<
* """
* SymbolTable.read_fst(source, input_table)
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":1140
+ /* "pywrapfst.pyx":1141
* return _init_SymbolTable(move(_symbols))
*
* @classmethod # <<<<<<<<<<<<<<
* def read_fst(cls, source, bool input_table):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1140, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_fst, __pyx_t_2) < 0) __PYX_ERR(0, 1141, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_fst, __pyx_t_2) < 0) __PYX_ERR(0, 1142, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":1397
+ /* "pywrapfst.pyx":1399
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
* """
* EncodeMapper.read(source)
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1397, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":1396
- * return self._mapper.get().Properties(mask)
+ /* "pywrapfst.pyx":1398
+ * return FstProperties(self._mapper.get().Properties(mask.value))
*
* @classmethod # <<<<<<<<<<<<<<
* def read(cls, source):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1398, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper->tp_dict, __pyx_n_s_read, __pyx_t_1) < 0) __PYX_ERR(0, 1397, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper->tp_dict, __pyx_n_s_read, __pyx_t_1) < 0) __PYX_ERR(0, 1399, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_EncodeMapper);
- /* "pywrapfst.pyx":1419
+ /* "pywrapfst.pyx":1421
*
* @staticmethod
* def read_from_string(state): # <<<<<<<<<<<<<<
* """
* read_from_string(state)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_12EncodeMapper_19read_from_string, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_12EncodeMapper_19read_from_string, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper->tp_dict, __pyx_n_s_read_from_string, __pyx_t_1) < 0) __PYX_ERR(0, 1419, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper->tp_dict, __pyx_n_s_read_from_string, __pyx_t_1) < 0) __PYX_ERR(0, 1421, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_EncodeMapper);
- /* "pywrapfst.pyx":1418
+ /* "pywrapfst.pyx":1420
* return _init_EncodeMapper(_mapper.release())
*
* @staticmethod # <<<<<<<<<<<<<<
* def read_from_string(state):
* """
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_n_s_read_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_n_s_read_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1418, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper->tp_dict, __pyx_n_s_read_from_string, __pyx_t_2) < 0) __PYX_ERR(0, 1419, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper->tp_dict, __pyx_n_s_read_from_string, __pyx_t_2) < 0) __PYX_ERR(0, 1421, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_EncodeMapper);
- /* "pywrapfst.pyx":1915
+ /* "pywrapfst.pyx":1917
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
* """
* read(source)
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_Fst, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1915, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_Fst, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":1914
- * return self._fst.get().Properties(mask, test)
+ /* "pywrapfst.pyx":1916
+ * return FstProperties(self._fst.get().Properties(mask.value, test))
*
* @classmethod # <<<<<<<<<<<<<<
* def read(cls, source):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1916, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Fst->tp_dict, __pyx_n_s_read, __pyx_t_1) < 0) __PYX_ERR(0, 1915, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Fst->tp_dict, __pyx_n_s_read, __pyx_t_1) < 0) __PYX_ERR(0, 1917, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Fst);
- /* "pywrapfst.pyx":1933
+ /* "pywrapfst.pyx":1935
*
* @classmethod
* def read_from_string(cls, state): # <<<<<<<<<<<<<<
* """
* read_from_string(state)
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_Fst, __pyx_n_s_read_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1933, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_Fst, __pyx_n_s_read_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1935, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":1932
+ /* "pywrapfst.pyx":1934
* return _read_Fst(source)
*
* @classmethod # <<<<<<<<<<<<<<
* def read_from_string(cls, state):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1932, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1934, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Fst->tp_dict, __pyx_n_s_read_from_string, __pyx_t_2) < 0) __PYX_ERR(0, 1933, __pyx_L1_error)
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Fst->tp_dict, __pyx_n_s_read_from_string, __pyx_t_2) < 0) __PYX_ERR(0, 1935, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Fst);
- /* "pywrapfst.pyx":2306
+ /* "pywrapfst.pyx":2308
*
* cdef void _minimize(self,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__12 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2312
+ /* "pywrapfst.pyx":2314
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
*/
__pyx_k__13 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2407
+ /* "pywrapfst.pyx":2409
*
* cdef void _prune(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__14 = fst::kDelta;
- /* "pywrapfst.pyx":2408
+ /* "pywrapfst.pyx":2410
* cdef void _prune(self,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__15 = fst::kNoStateId;
- /* "pywrapfst.pyx":2417
+ /* "pywrapfst.pyx":2419
*
* def prune(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__16 = fst::kDelta;
- /* "pywrapfst.pyx":2418
+ /* "pywrapfst.pyx":2420
* def prune(self,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__17 = fst::kNoStateId;
- /* "pywrapfst.pyx":2443
+ /* "pywrapfst.pyx":2445
*
* cdef void _push(self,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__18 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2452
+ /* "pywrapfst.pyx":2454
*
* def push(self,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__19 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2683
+ /* "pywrapfst.pyx":2685
* bool connect=True,
* weight=None,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* float delta=fst.kShortestDelta) except *:
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(self.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
*/
__pyx_k__20 = fst::kNoStateId;
- /* "pywrapfst.pyx":2684
+ /* "pywrapfst.pyx":2686
* weight=None,
* int64 nstate=fst.kNoStateId,
* float delta=fst.kShortestDelta) except *: # <<<<<<<<<<<<<<
- * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(self.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
* weight)
*/
__pyx_k__21 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2701
+ /* "pywrapfst.pyx":2703
* bool connect=True,
* weight=None,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__22 = fst::kNoStateId;
- /* "pywrapfst.pyx":2702
+ /* "pywrapfst.pyx":2704
* weight=None,
* int64 nstate=fst.kNoStateId,
* float delta=fst.kShortestDelta): # <<<<<<<<<<<<<<
*/
__pyx_k__23 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2977
+ /* "pywrapfst.pyx":2976
*
*
* NO_LABEL = fst.kNoLabel # <<<<<<<<<<<<<<
* NO_STATE_ID = fst.kNoStateId
* NO_SYMBOL = fst.kNoSymbol
*/
- __pyx_t_2 = __Pyx_PyInt_From_int(fst::kNoLabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2977, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int(fst::kNoLabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2976, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_LABEL, __pyx_t_2) < 0) __PYX_ERR(0, 2977, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_LABEL, __pyx_t_2) < 0) __PYX_ERR(0, 2976, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2978
+ /* "pywrapfst.pyx":2977
*
* NO_LABEL = fst.kNoLabel
* NO_STATE_ID = fst.kNoStateId # <<<<<<<<<<<<<<
* NO_SYMBOL = fst.kNoSymbol
*
*/
- __pyx_t_2 = __Pyx_PyInt_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2978, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2977, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_STATE_ID, __pyx_t_2) < 0) __PYX_ERR(0, 2978, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_STATE_ID, __pyx_t_2) < 0) __PYX_ERR(0, 2977, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2979
+ /* "pywrapfst.pyx":2978
* NO_LABEL = fst.kNoLabel
* NO_STATE_ID = fst.kNoStateId
* NO_SYMBOL = fst.kNoSymbol # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(fst::kNoSymbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2979, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(fst::kNoSymbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2978, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_SYMBOL, __pyx_t_2) < 0) __PYX_ERR(0, 2979, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_SYMBOL, __pyx_t_2) < 0) __PYX_ERR(0, 2978, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2985
- *
+ /* "pywrapfst.pyx":2983
+ * ## FST properties.
*
- * EXPANDED = fst.kExpanded # <<<<<<<<<<<<<<
- * MUTABLE = fst.kMutable
- * ERROR = fst.kError
+ * class FstProperties(enum.Flag): # <<<<<<<<<<<<<<
+ * EXPANDED = fst.kExpanded
+ * MUTABLE = fst.kMutable
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2985, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2983, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXPANDED, __pyx_t_2) < 0) __PYX_ERR(0, 2985, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2983, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2983, __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_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2983, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstProperties, __pyx_n_s_FstProperties, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2983, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":2986
+ /* "pywrapfst.pyx":2984
*
- * EXPANDED = fst.kExpanded
- * MUTABLE = fst.kMutable # <<<<<<<<<<<<<<
- * ERROR = fst.kError
- * ACCEPTOR = fst.kAcceptor
+ * class FstProperties(enum.Flag):
+ * EXPANDED = fst.kExpanded # <<<<<<<<<<<<<<
+ * MUTABLE = fst.kMutable
+ * ERROR = fst.kError
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2986, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_MUTABLE, __pyx_t_2) < 0) __PYX_ERR(0, 2986, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2984, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EXPANDED, __pyx_t_4) < 0) __PYX_ERR(0, 2984, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "pywrapfst.pyx":2985
+ * class FstProperties(enum.Flag):
+ * EXPANDED = fst.kExpanded
+ * MUTABLE = fst.kMutable # <<<<<<<<<<<<<<
+ * ERROR = fst.kError
+ * ACCEPTOR = fst.kAcceptor
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2985, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MUTABLE, __pyx_t_4) < 0) __PYX_ERR(0, 2985, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "pywrapfst.pyx":2986
+ * EXPANDED = fst.kExpanded
+ * MUTABLE = fst.kMutable
+ * ERROR = fst.kError # <<<<<<<<<<<<<<
+ * ACCEPTOR = fst.kAcceptor
+ * NOT_ACCEPTOR = fst.kNotAcceptor
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2986, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ERROR, __pyx_t_4) < 0) __PYX_ERR(0, 2986, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2987
- * EXPANDED = fst.kExpanded
- * MUTABLE = fst.kMutable
- * ERROR = fst.kError # <<<<<<<<<<<<<<
- * ACCEPTOR = fst.kAcceptor
- * NOT_ACCEPTOR = fst.kNotAcceptor
+ * MUTABLE = fst.kMutable
+ * ERROR = fst.kError
+ * ACCEPTOR = fst.kAcceptor # <<<<<<<<<<<<<<
+ * NOT_ACCEPTOR = fst.kNotAcceptor
+ * I_DETERMINISTIC = fst.kIDeterministic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2987, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_2) < 0) __PYX_ERR(0, 2987, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2987, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ACCEPTOR, __pyx_t_4) < 0) __PYX_ERR(0, 2987, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2988
- * MUTABLE = fst.kMutable
- * ERROR = fst.kError
- * ACCEPTOR = fst.kAcceptor # <<<<<<<<<<<<<<
- * NOT_ACCEPTOR = fst.kNotAcceptor
- * I_DETERMINISTIC = fst.kIDeterministic
+ * ERROR = fst.kError
+ * ACCEPTOR = fst.kAcceptor
+ * NOT_ACCEPTOR = fst.kNotAcceptor # <<<<<<<<<<<<<<
+ * I_DETERMINISTIC = fst.kIDeterministic
+ * NON_I_DETERMINISTIC = fst.kNonIDeterministic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2988, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCEPTOR, __pyx_t_2) < 0) __PYX_ERR(0, 2988, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2988, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_4) < 0) __PYX_ERR(0, 2988, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2989
- * ERROR = fst.kError
- * ACCEPTOR = fst.kAcceptor
- * NOT_ACCEPTOR = fst.kNotAcceptor # <<<<<<<<<<<<<<
- * I_DETERMINISTIC = fst.kIDeterministic
- * NON_I_DETERMINISTIC = fst.kNonIDeterministic
+ * ACCEPTOR = fst.kAcceptor
+ * NOT_ACCEPTOR = fst.kNotAcceptor
+ * I_DETERMINISTIC = fst.kIDeterministic # <<<<<<<<<<<<<<
+ * NON_I_DETERMINISTIC = fst.kNonIDeterministic
+ * O_DETERMINISTIC = fst.kODeterministic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2989, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_2) < 0) __PYX_ERR(0, 2989, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2989, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_I_DETERMINISTIC, __pyx_t_4) < 0) __PYX_ERR(0, 2989, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2990
- * ACCEPTOR = fst.kAcceptor
- * NOT_ACCEPTOR = fst.kNotAcceptor
- * I_DETERMINISTIC = fst.kIDeterministic # <<<<<<<<<<<<<<
- * NON_I_DETERMINISTIC = fst.kNonIDeterministic
- * O_DETERMINISTIC = fst.kODeterministic
+ * NOT_ACCEPTOR = fst.kNotAcceptor
+ * I_DETERMINISTIC = fst.kIDeterministic
+ * NON_I_DETERMINISTIC = fst.kNonIDeterministic # <<<<<<<<<<<<<<
+ * O_DETERMINISTIC = fst.kODeterministic
+ * NON_O_DETERMINISTIC = fst.kNonODeterministic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2990, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2990, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2990, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_4) < 0) __PYX_ERR(0, 2990, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2991
- * NOT_ACCEPTOR = fst.kNotAcceptor
- * I_DETERMINISTIC = fst.kIDeterministic
- * NON_I_DETERMINISTIC = fst.kNonIDeterministic # <<<<<<<<<<<<<<
- * O_DETERMINISTIC = fst.kODeterministic
- * NON_O_DETERMINISTIC = fst.kNonODeterministic
+ * I_DETERMINISTIC = fst.kIDeterministic
+ * NON_I_DETERMINISTIC = fst.kNonIDeterministic
+ * O_DETERMINISTIC = fst.kODeterministic # <<<<<<<<<<<<<<
+ * NON_O_DETERMINISTIC = fst.kNonODeterministic
+ * EPSILONS = fst.kEpsilons
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2991, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2991, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2991, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_O_DETERMINISTIC, __pyx_t_4) < 0) __PYX_ERR(0, 2991, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2992
- * I_DETERMINISTIC = fst.kIDeterministic
- * NON_I_DETERMINISTIC = fst.kNonIDeterministic
- * O_DETERMINISTIC = fst.kODeterministic # <<<<<<<<<<<<<<
- * NON_O_DETERMINISTIC = fst.kNonODeterministic
- * EPSILONS = fst.kEpsilons
+ * NON_I_DETERMINISTIC = fst.kNonIDeterministic
+ * O_DETERMINISTIC = fst.kODeterministic
+ * NON_O_DETERMINISTIC = fst.kNonODeterministic # <<<<<<<<<<<<<<
+ * EPSILONS = fst.kEpsilons
+ * NO_EPSILONS = fst.kNoEpsilons
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2992, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2992, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2992, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_4) < 0) __PYX_ERR(0, 2992, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2993
- * NON_I_DETERMINISTIC = fst.kNonIDeterministic
- * O_DETERMINISTIC = fst.kODeterministic
- * NON_O_DETERMINISTIC = fst.kNonODeterministic # <<<<<<<<<<<<<<
- * EPSILONS = fst.kEpsilons
- * NO_EPSILONS = fst.kNoEpsilons
+ * O_DETERMINISTIC = fst.kODeterministic
+ * NON_O_DETERMINISTIC = fst.kNonODeterministic
+ * EPSILONS = fst.kEpsilons # <<<<<<<<<<<<<<
+ * NO_EPSILONS = fst.kNoEpsilons
+ * I_EPSILONS = fst.kIEpsilons
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2993, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2993, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2993, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EPSILONS, __pyx_t_4) < 0) __PYX_ERR(0, 2993, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2994
- * O_DETERMINISTIC = fst.kODeterministic
- * NON_O_DETERMINISTIC = fst.kNonODeterministic
- * EPSILONS = fst.kEpsilons # <<<<<<<<<<<<<<
- * NO_EPSILONS = fst.kNoEpsilons
- * I_EPSILONS = fst.kIEpsilons
+ * NON_O_DETERMINISTIC = fst.kNonODeterministic
+ * EPSILONS = fst.kEpsilons
+ * NO_EPSILONS = fst.kNoEpsilons # <<<<<<<<<<<<<<
+ * I_EPSILONS = fst.kIEpsilons
+ * NO_I_EPSILONS = fst.kNoIEpsilons
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2994, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2994, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2994, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NO_EPSILONS, __pyx_t_4) < 0) __PYX_ERR(0, 2994, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2995
- * NON_O_DETERMINISTIC = fst.kNonODeterministic
- * EPSILONS = fst.kEpsilons
- * NO_EPSILONS = fst.kNoEpsilons # <<<<<<<<<<<<<<
- * I_EPSILONS = fst.kIEpsilons
- * NO_I_EPSILONS = fst.kNoIEpsilons
+ * EPSILONS = fst.kEpsilons
+ * NO_EPSILONS = fst.kNoEpsilons
+ * I_EPSILONS = fst.kIEpsilons # <<<<<<<<<<<<<<
+ * NO_I_EPSILONS = fst.kNoIEpsilons
+ * O_EPSILONS = fst.kOEpsilons
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2995, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2995, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2995, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_I_EPSILONS, __pyx_t_4) < 0) __PYX_ERR(0, 2995, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2996
- * EPSILONS = fst.kEpsilons
- * NO_EPSILONS = fst.kNoEpsilons
- * I_EPSILONS = fst.kIEpsilons # <<<<<<<<<<<<<<
- * NO_I_EPSILONS = fst.kNoIEpsilons
- * O_EPSILONS = fst.kOEpsilons
+ * NO_EPSILONS = fst.kNoEpsilons
+ * I_EPSILONS = fst.kIEpsilons
+ * NO_I_EPSILONS = fst.kNoIEpsilons # <<<<<<<<<<<<<<
+ * O_EPSILONS = fst.kOEpsilons
+ * NO_O_EPSILONS = fst.kNoOEpsilons
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2996, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2996, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2996, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NO_I_EPSILONS, __pyx_t_4) < 0) __PYX_ERR(0, 2996, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2997
- * NO_EPSILONS = fst.kNoEpsilons
- * I_EPSILONS = fst.kIEpsilons
- * NO_I_EPSILONS = fst.kNoIEpsilons # <<<<<<<<<<<<<<
- * O_EPSILONS = fst.kOEpsilons
- * NO_O_EPSILONS = fst.kNoOEpsilons
+ * I_EPSILONS = fst.kIEpsilons
+ * NO_I_EPSILONS = fst.kNoIEpsilons
+ * O_EPSILONS = fst.kOEpsilons # <<<<<<<<<<<<<<
+ * NO_O_EPSILONS = fst.kNoOEpsilons
+ * I_LABEL_SORTED = fst.kILabelSorted
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2997, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_I_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2997, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2997, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_O_EPSILONS, __pyx_t_4) < 0) __PYX_ERR(0, 2997, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2998
- * I_EPSILONS = fst.kIEpsilons
- * NO_I_EPSILONS = fst.kNoIEpsilons
- * O_EPSILONS = fst.kOEpsilons # <<<<<<<<<<<<<<
- * NO_O_EPSILONS = fst.kNoOEpsilons
- * I_LABEL_SORTED = fst.kILabelSorted
+ * NO_I_EPSILONS = fst.kNoIEpsilons
+ * O_EPSILONS = fst.kOEpsilons
+ * NO_O_EPSILONS = fst.kNoOEpsilons # <<<<<<<<<<<<<<
+ * I_LABEL_SORTED = fst.kILabelSorted
+ * NOT_I_LABEL_SORTED = fst.kNotILabelSorted
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2998, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2998, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NO_O_EPSILONS, __pyx_t_4) < 0) __PYX_ERR(0, 2998, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":2999
- * 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
+ * O_EPSILONS = fst.kOEpsilons
+ * NO_O_EPSILONS = fst.kNoOEpsilons
+ * I_LABEL_SORTED = fst.kILabelSorted # <<<<<<<<<<<<<<
+ * NOT_I_LABEL_SORTED = fst.kNotILabelSorted
+ * O_LABEL_SORTED = fst.kOLabelSorted
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2999, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_O_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2999, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2999, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_I_LABEL_SORTED, __pyx_t_4) < 0) __PYX_ERR(0, 2999, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3000
- * 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
+ * NO_O_EPSILONS = fst.kNoOEpsilons
+ * I_LABEL_SORTED = fst.kILabelSorted
+ * NOT_I_LABEL_SORTED = fst.kNotILabelSorted # <<<<<<<<<<<<<<
+ * O_LABEL_SORTED = fst.kOLabelSorted
+ * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3000, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 3000, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3000, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_4) < 0) __PYX_ERR(0, 3000, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3001
- * 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
+ * I_LABEL_SORTED = fst.kILabelSorted
+ * NOT_I_LABEL_SORTED = fst.kNotILabelSorted
+ * O_LABEL_SORTED = fst.kOLabelSorted # <<<<<<<<<<<<<<
+ * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
+ * WEIGHTED = fst.kWeighted
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3001, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 3001, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3001, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_O_LABEL_SORTED, __pyx_t_4) < 0) __PYX_ERR(0, 3001, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3002
- * 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
+ * NOT_I_LABEL_SORTED = fst.kNotILabelSorted
+ * O_LABEL_SORTED = fst.kOLabelSorted
+ * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted # <<<<<<<<<<<<<<
+ * WEIGHTED = fst.kWeighted
+ * UNWEIGHTED = fst.kUnweighted
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3002, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 3002, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3002, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_4) < 0) __PYX_ERR(0, 3002, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3003
- * NOT_I_LABEL_SORTED = fst.kNotILabelSorted
- * O_LABEL_SORTED = fst.kOLabelSorted
- * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted # <<<<<<<<<<<<<<
- * WEIGHTED = fst.kWeighted
- * UNWEIGHTED = fst.kUnweighted
+ * O_LABEL_SORTED = fst.kOLabelSorted
+ * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
+ * WEIGHTED = fst.kWeighted # <<<<<<<<<<<<<<
+ * UNWEIGHTED = fst.kUnweighted
+ * CYCLIC = fst.kCyclic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3003, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 3003, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3003, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_WEIGHTED, __pyx_t_4) < 0) __PYX_ERR(0, 3003, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3004
- * O_LABEL_SORTED = fst.kOLabelSorted
- * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
- * WEIGHTED = fst.kWeighted # <<<<<<<<<<<<<<
- * UNWEIGHTED = fst.kUnweighted
- * CYCLIC = fst.kCyclic
+ * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
+ * WEIGHTED = fst.kWeighted
+ * UNWEIGHTED = fst.kUnweighted # <<<<<<<<<<<<<<
+ * CYCLIC = fst.kCyclic
+ * ACYCLIC = fst.kAcyclic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3004, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED, __pyx_t_2) < 0) __PYX_ERR(0, 3004, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3004, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_UNWEIGHTED, __pyx_t_4) < 0) __PYX_ERR(0, 3004, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3005
- * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
- * WEIGHTED = fst.kWeighted
- * UNWEIGHTED = fst.kUnweighted # <<<<<<<<<<<<<<
- * CYCLIC = fst.kCyclic
- * ACYCLIC = fst.kAcyclic
+ * WEIGHTED = fst.kWeighted
+ * UNWEIGHTED = fst.kUnweighted
+ * CYCLIC = fst.kCyclic # <<<<<<<<<<<<<<
+ * ACYCLIC = fst.kAcyclic
+ * INITIAL_CYCLIC = fst.kInitialCyclic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3005, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED, __pyx_t_2) < 0) __PYX_ERR(0, 3005, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3005, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CYCLIC, __pyx_t_4) < 0) __PYX_ERR(0, 3005, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3006
- * WEIGHTED = fst.kWeighted
- * UNWEIGHTED = fst.kUnweighted
- * CYCLIC = fst.kCyclic # <<<<<<<<<<<<<<
- * ACYCLIC = fst.kAcyclic
- * INITIAL_CYCLIC = fst.kInitialCyclic
+ * UNWEIGHTED = fst.kUnweighted
+ * CYCLIC = fst.kCyclic
+ * ACYCLIC = fst.kAcyclic # <<<<<<<<<<<<<<
+ * INITIAL_CYCLIC = fst.kInitialCyclic
+ * INITIAL_ACYCLIC = fst.kInitialAcyclic
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3006, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_CYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 3006, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3006, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ACYCLIC, __pyx_t_4) < 0) __PYX_ERR(0, 3006, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3007
- * UNWEIGHTED = fst.kUnweighted
- * CYCLIC = fst.kCyclic
- * ACYCLIC = fst.kAcyclic # <<<<<<<<<<<<<<
- * INITIAL_CYCLIC = fst.kInitialCyclic
- * INITIAL_ACYCLIC = fst.kInitialAcyclic
+ * CYCLIC = fst.kCyclic
+ * ACYCLIC = fst.kAcyclic
+ * INITIAL_CYCLIC = fst.kInitialCyclic # <<<<<<<<<<<<<<
+ * INITIAL_ACYCLIC = fst.kInitialAcyclic
+ * TOP_SORTED = fst.kTopSorted
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3007, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 3007, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3007, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_4) < 0) __PYX_ERR(0, 3007, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3008
- * CYCLIC = fst.kCyclic
- * ACYCLIC = fst.kAcyclic
- * INITIAL_CYCLIC = fst.kInitialCyclic # <<<<<<<<<<<<<<
- * INITIAL_ACYCLIC = fst.kInitialAcyclic
- * TOP_SORTED = fst.kTopSorted
+ * ACYCLIC = fst.kAcyclic
+ * INITIAL_CYCLIC = fst.kInitialCyclic
+ * INITIAL_ACYCLIC = fst.kInitialAcyclic # <<<<<<<<<<<<<<
+ * TOP_SORTED = fst.kTopSorted
+ * NOT_TOP_SORTED = fst.kNotTopSorted
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3008, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 3008, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3008, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_4) < 0) __PYX_ERR(0, 3008, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3009
- * ACYCLIC = fst.kAcyclic
- * INITIAL_CYCLIC = fst.kInitialCyclic
- * INITIAL_ACYCLIC = fst.kInitialAcyclic # <<<<<<<<<<<<<<
- * TOP_SORTED = fst.kTopSorted
- * NOT_TOP_SORTED = fst.kNotTopSorted
+ * INITIAL_CYCLIC = fst.kInitialCyclic
+ * INITIAL_ACYCLIC = fst.kInitialAcyclic
+ * TOP_SORTED = fst.kTopSorted # <<<<<<<<<<<<<<
+ * NOT_TOP_SORTED = fst.kNotTopSorted
+ * ACCESSIBLE = fst.kAccessible
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3009, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 3009, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3009, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_TOP_SORTED, __pyx_t_4) < 0) __PYX_ERR(0, 3009, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3010
- * INITIAL_CYCLIC = fst.kInitialCyclic
- * INITIAL_ACYCLIC = fst.kInitialAcyclic
- * TOP_SORTED = fst.kTopSorted # <<<<<<<<<<<<<<
- * NOT_TOP_SORTED = fst.kNotTopSorted
- * ACCESSIBLE = fst.kAccessible
+ * INITIAL_ACYCLIC = fst.kInitialAcyclic
+ * TOP_SORTED = fst.kTopSorted
+ * NOT_TOP_SORTED = fst.kNotTopSorted # <<<<<<<<<<<<<<
+ * ACCESSIBLE = fst.kAccessible
+ * NOT_ACCESSIBLE = fst.kNotAccessible
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3010, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOP_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 3010, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3010, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_4) < 0) __PYX_ERR(0, 3010, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3011
- * INITIAL_ACYCLIC = fst.kInitialAcyclic
- * TOP_SORTED = fst.kTopSorted
- * NOT_TOP_SORTED = fst.kNotTopSorted # <<<<<<<<<<<<<<
- * ACCESSIBLE = fst.kAccessible
- * NOT_ACCESSIBLE = fst.kNotAccessible
+ * TOP_SORTED = fst.kTopSorted
+ * NOT_TOP_SORTED = fst.kNotTopSorted
+ * ACCESSIBLE = fst.kAccessible # <<<<<<<<<<<<<<
+ * NOT_ACCESSIBLE = fst.kNotAccessible
+ * COACCESSIBLE = fst.kCoAccessible
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3011, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 3011, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3011, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ACCESSIBLE, __pyx_t_4) < 0) __PYX_ERR(0, 3011, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3012
- * TOP_SORTED = fst.kTopSorted
- * NOT_TOP_SORTED = fst.kNotTopSorted
- * ACCESSIBLE = fst.kAccessible # <<<<<<<<<<<<<<
- * NOT_ACCESSIBLE = fst.kNotAccessible
- * COACCESSIBLE = fst.kCoAccessible
+ * NOT_TOP_SORTED = fst.kNotTopSorted
+ * ACCESSIBLE = fst.kAccessible
+ * NOT_ACCESSIBLE = fst.kNotAccessible # <<<<<<<<<<<<<<
+ * COACCESSIBLE = fst.kCoAccessible
+ * NOT_COACCESSIBLE = fst.kNotCoAccessible
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3012, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 3012, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3012, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_4) < 0) __PYX_ERR(0, 3012, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3013
- * NOT_TOP_SORTED = fst.kNotTopSorted
- * ACCESSIBLE = fst.kAccessible
- * NOT_ACCESSIBLE = fst.kNotAccessible # <<<<<<<<<<<<<<
- * COACCESSIBLE = fst.kCoAccessible
- * NOT_COACCESSIBLE = fst.kNotCoAccessible
+ * ACCESSIBLE = fst.kAccessible
+ * NOT_ACCESSIBLE = fst.kNotAccessible
+ * COACCESSIBLE = fst.kCoAccessible # <<<<<<<<<<<<<<
+ * NOT_COACCESSIBLE = fst.kNotCoAccessible
+ * STRING = fst.kString
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3013, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 3013, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3013, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_COACCESSIBLE, __pyx_t_4) < 0) __PYX_ERR(0, 3013, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3014
- * ACCESSIBLE = fst.kAccessible
- * NOT_ACCESSIBLE = fst.kNotAccessible
- * COACCESSIBLE = fst.kCoAccessible # <<<<<<<<<<<<<<
- * NOT_COACCESSIBLE = fst.kNotCoAccessible
- * STRING = fst.kString
+ * NOT_ACCESSIBLE = fst.kNotAccessible
+ * COACCESSIBLE = fst.kCoAccessible
+ * NOT_COACCESSIBLE = fst.kNotCoAccessible # <<<<<<<<<<<<<<
+ * STRING = fst.kString
+ * NOT_STRING = fst.kNotString
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3014, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 3014, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3014, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_4) < 0) __PYX_ERR(0, 3014, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3015
- * NOT_ACCESSIBLE = fst.kNotAccessible
- * COACCESSIBLE = fst.kCoAccessible
- * NOT_COACCESSIBLE = fst.kNotCoAccessible # <<<<<<<<<<<<<<
- * STRING = fst.kString
- * NOT_STRING = fst.kNotString
+ * COACCESSIBLE = fst.kCoAccessible
+ * NOT_COACCESSIBLE = fst.kNotCoAccessible
+ * STRING = fst.kString # <<<<<<<<<<<<<<
+ * NOT_STRING = fst.kNotString
+ * WEIGHTED_CYCLES = fst.kWeightedCycles
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3015, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 3015, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3015, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_STRING, __pyx_t_4) < 0) __PYX_ERR(0, 3015, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3016
- * COACCESSIBLE = fst.kCoAccessible
- * NOT_COACCESSIBLE = fst.kNotCoAccessible
- * STRING = fst.kString # <<<<<<<<<<<<<<
- * NOT_STRING = fst.kNotString
- * WEIGHTED_CYCLES = fst.kWeightedCycles
+ * NOT_COACCESSIBLE = fst.kNotCoAccessible
+ * STRING = fst.kString
+ * NOT_STRING = fst.kNotString # <<<<<<<<<<<<<<
+ * WEIGHTED_CYCLES = fst.kWeightedCycles
+ * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3016, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 3016, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3016, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_STRING, __pyx_t_4) < 0) __PYX_ERR(0, 3016, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3017
- * NOT_COACCESSIBLE = fst.kNotCoAccessible
- * STRING = fst.kString
- * NOT_STRING = fst.kNotString # <<<<<<<<<<<<<<
- * WEIGHTED_CYCLES = fst.kWeightedCycles
- * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
+ * STRING = fst.kString
+ * NOT_STRING = fst.kNotString
+ * WEIGHTED_CYCLES = fst.kWeightedCycles # <<<<<<<<<<<<<<
+ * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
+ * # TODO(wolfsonkin): Figure out how to keep the composite properties (all the
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3017, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 3017, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3017, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_4) < 0) __PYX_ERR(0, 3017, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3018
- * STRING = fst.kString
- * NOT_STRING = fst.kNotString
- * WEIGHTED_CYCLES = fst.kWeightedCycles # <<<<<<<<<<<<<<
- * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
- * NULL_PROPERTIES = fst.kNullProperties
- */
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3018, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_2) < 0) __PYX_ERR(0, 3018, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "pywrapfst.pyx":3019
- * NOT_STRING = fst.kNotString
- * WEIGHTED_CYCLES = fst.kWeightedCycles
- * UNWEIGHTED_CYCLES = fst.kUnweightedCycles # <<<<<<<<<<<<<<
- * NULL_PROPERTIES = fst.kNullProperties
- * COPY_PROPERTIES = fst.kCopyProperties
- */
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3019, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_2) < 0) __PYX_ERR(0, 3019, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "pywrapfst.pyx":3020
- * WEIGHTED_CYCLES = fst.kWeightedCycles
- * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
- * NULL_PROPERTIES = fst.kNullProperties # <<<<<<<<<<<<<<
- * COPY_PROPERTIES = fst.kCopyProperties
- * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
- */
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3020, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3020, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "pywrapfst.pyx":3021
- * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
- * NULL_PROPERTIES = fst.kNullProperties
- * COPY_PROPERTIES = fst.kCopyProperties # <<<<<<<<<<<<<<
- * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
- * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
+ * NOT_STRING = fst.kNotString
+ * WEIGHTED_CYCLES = fst.kWeightedCycles
+ * UNWEIGHTED_CYCLES = fst.kUnweightedCycles # <<<<<<<<<<<<<<
+ * # TODO(wolfsonkin): Figure out how to keep the composite properties (all the
+ * # below properties) out of the `repr`, but still available as an attribute on
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3021, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COPY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3021, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3018, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_4) < 0) __PYX_ERR(0, 3018, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3022
- * NULL_PROPERTIES = fst.kNullProperties
- * COPY_PROPERTIES = fst.kCopyProperties
- * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties # <<<<<<<<<<<<<<
- * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
- * SET_START_PROPERTIES = fst.kSetStartProperties
+ * # below properties) out of the `repr`, but still available as an attribute on
+ * # the class. I think this could be done with `property`.
+ * NULL_PROPERTIES = fst.kNullProperties # <<<<<<<<<<<<<<
+ * COPY_PROPERTIES = fst.kCopyProperties
+ * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3022, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3022, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3022, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NULL_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3022, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3023
- * COPY_PROPERTIES = fst.kCopyProperties
- * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
- * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties # <<<<<<<<<<<<<<
- * SET_START_PROPERTIES = fst.kSetStartProperties
- * SET_FINAL_PROPERTIES = fst.kSetFinalProperties
+ * # the class. I think this could be done with `property`.
+ * NULL_PROPERTIES = fst.kNullProperties
+ * COPY_PROPERTIES = fst.kCopyProperties # <<<<<<<<<<<<<<
+ * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
+ * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3023, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3023, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3023, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_COPY_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3023, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3024
- * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
- * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
- * SET_START_PROPERTIES = fst.kSetStartProperties # <<<<<<<<<<<<<<
- * SET_FINAL_PROPERTIES = fst.kSetFinalProperties
- * ADD_STATE_PROPERTIES = fst.kAddStateProperties
+ * NULL_PROPERTIES = fst.kNullProperties
+ * COPY_PROPERTIES = fst.kCopyProperties
+ * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties # <<<<<<<<<<<<<<
+ * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
+ * SET_START_PROPERTIES = fst.kSetStartProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3024, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3024, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3024, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3024, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3025
- * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
- * SET_START_PROPERTIES = fst.kSetStartProperties
- * SET_FINAL_PROPERTIES = fst.kSetFinalProperties # <<<<<<<<<<<<<<
- * ADD_STATE_PROPERTIES = fst.kAddStateProperties
- * ADD_ARC_PROPERTIES = fst.kAddArcProperties
+ * COPY_PROPERTIES = fst.kCopyProperties
+ * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
+ * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties # <<<<<<<<<<<<<<
+ * SET_START_PROPERTIES = fst.kSetStartProperties
+ * SET_FINAL_PROPERTIES = fst.kSetFinalProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3025, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3025, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3025, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3025, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3026
- * 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
+ * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
+ * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
+ * SET_START_PROPERTIES = fst.kSetStartProperties # <<<<<<<<<<<<<<
+ * SET_FINAL_PROPERTIES = fst.kSetFinalProperties
+ * ADD_STATE_PROPERTIES = fst.kAddStateProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3026, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3026, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3026, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3026, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3027
- * 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
+ * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
+ * SET_START_PROPERTIES = fst.kSetStartProperties
+ * SET_FINAL_PROPERTIES = fst.kSetFinalProperties # <<<<<<<<<<<<<<
+ * ADD_STATE_PROPERTIES = fst.kAddStateProperties
+ * ADD_ARC_PROPERTIES = fst.kAddArcProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3027, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3027, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3027, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3028
- * 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
+ * SET_START_PROPERTIES = fst.kSetStartProperties
+ * SET_FINAL_PROPERTIES = fst.kSetFinalProperties
+ * ADD_STATE_PROPERTIES = fst.kAddStateProperties # <<<<<<<<<<<<<<
+ * ADD_ARC_PROPERTIES = fst.kAddArcProperties
+ * SET_ARC_PROPERTIES = fst.kSetArcProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3028, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3028, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3028, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3028, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3029
- * 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
+ * SET_FINAL_PROPERTIES = fst.kSetFinalProperties
+ * ADD_STATE_PROPERTIES = fst.kAddStateProperties
+ * ADD_ARC_PROPERTIES = fst.kAddArcProperties # <<<<<<<<<<<<<<
+ * SET_ARC_PROPERTIES = fst.kSetArcProperties
+ * DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3029, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3029, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3029, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3029, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3030
- * 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
+ * ADD_STATE_PROPERTIES = fst.kAddStateProperties
+ * ADD_ARC_PROPERTIES = fst.kAddArcProperties
+ * SET_ARC_PROPERTIES = fst.kSetArcProperties # <<<<<<<<<<<<<<
+ * DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
+ * DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3030, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3030, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3030, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3030, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3031
- * 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
+ * ADD_ARC_PROPERTIES = fst.kAddArcProperties
+ * SET_ARC_PROPERTIES = fst.kSetArcProperties
+ * DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties # <<<<<<<<<<<<<<
+ * DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
+ * STATE_SORT_PROPERTIES = fst.kStateSortProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3031, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3031, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3031, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3031, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3032
- * 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
+ * SET_ARC_PROPERTIES = fst.kSetArcProperties
+ * DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
+ * DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties # <<<<<<<<<<<<<<
+ * STATE_SORT_PROPERTIES = fst.kStateSortProperties
+ * ARC_SORT_PROPERTIES = fst.kArcSortProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3032, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3032, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3032, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3032, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3033
- * 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
+ * DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
+ * DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
+ * STATE_SORT_PROPERTIES = fst.kStateSortProperties # <<<<<<<<<<<<<<
+ * ARC_SORT_PROPERTIES = fst.kArcSortProperties
+ * I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3033, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3033, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3033, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3033, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3034
- * 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
+ * DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
+ * STATE_SORT_PROPERTIES = fst.kStateSortProperties
+ * ARC_SORT_PROPERTIES = fst.kArcSortProperties # <<<<<<<<<<<<<<
+ * I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
+ * O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3034, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3034, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3034, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3034, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3035
- * 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
+ * STATE_SORT_PROPERTIES = fst.kStateSortProperties
+ * ARC_SORT_PROPERTIES = fst.kArcSortProperties
+ * I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties # <<<<<<<<<<<<<<
+ * O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
+ * WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3035, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3035, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3035, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3035, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3036
- * 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
+ * ARC_SORT_PROPERTIES = fst.kArcSortProperties
+ * I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
+ * O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties # <<<<<<<<<<<<<<
+ * WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
+ * ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3036, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3036, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3036, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3036, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3037
- * WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
- * ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
- * RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties # <<<<<<<<<<<<<<
- * BINARY_PROPERTIES = fst.kBinaryProperties
- * TRINARY_PROPERTIES = fst.kTrinaryProperties
+ * I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
+ * O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
+ * WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties # <<<<<<<<<<<<<<
+ * ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
+ * RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3037, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3037, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3037, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3037, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3038
- * ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
- * RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
- * BINARY_PROPERTIES = fst.kBinaryProperties # <<<<<<<<<<<<<<
- * TRINARY_PROPERTIES = fst.kTrinaryProperties
- * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
+ * O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
+ * WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
+ * ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties # <<<<<<<<<<<<<<
+ * RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
+ * BINARY_PROPERTIES = fst.kBinaryProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3038, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3038, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3038, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3038, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3039
- * RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
- * BINARY_PROPERTIES = fst.kBinaryProperties
- * TRINARY_PROPERTIES = fst.kTrinaryProperties # <<<<<<<<<<<<<<
- * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
- * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
+ * WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
+ * ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
+ * RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties # <<<<<<<<<<<<<<
+ * BINARY_PROPERTIES = fst.kBinaryProperties
+ * TRINARY_PROPERTIES = fst.kTrinaryProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3039, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3039, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3039, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3039, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3040
- * BINARY_PROPERTIES = fst.kBinaryProperties
- * TRINARY_PROPERTIES = fst.kTrinaryProperties
- * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties # <<<<<<<<<<<<<<
- * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
- * FST_PROPERTIES = fst.kFstProperties
+ * ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
+ * RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
+ * BINARY_PROPERTIES = fst.kBinaryProperties # <<<<<<<<<<<<<<
+ * TRINARY_PROPERTIES = fst.kTrinaryProperties
+ * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3040, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3040, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3040, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3040, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "pywrapfst.pyx":3041
- * TRINARY_PROPERTIES = fst.kTrinaryProperties
- * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
- * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties # <<<<<<<<<<<<<<
- * FST_PROPERTIES = fst.kFstProperties
+ * 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_4 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3041, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3041, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "pywrapfst.pyx":3042
+ * BINARY_PROPERTIES = fst.kBinaryProperties
+ * TRINARY_PROPERTIES = fst.kTrinaryProperties
+ * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties # <<<<<<<<<<<<<<
+ * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
+ * FST_PROPERTIES = fst.kFstProperties
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3042, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3042, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "pywrapfst.pyx":3043
+ * TRINARY_PROPERTIES = fst.kTrinaryProperties
+ * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
+ * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties # <<<<<<<<<<<<<<
+ * FST_PROPERTIES = fst.kFstProperties
*
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3041, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3041, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3043, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3043, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "pywrapfst.pyx":3044
+ * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
+ * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
+ * FST_PROPERTIES = fst.kFstProperties # <<<<<<<<<<<<<<
+ *
+ * for name, member in FstProperties.__members__.items():
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3044, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_FST_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3044, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "pywrapfst.pyx":2983
+ * ## FST properties.
+ *
+ * class FstProperties(enum.Flag): # <<<<<<<<<<<<<<
+ * EXPANDED = fst.kExpanded
+ * MUTABLE = fst.kMutable
+ */
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstProperties, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2983, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstProperties, __pyx_t_4) < 0) __PYX_ERR(0, 2983, __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":3042
- * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
- * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
- * FST_PROPERTIES = fst.kFstProperties # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3046
+ * FST_PROPERTIES = fst.kFstProperties
*
+ * for name, member in FstProperties.__members__.items(): # <<<<<<<<<<<<<<
+ * globals()[name] = member
*
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3042, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FST_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 3042, __pyx_L1_error)
+ __pyx_t_5 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3046, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_members); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3046, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (unlikely(__pyx_t_3 == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
+ __PYX_ERR(0, 3046, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_dict_iterator(__pyx_t_3, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3046, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_2);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_t_1 = 0;
+ while (1) {
+ __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_1, &__pyx_t_3, NULL, __pyx_t_7);
+ if (unlikely(__pyx_t_8 == 0)) break;
+ if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 3046, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_name_2, __pyx_t_1) < 0) __PYX_ERR(0, 3046, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_member, __pyx_t_3) < 0) __PYX_ERR(0, 3046, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "pywrapfst.pyx":3047
+ *
+ * for name, member in FstProperties.__members__.items():
+ * globals()[name] = member # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_member); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3047, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3047, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (unlikely(__pyx_t_1 == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(0, 3047, __pyx_L1_error)
+ }
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3047, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_3) < 0)) __PYX_ERR(0, 3047, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3048
+ /* "pywrapfst.pyx":3053
*
*
* ARC_I_LABEL_VALUE = fst.kArcILabelValue # <<<<<<<<<<<<<<
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcILabelValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3048, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcILabelValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3053, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_I_LABEL_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3048, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_I_LABEL_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3053, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3049
+ /* "pywrapfst.pyx":3054
*
* 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_2 = __Pyx_PyInt_From_uint8_t(fst::kArcOLabelValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3049, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcOLabelValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3054, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_O_LABEL_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3049, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_O_LABEL_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3054, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3050
+ /* "pywrapfst.pyx":3055
* 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_2 = __Pyx_PyInt_From_uint8_t(fst::kArcWeightValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3050, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcWeightValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3055, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_WEIGHT_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3050, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_WEIGHT_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3055, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3051
+ /* "pywrapfst.pyx":3056
* 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_2 = __Pyx_PyInt_From_uint8_t(fst::kArcNextStateValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3051, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcNextStateValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3056, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NEXT_STATE_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3051, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NEXT_STATE_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3056, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3052
+ /* "pywrapfst.pyx":3057
* 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_2 = __Pyx_PyInt_From_uint8_t(fst::kArcNoCache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3052, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcNoCache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3057, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NO_CACHE, __pyx_t_2) < 0) __PYX_ERR(0, 3052, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NO_CACHE, __pyx_t_2) < 0) __PYX_ERR(0, 3057, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3053
+ /* "pywrapfst.pyx":3058
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
* ARC_NO_CACHE = fst.kArcNoCache
* ARC_VALUE_FLAGS = fst.kArcValueFlags # <<<<<<<<<<<<<<
* ARC_FLAGS = fst.kArcFlags
*
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcValueFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3053, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcValueFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3058, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_VALUE_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3053, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_VALUE_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3058, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3054
+ /* "pywrapfst.pyx":3059
* ARC_NO_CACHE = fst.kArcNoCache
* ARC_VALUE_FLAGS = fst.kArcValueFlags
* ARC_FLAGS = fst.kArcFlags # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3054, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3059, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3054, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3059, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3060
+ /* "pywrapfst.pyx":3065
*
*
* ENCODE_LABELS = fst.kEncodeLabels # <<<<<<<<<<<<<<
* ENCODE_WEIGHTS = fst.kEncodeWeights
* ENCODE_FLAGS = fst.kEncodeFlags
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kEncodeLabels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3060, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kEncodeLabels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3065, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_LABELS, __pyx_t_2) < 0) __PYX_ERR(0, 3060, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_LABELS, __pyx_t_2) < 0) __PYX_ERR(0, 3065, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3061
+ /* "pywrapfst.pyx":3066
*
* ENCODE_LABELS = fst.kEncodeLabels
* ENCODE_WEIGHTS = fst.kEncodeWeights # <<<<<<<<<<<<<<
* ENCODE_FLAGS = fst.kEncodeFlags
*
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kEncodeWeights); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3061, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kEncodeWeights); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3066, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_WEIGHTS, __pyx_t_2) < 0) __PYX_ERR(0, 3061, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_WEIGHTS, __pyx_t_2) < 0) __PYX_ERR(0, 3066, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3062
+ /* "pywrapfst.pyx":3067
* ENCODE_LABELS = fst.kEncodeLabels
* ENCODE_WEIGHTS = fst.kEncodeWeights
* ENCODE_FLAGS = fst.kEncodeFlags # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kEncodeFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3062, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kEncodeFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3062, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3067, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3434
+ /* "pywrapfst.pyx":3439
*
* cdef Fst _map(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__32 = fst::kDelta;
- /* "pywrapfst.pyx":3450
+ /* "pywrapfst.pyx":3455
*
* cpdef Fst arcmap(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__33 = fst::kDelta;
- /* "pywrapfst.pyx":3449
+ /* "pywrapfst.pyx":3454
*
*
* cpdef Fst arcmap(Fst ifst, # <<<<<<<<<<<<<<
*/
__pyx_k__33 = fst::kDelta;
- /* "pywrapfst.pyx":3559
+ /* "pywrapfst.pyx":3564
*
* cpdef MutableFst determinize(Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__34 = fst::kShortestDelta;
- /* "pywrapfst.pyx":3561
+ /* "pywrapfst.pyx":3566
* float delta=fst.kShortestDelta,
* det_type="functional",
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__35 = fst::kNoStateId;
- /* "pywrapfst.pyx":3559
+ /* "pywrapfst.pyx":3564
*
* cpdef MutableFst determinize(Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__34 = fst::kShortestDelta;
- /* "pywrapfst.pyx":3561
+ /* "pywrapfst.pyx":3566
* float delta=fst.kShortestDelta,
* det_type="functional",
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__35 = fst::kNoStateId;
- /* "pywrapfst.pyx":3658
+ /* "pywrapfst.pyx":3663
*
* cpdef MutableFst disambiguate(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__36 = fst::kDelta;
- /* "pywrapfst.pyx":3659
+ /* "pywrapfst.pyx":3664
* cpdef MutableFst disambiguate(Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__37 = fst::kNoStateId;
- /* "pywrapfst.pyx":3658
+ /* "pywrapfst.pyx":3663
*
* cpdef MutableFst disambiguate(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__36 = fst::kDelta;
- /* "pywrapfst.pyx":3659
+ /* "pywrapfst.pyx":3664
* cpdef MutableFst disambiguate(Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__37 = fst::kNoStateId;
- /* "pywrapfst.pyx":3729
+ /* "pywrapfst.pyx":3734
*
*
* cpdef bool equal(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
__pyx_k__38 = fst::kDelta;
__pyx_k__38 = fst::kDelta;
- /* "pywrapfst.pyx":3750
+ /* "pywrapfst.pyx":3755
*
*
* cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
__pyx_k__39 = fst::kDelta;
__pyx_k__39 = fst::kDelta;
- /* "pywrapfst.pyx":3806
+ /* "pywrapfst.pyx":3811
*
*
* cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
__pyx_k__40 = fst::kDelta;
__pyx_k__40 = fst::kDelta;
- /* "pywrapfst.pyx":3831
+ /* "pywrapfst.pyx":3836
*
* cpdef MutableFst prune(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__41 = fst::kDelta;
- /* "pywrapfst.pyx":3832
+ /* "pywrapfst.pyx":3837
* cpdef MutableFst prune(Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__42 = fst::kNoStateId;
- /* "pywrapfst.pyx":3831
+ /* "pywrapfst.pyx":3836
*
* cpdef MutableFst prune(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__41 = fst::kDelta;
- /* "pywrapfst.pyx":3832
+ /* "pywrapfst.pyx":3837
* cpdef MutableFst prune(Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__42 = fst::kNoStateId;
- /* "pywrapfst.pyx":3863
+ /* "pywrapfst.pyx":3868
*
* cpdef MutableFst push(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__43 = fst::kDelta;
- /* "pywrapfst.pyx":3862
+ /* "pywrapfst.pyx":3867
*
*
* cpdef MutableFst push(Fst ifst, # <<<<<<<<<<<<<<
*/
__pyx_k__43 = fst::kDelta;
- /* "pywrapfst.pyx":3921
+ /* "pywrapfst.pyx":3926
* Fst ifst2,
* int32 npath=1,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__44 = fst::kDelta;
- /* "pywrapfst.pyx":3923
+ /* "pywrapfst.pyx":3928
* float delta=fst.kDelta,
* select="uniform",
* int32 max_length=INT32_MAX, # <<<<<<<<<<<<<<
*/
__pyx_k__45 = INT32_MAX;
- /* "pywrapfst.pyx":3921
+ /* "pywrapfst.pyx":3926
* Fst ifst2,
* int32 npath=1,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__44 = fst::kDelta;
- /* "pywrapfst.pyx":3923
+ /* "pywrapfst.pyx":3928
* float delta=fst.kDelta,
* select="uniform",
* int32 max_length=INT32_MAX, # <<<<<<<<<<<<<<
*/
__pyx_k__45 = INT32_MAX;
- /* "pywrapfst.pyx":3973
+ /* "pywrapfst.pyx":3978
* int32 npath=1,
* select="uniform",
* int32 max_length=INT32_MAX, # <<<<<<<<<<<<<<
*/
__pyx_k__46 = INT32_MAX;
- /* "pywrapfst.pyx":3970
+ /* "pywrapfst.pyx":3975
*
*
* cpdef MutableFst randgen(Fst ifst, # <<<<<<<<<<<<<<
*/
__pyx_k__46 = INT32_MAX;
- /* "pywrapfst.pyx":4112
+ /* "pywrapfst.pyx":4117
* cdef void _shortestdistance(Fst ifst,
* vector[fst.WeightClass] *distance,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__47 = fst::kShortestDelta;
- /* "pywrapfst.pyx":4113
+ /* "pywrapfst.pyx":4118
* vector[fst.WeightClass] *distance,
* float delta=fst.kShortestDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__48 = fst::kNoStateId;
- /* "pywrapfst.pyx":4131
+ /* "pywrapfst.pyx":4136
*
* def shortestdistance(Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__49 = fst::kShortestDelta;
- /* "pywrapfst.pyx":4132
+ /* "pywrapfst.pyx":4137
* def shortestdistance(Fst ifst,
* float delta=fst.kShortestDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__50 = fst::kNoStateId;
- /* "pywrapfst.pyx":4130
+ /* "pywrapfst.pyx":4135
*
*
* def shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kShortestDelta,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_55shortestdistance, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4130, __pyx_L1_error)
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_55shortestdistance, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_2) < 0) __PYX_ERR(0, 4130, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_2) < 0) __PYX_ERR(0, 4135, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":4168
+ /* "pywrapfst.pyx":4173
*
* cpdef MutableFst shortestpath(Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__51 = fst::kShortestDelta;
- /* "pywrapfst.pyx":4170
+ /* "pywrapfst.pyx":4175
* float delta=fst.kShortestDelta,
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__52 = fst::kNoStateId;
- /* "pywrapfst.pyx":4168
+ /* "pywrapfst.pyx":4173
*
* cpdef MutableFst shortestpath(Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
*/
__pyx_k__51 = fst::kShortestDelta;
- /* "pywrapfst.pyx":4170
+ /* "pywrapfst.pyx":4175
* float delta=fst.kShortestDelta,
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
*/
__pyx_k__52 = fst::kNoStateId;
- /* "pywrapfst.pyx":4435
+ /* "pywrapfst.pyx":4440
*
* @classmethod
* def open(cls, *sources): # <<<<<<<<<<<<<<
* """
* FarReader.open(*sources)
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4435, __pyx_L1_error)
+ __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4434
+ /* "pywrapfst.pyx":4439
* return f"<{self.far_type()} FarReader at 0x{id(self):x}>"
*
* @classmethod # <<<<<<<<<<<<<<
* def open(cls, *sources):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4434, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4439, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarReader->tp_dict, __pyx_n_s_open, __pyx_t_1) < 0) __PYX_ERR(0, 4435, __pyx_L1_error)
- __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_3) < 0) __PYX_ERR(0, 4440, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_FarReader);
- /* "pywrapfst.pyx":4594
+ /* "pywrapfst.pyx":4599
*
* @classmethod
* def create(cls, source, arc_type="standard", far_type="default"): # <<<<<<<<<<<<<<
* """
* FarWriter.
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4594, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4599, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":4593
+ /* "pywrapfst.pyx":4598
* return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
*
* @classmethod # <<<<<<<<<<<<<<
* def create(cls, source, arc_type="standard", far_type="default"):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4593, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarWriter->tp_dict, __pyx_n_s_create, __pyx_t_2) < 0) __PYX_ERR(0, 4594, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarWriter->tp_dict, __pyx_n_s_create, __pyx_t_2) < 0) __PYX_ERR(0, 4599, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_FarWriter);
- /* "pywrapfst.pyx":4685
+ /* "pywrapfst.pyx":4690
*
* # Masks fst_error_fatal in-module.
* fst.FLAGS_fst_error_fatal = False # <<<<<<<<<<<<<<
return result;
}
+/* PyObjectGetMethod */
+static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
+ PyObject *attr;
+#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
+ PyTypeObject *tp = Py_TYPE(obj);
+ PyObject *descr;
+ descrgetfunc f = NULL;
+ PyObject **dictptr, *dict;
+ int meth_found = 0;
+ assert (*method == NULL);
+ if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
+ attr = __Pyx_PyObject_GetAttrStr(obj, name);
+ goto try_unpack;
+ }
+ if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
+ return 0;
+ }
+ descr = _PyType_Lookup(tp, name);
+ if (likely(descr != NULL)) {
+ Py_INCREF(descr);
+#if PY_MAJOR_VERSION >= 3
+ #ifdef __Pyx_CyFunction_USED
+ if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
+ #else
+ if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
+ #endif
+#else
+ #ifdef __Pyx_CyFunction_USED
+ if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
+ #else
+ if (likely(PyFunction_Check(descr)))
+ #endif
+#endif
+ {
+ meth_found = 1;
+ } else {
+ f = Py_TYPE(descr)->tp_descr_get;
+ if (f != NULL && PyDescr_IsData(descr)) {
+ attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
+ Py_DECREF(descr);
+ goto try_unpack;
+ }
+ }
+ }
+ dictptr = _PyObject_GetDictPtr(obj);
+ if (dictptr != NULL && (dict = *dictptr) != NULL) {
+ Py_INCREF(dict);
+ attr = __Pyx_PyDict_GetItemStr(dict, name);
+ if (attr != NULL) {
+ Py_INCREF(attr);
+ Py_DECREF(dict);
+ Py_XDECREF(descr);
+ goto try_unpack;
+ }
+ Py_DECREF(dict);
+ }
+ if (meth_found) {
+ *method = descr;
+ return 1;
+ }
+ if (f != NULL) {
+ attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
+ Py_DECREF(descr);
+ goto try_unpack;
+ }
+ if (descr != NULL) {
+ *method = descr;
+ return 0;
+ }
+ PyErr_Format(PyExc_AttributeError,
+#if PY_MAJOR_VERSION >= 3
+ "'%.50s' object has no attribute '%U'",
+ tp->tp_name, name);
+#else
+ "'%.50s' object has no attribute '%.400s'",
+ tp->tp_name, PyString_AS_STRING(name));
+#endif
+ return 0;
+#else
+ attr = __Pyx_PyObject_GetAttrStr(obj, name);
+ goto try_unpack;
+#endif
+try_unpack:
+#if CYTHON_UNPACK_METHODS
+ if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
+ PyObject *function = PyMethod_GET_FUNCTION(attr);
+ Py_INCREF(function);
+ Py_DECREF(attr);
+ *method = function;
+ return 1;
+ }
+#endif
+ *method = attr;
+ return 0;
+}
+
+/* PyObjectCallMethod0 */
+static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
+ PyObject *method = NULL, *result = NULL;
+ int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
+ if (likely(is_method)) {
+ result = __Pyx_PyObject_CallOneArg(method, obj);
+ Py_DECREF(method);
+ return result;
+ }
+ if (unlikely(!method)) goto bad;
+ result = __Pyx_PyObject_CallNoArg(method);
+ Py_DECREF(method);
+bad:
+ return result;
+}
+
+/* RaiseNoneIterError */
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+}
+
+/* UnpackTupleError */
+static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
+ if (t == Py_None) {
+ __Pyx_RaiseNoneNotIterableError();
+ } else if (PyTuple_GET_SIZE(t) < index) {
+ __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
+ } else {
+ __Pyx_RaiseTooManyValuesError(index);
+ }
+}
+
+/* UnpackTuple2 */
+static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
+ PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
+ PyObject *value1 = NULL, *value2 = NULL;
+#if CYTHON_COMPILING_IN_PYPY
+ value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
+ value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
+#else
+ value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
+ value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
+#endif
+ if (decref_tuple) {
+ Py_DECREF(tuple);
+ }
+ *pvalue1 = value1;
+ *pvalue2 = value2;
+ return 0;
+#if CYTHON_COMPILING_IN_PYPY
+bad:
+ Py_XDECREF(value1);
+ Py_XDECREF(value2);
+ if (decref_tuple) { Py_XDECREF(tuple); }
+ return -1;
+#endif
+}
+static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
+ int has_known_size, int decref_tuple) {
+ Py_ssize_t index;
+ PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
+ iternextfunc iternext;
+ iter = PyObject_GetIter(tuple);
+ if (unlikely(!iter)) goto bad;
+ if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
+ iternext = Py_TYPE(iter)->tp_iternext;
+ value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
+ value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
+ if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
+ Py_DECREF(iter);
+ *pvalue1 = value1;
+ *pvalue2 = value2;
+ return 0;
+unpacking_failed:
+ if (!has_known_size && __Pyx_IterFinish() == 0)
+ __Pyx_RaiseNeedMoreValuesError(index);
+bad:
+ Py_XDECREF(iter);
+ Py_XDECREF(value1);
+ Py_XDECREF(value2);
+ if (decref_tuple) { Py_XDECREF(tuple); }
+ return -1;
+}
+
+/* dict_iter */
+static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
+ Py_ssize_t* p_orig_length, int* p_source_is_dict) {
+ is_dict = is_dict || likely(PyDict_CheckExact(iterable));
+ *p_source_is_dict = is_dict;
+ if (is_dict) {
+#if !CYTHON_COMPILING_IN_PYPY
+ *p_orig_length = PyDict_Size(iterable);
+ Py_INCREF(iterable);
+ return iterable;
+#elif PY_MAJOR_VERSION >= 3
+ static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
+ PyObject **pp = NULL;
+ if (method_name) {
+ const char *name = PyUnicode_AsUTF8(method_name);
+ if (strcmp(name, "iteritems") == 0) pp = &py_items;
+ else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
+ else if (strcmp(name, "itervalues") == 0) pp = &py_values;
+ if (pp) {
+ if (!*pp) {
+ *pp = PyUnicode_FromString(name + 4);
+ if (!*pp)
+ return NULL;
+ }
+ method_name = *pp;
+ }
+ }
+#endif
+ }
+ *p_orig_length = 0;
+ if (method_name) {
+ PyObject* iter;
+ iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
+ if (!iterable)
+ return NULL;
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
+ return iterable;
+#endif
+ iter = PyObject_GetIter(iterable);
+ Py_DECREF(iterable);
+ return iter;
+ }
+ return PyObject_GetIter(iterable);
+}
+static CYTHON_INLINE int __Pyx_dict_iter_next(
+ PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
+ PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
+ PyObject* next_item;
+#if !CYTHON_COMPILING_IN_PYPY
+ if (source_is_dict) {
+ PyObject *key, *value;
+ if (unlikely(orig_length != PyDict_Size(iter_obj))) {
+ PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
+ return -1;
+ }
+ if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
+ return 0;
+ }
+ if (pitem) {
+ PyObject* tuple = PyTuple_New(2);
+ if (unlikely(!tuple)) {
+ return -1;
+ }
+ Py_INCREF(key);
+ Py_INCREF(value);
+ PyTuple_SET_ITEM(tuple, 0, key);
+ PyTuple_SET_ITEM(tuple, 1, value);
+ *pitem = tuple;
+ } else {
+ if (pkey) {
+ Py_INCREF(key);
+ *pkey = key;
+ }
+ if (pvalue) {
+ Py_INCREF(value);
+ *pvalue = value;
+ }
+ }
+ return 1;
+ } else if (PyTuple_CheckExact(iter_obj)) {
+ Py_ssize_t pos = *ppos;
+ if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
+ *ppos = pos + 1;
+ next_item = PyTuple_GET_ITEM(iter_obj, pos);
+ Py_INCREF(next_item);
+ } else if (PyList_CheckExact(iter_obj)) {
+ Py_ssize_t pos = *ppos;
+ if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
+ *ppos = pos + 1;
+ next_item = PyList_GET_ITEM(iter_obj, pos);
+ Py_INCREF(next_item);
+ } else
+#endif
+ {
+ next_item = PyIter_Next(iter_obj);
+ if (unlikely(!next_item)) {
+ return __Pyx_IterFinish();
+ }
+ }
+ if (pitem) {
+ *pitem = next_item;
+ } else if (pkey && pvalue) {
+ if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
+ return -1;
+ } else if (pkey) {
+ *pkey = next_item;
+ } else {
+ *pvalue = next_item;
+ }
+ return 1;
+}
+
+/* GetAttr */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
+#if CYTHON_USE_TYPE_SLOTS
+#if PY_MAJOR_VERSION >= 3
+ if (likely(PyUnicode_Check(n)))
+#else
+ if (likely(PyString_Check(n)))
+#endif
+ return __Pyx_PyObject_GetAttrStr(o, n);
+#endif
+ return PyObject_GetAttr(o, n);
+}
+
+/* Globals */
+static PyObject* __Pyx_Globals(void) {
+ Py_ssize_t i;
+ PyObject *names;
+ PyObject *globals = __pyx_d;
+ Py_INCREF(globals);
+ names = PyObject_Dir(__pyx_m);
+ if (!names)
+ goto bad;
+ for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject* name = PySequence_ITEM(names, i);
+ if (!name)
+ goto bad;
+#else
+ PyObject* name = PyList_GET_ITEM(names, i);
+#endif
+ if (!PyDict_Contains(globals, name)) {
+ PyObject* value = __Pyx_GetAttr(__pyx_m, name);
+ if (!value) {
+#if CYTHON_COMPILING_IN_PYPY
+ Py_DECREF(name);
+#endif
+ goto bad;
+ }
+ if (PyDict_SetItem(globals, name, value) < 0) {
+#if CYTHON_COMPILING_IN_PYPY
+ Py_DECREF(name);
+#endif
+ Py_DECREF(value);
+ goto bad;
+ }
+ }
+#if CYTHON_COMPILING_IN_PYPY
+ Py_DECREF(name);
+#endif
+ }
+ Py_DECREF(names);
+ return globals;
+bad:
+ Py_XDECREF(names);
+ Py_XDECREF(globals);
+ return NULL;
+}
+
/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
}
/* CIntFromPy */
-static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) {
- const uint64_t neg_one = (uint64_t) ((uint64_t) 0 - (uint64_t) 1), const_zero = (uint64_t) 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- if (sizeof(uint64_t) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x))
- } else {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- goto raise_neg_overflow;
- }
- return (uint64_t) val;
- }
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (uint64_t) 0;
- case 1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, digits[0])
- case 2:
- if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT) {
- return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
- }
- }
- break;
- case 3:
- if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT) {
- return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
- }
- }
- break;
- case 4:
- if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(uint64_t) >= 4 * PyLong_SHIFT) {
- return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
- }
- }
- break;
- }
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(Py_SIZE(x) < 0)) {
- goto raise_neg_overflow;
- }
-#else
- {
- int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
- if (unlikely(result < 0))
- return (uint64_t) -1;
- if (unlikely(result == 1))
- goto raise_neg_overflow;
- }
-#endif
- if (sizeof(uint64_t) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x))
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
-#endif
- }
- } else {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (uint64_t) 0;
- case -1: __PYX_VERIFY_RETURN_INT(uint64_t, sdigit, (sdigit) (-(sdigit)digits[0]))
- case 1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, +digits[0])
- case -2:
- if (8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
- return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
- }
- }
- break;
- case 2:
- if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
- return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
- }
- }
- break;
- case -3:
- if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
- return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
- }
- }
- break;
- case 3:
- if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
- return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
- }
- }
- break;
- case -4:
- if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT) {
- return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
- }
- }
- break;
- case 4:
- if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT) {
- return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
- }
- }
- break;
- }
-#endif
- if (sizeof(uint64_t) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x))
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
-#endif
- }
- }
- {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
- PyErr_SetString(PyExc_RuntimeError,
- "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
- uint64_t val;
- PyObject *v = __Pyx_PyNumber_IntOrLong(x);
- #if PY_MAJOR_VERSION < 3
- if (likely(v) && !PyLong_Check(v)) {
- PyObject *tmp = v;
- v = PyNumber_Long(tmp);
- Py_DECREF(tmp);
- }
- #endif
- if (likely(v)) {
- int one = 1; int is_little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&val;
- int ret = _PyLong_AsByteArray((PyLongObject *)v,
- bytes, sizeof(val),
- is_little, !is_unsigned);
- Py_DECREF(v);
- if (likely(!ret))
- return val;
- }
-#endif
- return (uint64_t) -1;
- }
- } else {
- uint64_t val;
- PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
- if (!tmp) return (uint64_t) -1;
- val = __Pyx_PyInt_As_uint64_t(tmp);
- Py_DECREF(tmp);
- return val;
- }
-raise_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to uint64_t");
- return (uint64_t) -1;
-raise_neg_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to uint64_t");
- return (uint64_t) -1;
-}
-
-/* CIntFromPy */
static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) {
const int32_t neg_one = (int32_t) ((int32_t) 0 - (int32_t) 1), const_zero = (int32_t) 0;
const int is_unsigned = neg_one > const_zero;
}
/* CIntFromPy */
+static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) {
+ const uint64_t neg_one = (uint64_t) ((uint64_t) 0 - (uint64_t) 1), const_zero = (uint64_t) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(uint64_t) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (uint64_t) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (uint64_t) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, digits[0])
+ case 2:
+ if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT) {
+ return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT) {
+ return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(uint64_t) >= 4 * PyLong_SHIFT) {
+ return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (uint64_t) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(uint64_t) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (uint64_t) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(uint64_t, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
+ return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
+ return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
+ return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
+ return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT) {
+ return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT) {
+ return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(uint64_t) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ uint64_t val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (uint64_t) -1;
+ }
+ } else {
+ uint64_t val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (uint64_t) -1;
+ val = __Pyx_PyInt_As_uint64_t(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to uint64_t");
+ return (uint64_t) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to uint64_t");
+ return (uint64_t) -1;
+}
+
+/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
goto done;
}
-/* PyObjectGetMethod */
-static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
- PyObject *attr;
-#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
- PyTypeObject *tp = Py_TYPE(obj);
- PyObject *descr;
- descrgetfunc f = NULL;
- PyObject **dictptr, *dict;
- int meth_found = 0;
- assert (*method == NULL);
- if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
- attr = __Pyx_PyObject_GetAttrStr(obj, name);
- goto try_unpack;
- }
- if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
- return 0;
- }
- descr = _PyType_Lookup(tp, name);
- if (likely(descr != NULL)) {
- Py_INCREF(descr);
-#if PY_MAJOR_VERSION >= 3
- #ifdef __Pyx_CyFunction_USED
- if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
- #else
- if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
- #endif
-#else
- #ifdef __Pyx_CyFunction_USED
- if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
- #else
- if (likely(PyFunction_Check(descr)))
- #endif
-#endif
- {
- meth_found = 1;
- } else {
- f = Py_TYPE(descr)->tp_descr_get;
- if (f != NULL && PyDescr_IsData(descr)) {
- attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
- Py_DECREF(descr);
- goto try_unpack;
- }
- }
- }
- dictptr = _PyObject_GetDictPtr(obj);
- if (dictptr != NULL && (dict = *dictptr) != NULL) {
- Py_INCREF(dict);
- attr = __Pyx_PyDict_GetItemStr(dict, name);
- if (attr != NULL) {
- Py_INCREF(attr);
- Py_DECREF(dict);
- Py_XDECREF(descr);
- goto try_unpack;
- }
- Py_DECREF(dict);
- }
- if (meth_found) {
- *method = descr;
- return 1;
- }
- if (f != NULL) {
- attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
- Py_DECREF(descr);
- goto try_unpack;
- }
- if (descr != NULL) {
- *method = descr;
- return 0;
- }
- PyErr_Format(PyExc_AttributeError,
-#if PY_MAJOR_VERSION >= 3
- "'%.50s' object has no attribute '%U'",
- tp->tp_name, name);
-#else
- "'%.50s' object has no attribute '%.400s'",
- tp->tp_name, PyString_AS_STRING(name));
-#endif
- return 0;
-#else
- attr = __Pyx_PyObject_GetAttrStr(obj, name);
- goto try_unpack;
-#endif
-try_unpack:
-#if CYTHON_UNPACK_METHODS
- if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
- PyObject *function = PyMethod_GET_FUNCTION(attr);
- Py_INCREF(function);
- Py_DECREF(attr);
- *method = function;
- return 1;
- }
-#endif
- *method = attr;
- return 0;
-}
-
/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);