-/* Generated by Cython 0.29.15 */
-
-/* BEGIN: Cython Metadata
-{
- "distutils": {
- "depends": [],
- "extra_compile_args": [
- "-std=c++17",
- "-Wno-register",
- "-Wno-unused-function",
- "-Wno-unused-local-typedefs",
- "-funsigned-char"
- ],
- "language": "c++",
- "libraries": [
- "fstfarscript",
- "fstfar",
- "fstscript",
- "fst",
- "m",
- "dl"
- ],
- "name": "pywrapfst",
- "sources": [
- "src/pywrapfst.pyx"
- ]
- },
- "module_name": "pywrapfst"
-}
-END: Cython Metadata */
+/* Generated by Cython 0.29.20 */
#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_15"
-#define CYTHON_HEX_VERSION 0x001D0FF0
+#define CYTHON_ABI "0_29_20"
+#define CYTHON_HEX_VERSION 0x001D14F0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
#define PyString_Type PyUnicode_Type
#define PyString_Check PyUnicode_Check
#define PyString_CheckExact PyUnicode_CheckExact
+#ifndef PyObject_Unicode
#define PyObject_Unicode PyObject_Str
#endif
+#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
#define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#ifndef PySet_CheckExact
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
+#if PY_VERSION_HEX >= 0x030900A4
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
+ #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
+#else
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
+ #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
+#endif
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
#else
#define __Pyx_truncl truncl
#endif
-
+#define __PYX_MARK_ERR_POS(f_index, lineno) \
+ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
-{ \
- __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
-}
+ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
#ifndef __PYX_EXTERN_C
#ifdef __cplusplus
#define __PYX_HAVE__pywrapfst
#define __PYX_HAVE_API__pywrapfst
/* Early includes */
-#include <stddef.h>
-#include <time.h>
#include "ios"
#include "new"
#include "stdexcept"
#include <string.h>
#include <string>
#include <utility>
+
+ #if __cplusplus > 199711L
+ #include <type_traits>
+
+ namespace cython_std {
+ template <typename T> typename std::remove_reference<T>::type&& move(T& t) noexcept { return std::move(t); }
+ template <typename T> typename std::remove_reference<T>::type&& move(T&& t) noexcept { return std::move(t); }
+ }
+
+ #endif
+
#include <vector>
#include <stdint.h>
#include <fst/types.h>
#include <fst/extensions/far/far.h>
#include <fst/extensions/far/getters.h>
#include <fst/extensions/far/far-class.h>
-#include <sys/types.h>
-#include <unistd.h>
+#include <stddef.h>
+#include <time.h>
#include <fst/compat.h>
#include <type_traits>
static const char *__pyx_f[] = {
- "src/pywrapfst.pyx",
+ "pywrapfst.pyx",
"stringsource",
};
/*--- Type declarations ---*/
struct __pyx_obj_9pywrapfst_Weight;
-struct __pyx_obj_9pywrapfst__SymbolTable;
+struct __pyx_obj_9pywrapfst_SymbolTableView;
struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView;
struct __pyx_obj_9pywrapfst__FstSymbolTableView;
struct __pyx_obj_9pywrapfst__MutableSymbolTable;
struct __pyx_obj_9pywrapfst_FarWriter;
struct __pyx_obj_9pywrapfst___pyx_scope_struct____iter__;
-/* "cpywrapfst.pxd":500
+/* "cpywrapfst.pxd":507
*
*
* ctypedef pair[int64, const FstClass *] LabelFstClassPair # <<<<<<<<<<<<<<
*/
typedef std::pair<int64,fst::script::FstClass const *> __pyx_t_10cpywrapfst_LabelFstClassPair;
-/* "cpywrapfst.pxd":502
+/* "cpywrapfst.pxd":509
* ctypedef pair[int64, const FstClass *] LabelFstClassPair
*
* ctypedef pair[int64, int64] LabelPair # <<<<<<<<<<<<<<
struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol;
struct __pyx_opt_args_9pywrapfst_3Fst_draw;
struct __pyx_opt_args_9pywrapfst_3Fst_print;
-struct __pyx_opt_args_9pywrapfst_3Fst_text;
struct __pyx_opt_args_9pywrapfst_10MutableFst__arcsort;
struct __pyx_opt_args_9pywrapfst_10MutableFst__closure;
struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_arcs;
struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_states;
struct __pyx_opt_args_9pywrapfst_10MutableFst__minimize;
-struct __pyx_opt_args_9pywrapfst_10MutableFst__project;
struct __pyx_opt_args_9pywrapfst_10MutableFst__prune;
struct __pyx_opt_args_9pywrapfst_10MutableFst__push;
struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_pairs;
*
* cpdef int64 add_symbol(self, symbol, int64 key=?) except * # <<<<<<<<<<<<<<
*
- * cpdef void add_table(self, _SymbolTable syms) except *
+ * cpdef void add_table(self, SymbolTableView syms) except *
*/
struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol {
int __pyx_n;
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
* source,
- * _SymbolTable isymbols=?,
+ * SymbolTableView isymbols=?,
*/
struct __pyx_opt_args_9pywrapfst_3Fst_draw {
int __pyx_n;
- struct __pyx_obj_9pywrapfst__SymbolTable *isymbols;
- struct __pyx_obj_9pywrapfst__SymbolTable *osymbols;
- struct __pyx_obj_9pywrapfst__SymbolTable *ssymbols;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *isymbols;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *osymbols;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *ssymbols;
bool acceptor;
PyObject *title;
double width;
* cpdef _FstSymbolTableView output_symbols(self)
*
* cpdef string print(self, # <<<<<<<<<<<<<<
- * _SymbolTable isymbols=?,
- * _SymbolTable osymbols=?,
+ * SymbolTableView isymbols=?,
+ * SymbolTableView osymbols=?,
*/
struct __pyx_opt_args_9pywrapfst_3Fst_print {
int __pyx_n;
- struct __pyx_obj_9pywrapfst__SymbolTable *isymbols;
- struct __pyx_obj_9pywrapfst__SymbolTable *osymbols;
- struct __pyx_obj_9pywrapfst__SymbolTable *ssymbols;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *isymbols;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *osymbols;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *ssymbols;
bool acceptor;
bool show_weight_one;
PyObject *missing_sym;
};
-/* "pywrapfst.pxd":308
- * cpdef StateIterator states(self)
- *
- * cpdef string text(self, # <<<<<<<<<<<<<<
- * _SymbolTable isymbols=?,
- * _SymbolTable osymbols=?,
- */
-struct __pyx_opt_args_9pywrapfst_3Fst_text {
- int __pyx_n;
- struct __pyx_obj_9pywrapfst__SymbolTable *isymbols;
- struct __pyx_obj_9pywrapfst__SymbolTable *osymbols;
- struct __pyx_obj_9pywrapfst__SymbolTable *ssymbols;
- bool acceptor;
- bool show_weight_one;
- PyObject *missing_sym;
-};
-
-/* "pywrapfst.pxd":337
+/* "pywrapfst.pxd":329
* cpdef void add_states(self, size_t)
*
* cdef void _arcsort(self, sort_type=?) except * # <<<<<<<<<<<<<<
PyObject *sort_type;
};
-/* "pywrapfst.pxd":339
+/* "pywrapfst.pxd":331
* cdef void _arcsort(self, sort_type=?) except *
*
* cdef void _closure(self, bool closure_plus=?) # <<<<<<<<<<<<<<
bool closure_plus;
};
-/* "pywrapfst.pxd":347
+/* "pywrapfst.pxd":339
* cdef void _decode(self, EncodeMapper) except *
*
* cdef void _delete_arcs(self, int64 state, size_t n=?) except * # <<<<<<<<<<<<<<
size_t n;
};
-/* "pywrapfst.pxd":349
+/* "pywrapfst.pxd":341
* cdef void _delete_arcs(self, int64 state, size_t n=?) except *
*
* cdef void _delete_states(self, states=?) except * # <<<<<<<<<<<<<<
PyObject *states;
};
-/* "pywrapfst.pxd":355
+/* "pywrapfst.pxd":347
* cdef void _invert(self)
*
* cdef void _minimize(self, float delta=?, bool allow_nondet=?) except * # <<<<<<<<<<<<<<
bool allow_nondet;
};
-/* "pywrapfst.pxd":361
- * cpdef int64 num_states(self)
- *
- * cdef void _project(self, bool project_output=?) except * # <<<<<<<<<<<<<<
- *
- * cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except *
- */
-struct __pyx_opt_args_9pywrapfst_10MutableFst__project {
- int __pyx_n;
- bool project_output;
-};
-
-/* "pywrapfst.pxd":363
- * cdef void _project(self, bool project_output=?) except *
+/* "pywrapfst.pxd":355
+ * cdef void _project(self, project_type) except *
*
* cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except * # <<<<<<<<<<<<<<
*
PyObject *weight;
};
-/* "pywrapfst.pxd":365
+/* "pywrapfst.pxd":357
* cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except *
*
* cdef void _push(self, # <<<<<<<<<<<<<<
bool to_final;
};
-/* "pywrapfst.pxd":370
+/* "pywrapfst.pxd":362
* bool to_final=?)
*
* cdef void _relabel_pairs(self, ipairs=?, opairs=?) except * # <<<<<<<<<<<<<<
PyObject *opairs;
};
-/* "pywrapfst.pxd":372
+/* "pywrapfst.pxd":364
* cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *
*
* cdef void _relabel_tables(self, # <<<<<<<<<<<<<<
- * _SymbolTable old_isymbols=?,
- * _SymbolTable new_isymbols=?,
+ * SymbolTableView old_isymbols=?,
+ * SymbolTableView new_isymbols=?,
*/
struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_tables {
int __pyx_n;
- struct __pyx_obj_9pywrapfst__SymbolTable *old_isymbols;
- struct __pyx_obj_9pywrapfst__SymbolTable *new_isymbols;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *old_isymbols;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *new_isymbols;
PyObject *unknown_isymbol;
bool attach_new_isymbols;
- struct __pyx_obj_9pywrapfst__SymbolTable *old_osymbols;
- struct __pyx_obj_9pywrapfst__SymbolTable *new_osymbols;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *old_osymbols;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *new_osymbols;
PyObject *unknown_osymbol;
bool attach_new_osymbols;
};
-/* "pywrapfst.pxd":386
+/* "pywrapfst.pxd":378
* cdef void _reserve_states(self, int64 n)
*
* cdef void _reweight(self, potentials, bool to_final=?) except * # <<<<<<<<<<<<<<
bool to_final;
};
-/* "pywrapfst.pxd":388
+/* "pywrapfst.pxd":380
* cdef void _reweight(self, potentials, bool to_final=?) except *
*
* cdef void _rmepsilon(self, # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":395
+/* "pywrapfst.pxd":387
* float delta=?) except *
*
* cdef void _set_final(self, int64 state, weight=?) except * # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":503
+/* "pywrapfst.pxd":495
*
*
* cdef Fst _map(Fst ifst, float delta=?, map_type=?, double power=?, weight=?) # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":505
+/* "pywrapfst.pxd":497
* 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":507
+/* "pywrapfst.pxd":499
* cpdef Fst arcmap(Fst ifst, float delta=?, map_type=?, double power=?, weight=?)
*
* cpdef MutableFst compose(Fst ifst1, # <<<<<<<<<<<<<<
bool connect;
};
-/* "pywrapfst.pxd":512
+/* "pywrapfst.pxd":504
* bool connect=?)
*
* cpdef Fst convert(Fst ifst, fst_type=?) # <<<<<<<<<<<<<<
PyObject *fst_type;
};
-/* "pywrapfst.pxd":514
+/* "pywrapfst.pxd":506
* cpdef Fst convert(Fst ifst, fst_type=?)
*
* cpdef MutableFst determinize(Fst ifst, # <<<<<<<<<<<<<<
bool increment_subsequential_label;
};
-/* "pywrapfst.pxd":522
+/* "pywrapfst.pxd":514
* bool increment_subsequential_label=?)
*
* cpdef MutableFst difference(Fst ifst1, # <<<<<<<<<<<<<<
bool connect;
};
-/* "pywrapfst.pxd":527
+/* "pywrapfst.pxd":519
* bool connect=?)
*
* cpdef MutableFst disambiguate(Fst ifst, # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":533
+/* "pywrapfst.pxd":525
* weight=?)
*
* cpdef MutableFst epsnormalize(Fst ifst, bool eps_norm_output=?) # <<<<<<<<<<<<<<
bool eps_norm_output;
};
-/* "pywrapfst.pxd":535
+/* "pywrapfst.pxd":527
* cpdef MutableFst epsnormalize(Fst ifst, bool eps_norm_output=?)
*
* cpdef bool equal(Fst ifst1, Fst ifst2, float delta=?) # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":537
+/* "pywrapfst.pxd":529
* cpdef bool equal(Fst ifst1, Fst ifst2, float delta=?)
*
* cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=?) except * # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":539
+/* "pywrapfst.pxd":531
* cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=?) except *
*
* cpdef MutableFst intersect(Fst ifst1, # <<<<<<<<<<<<<<
bool connect;
};
-/* "pywrapfst.pxd":544
+/* "pywrapfst.pxd":536
* bool connect=?)
*
* cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=?) # <<<<<<<<<<<<<<
float delta;
};
-/* "pywrapfst.pxd":546
+/* "pywrapfst.pxd":538
* cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=?)
*
* cpdef MutableFst prune(Fst ifst, # <<<<<<<<<<<<<<
PyObject *weight;
};
-/* "pywrapfst.pxd":551
+/* "pywrapfst.pxd":543
* weight=?)
*
* cpdef MutableFst push(Fst ifst, # <<<<<<<<<<<<<<
bool to_final;
};
-/* "pywrapfst.pxd":559
+/* "pywrapfst.pxd":551
* bool to_final=?)
*
* cpdef bool randequivalent(Fst ifst1, # <<<<<<<<<<<<<<
int __pyx_n;
int32 npath;
float delta;
- time_t seed;
PyObject *select;
int32 max_length;
+ uint64 seed;
};
-/* "pywrapfst.pxd":567
- * int32 max_length=?) except *
+/* "pywrapfst.pxd":559
+ * uint64 seed=?) except *
*
* cpdef MutableFst randgen(Fst ifst, # <<<<<<<<<<<<<<
* int32 npath=?,
- * time_t seed=?,
+ * select=?,
*/
struct __pyx_opt_args_9pywrapfst_randgen {
int __pyx_n;
int32 npath;
- time_t seed;
PyObject *select;
int32 max_length;
bool remove_total_weight;
bool weighted;
+ uint64 seed;
};
-/* "pywrapfst.pxd":575
- * bool weighted=?)
+/* "pywrapfst.pxd":567
+ * uint64 seed=?)
*
* cpdef MutableFst replace(pairs, # <<<<<<<<<<<<<<
* call_arc_labeling=?,
int64 return_label;
};
-/* "pywrapfst.pxd":581
+/* "pywrapfst.pxd":573
* int64 return_label=?)
*
* cpdef MutableFst reverse(Fst ifst, bool require_superinitial=?) # <<<<<<<<<<<<<<
*
- * cdef vector[fst.WeightClass] *_shortestdistance(Fst ifst,
+ * cdef void _shortestdistance(Fst ifst,
*/
struct __pyx_opt_args_9pywrapfst_reverse {
int __pyx_n;
bool require_superinitial;
};
-/* "pywrapfst.pxd":583
+/* "pywrapfst.pxd":575
* cpdef MutableFst reverse(Fst ifst, bool require_superinitial=?)
*
- * cdef vector[fst.WeightClass] *_shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
- * float delta=?,
- * int64 nstate=?,
+ * cdef void _shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
+ * vector[fst.WeightClass] *,
+ * float delta=?,
*/
struct __pyx_opt_args_9pywrapfst__shortestdistance {
int __pyx_n;
bool reverse;
};
-/* "pywrapfst.pxd":589
- * bool reverse=?) except *
+/* "pywrapfst.pxd":582
+ * bool reverse=?) except *
*
* cpdef MutableFst shortestpath(Fst ifst, # <<<<<<<<<<<<<<
* float delta=?,
/* "pywrapfst.pxd":107
*
*
- * cdef class _SymbolTable(object): # <<<<<<<<<<<<<<
+ * cdef class SymbolTableView(object): # <<<<<<<<<<<<<<
*
* cdef const fst.SymbolTable *_raw(self)
*/
-struct __pyx_obj_9pywrapfst__SymbolTable {
+struct __pyx_obj_9pywrapfst_SymbolTableView {
PyObject_HEAD
- struct __pyx_vtabstruct_9pywrapfst__SymbolTable *__pyx_vtab;
+ struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *__pyx_vtab;
};
/* "pywrapfst.pxd":138
*
*
- * cdef class _EncodeMapperSymbolTableView(_SymbolTable): # <<<<<<<<<<<<<<
+ * cdef class _EncodeMapperSymbolTableView(SymbolTableView): # <<<<<<<<<<<<<<
*
* # Indicates whether this view is of an input or output SymbolTable
*/
struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView {
- struct __pyx_obj_9pywrapfst__SymbolTable __pyx_base;
+ struct __pyx_obj_9pywrapfst_SymbolTableView __pyx_base;
bool _input_side;
std::shared_ptr<fst::script::EncodeMapperClass> _mapper;
};
/* "pywrapfst.pxd":146
*
*
- * cdef class _FstSymbolTableView(_SymbolTable): # <<<<<<<<<<<<<<
+ * cdef class _FstSymbolTableView(SymbolTableView): # <<<<<<<<<<<<<<
*
* # Indicates whether this view is of an input or output SymbolTable
*/
struct __pyx_obj_9pywrapfst__FstSymbolTableView {
- struct __pyx_obj_9pywrapfst__SymbolTable __pyx_base;
+ struct __pyx_obj_9pywrapfst_SymbolTableView __pyx_base;
bool _input_side;
std::shared_ptr<fst::script::FstClass> _fst;
};
/* "pywrapfst.pxd":154
*
*
- * cdef class _MutableSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
+ * cdef class _MutableSymbolTable(SymbolTableView): # <<<<<<<<<<<<<<
*
* cdef fst.SymbolTable *_mutable_raw(self)
*/
struct __pyx_obj_9pywrapfst__MutableSymbolTable {
- struct __pyx_obj_9pywrapfst__SymbolTable __pyx_base;
+ struct __pyx_obj_9pywrapfst_SymbolTableView __pyx_base;
};
*
* cdef class _SymbolTableIterator(object): # <<<<<<<<<<<<<<
*
- * cdef _SymbolTable _table
+ * cdef SymbolTableView _table
*/
struct __pyx_obj_9pywrapfst__SymbolTableIterator {
PyObject_HEAD
- struct __pyx_obj_9pywrapfst__SymbolTable *_table;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *_table;
std::unique_ptr<fst::SymbolTable::iterator> _siter;
};
};
-/* "pywrapfst.pxd":325
+/* "pywrapfst.pxd":317
*
*
* cdef class MutableFst(Fst): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":408
+/* "pywrapfst.pxd":400
*
*
* cdef class VectorFst(MutableFst): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":430
+/* "pywrapfst.pxd":422
*
*
* cdef class Arc(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":440
+/* "pywrapfst.pxd":432
*
*
* cdef class ArcIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":462
+/* "pywrapfst.pxd":454
*
*
* cdef class MutableArcIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":486
+/* "pywrapfst.pxd":478
*
*
* cdef class StateIterator(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":605
+/* "pywrapfst.pxd":598
*
*
* cdef class Compiler(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":626
+/* "pywrapfst.pxd":619
* # FarReader.
*
* cdef class FarReader(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pxd":651
+/* "pywrapfst.pxd":644
* # FarWriter.
*
* cdef class FarWriter(object): # <<<<<<<<<<<<<<
};
-/* "pywrapfst.pyx":3237
+/* "pywrapfst.pyx":3266
*
* # Magic method used to get a Pythonic Iterator API out of the C++ API.
* def __iter__(self): # <<<<<<<<<<<<<<
-/* "pywrapfst.pyx":339
+/* "pywrapfst.pyx":403
*
*
* cdef class Weight: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Weight *__pyx_vtabptr_9pywrapfst_Weight;
-/* "pywrapfst.pyx":669
+/* "pywrapfst.pyx":730
*
*
- * cdef class _SymbolTable: # <<<<<<<<<<<<<<
+ * cdef class SymbolTableView: # <<<<<<<<<<<<<<
*
* """
*/
-struct __pyx_vtabstruct_9pywrapfst__SymbolTable {
- fst::SymbolTable const *(*_raw)(struct __pyx_obj_9pywrapfst__SymbolTable *);
- void (*_raise_nonexistent)(struct __pyx_obj_9pywrapfst__SymbolTable *);
- fst::SymbolTable const *(*_raw_ptr_or_raise)(struct __pyx_obj_9pywrapfst__SymbolTable *);
- int64 (*available_key)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
- PyObject *(*checksum)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
- struct __pyx_obj_9pywrapfst_SymbolTable *(*copy)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
- int64 (*get_nth_key)(struct __pyx_obj_9pywrapfst__SymbolTable *, Py_ssize_t, int __pyx_skip_dispatch);
- PyObject *(*labeled_checksum)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
- bool (*member)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch);
- std::string (*name)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
- size_t (*num_symbols)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
- void (*write)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch);
- void (*write_text)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch);
- PyObject *(*write_to_string)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
+struct __pyx_vtabstruct_9pywrapfst_SymbolTableView {
+ fst::SymbolTable const *(*_raw)(struct __pyx_obj_9pywrapfst_SymbolTableView *);
+ void (*_raise_nonexistent)(struct __pyx_obj_9pywrapfst_SymbolTableView *);
+ fst::SymbolTable const *(*_raw_ptr_or_raise)(struct __pyx_obj_9pywrapfst_SymbolTableView *);
+ int64 (*available_key)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
+ PyObject *(*checksum)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
+ struct __pyx_obj_9pywrapfst_SymbolTable *(*copy)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
+ int64 (*get_nth_key)(struct __pyx_obj_9pywrapfst_SymbolTableView *, Py_ssize_t, int __pyx_skip_dispatch);
+ PyObject *(*labeled_checksum)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
+ bool (*member)(struct __pyx_obj_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch);
+ std::string (*name)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
+ size_t (*num_symbols)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
+ void (*write)(struct __pyx_obj_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch);
+ void (*write_text)(struct __pyx_obj_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch);
+ PyObject *(*write_to_string)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
};
-static struct __pyx_vtabstruct_9pywrapfst__SymbolTable *__pyx_vtabptr_9pywrapfst__SymbolTable;
+static struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *__pyx_vtabptr_9pywrapfst_SymbolTableView;
-/* "pywrapfst.pyx":876
+/* "pywrapfst.pyx":933
*
*
- * cdef class _EncodeMapperSymbolTableView(_SymbolTable): # <<<<<<<<<<<<<<
+ * cdef class _EncodeMapperSymbolTableView(SymbolTableView): # <<<<<<<<<<<<<<
*
* """
*/
struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTableView {
- struct __pyx_vtabstruct_9pywrapfst__SymbolTable __pyx_base;
+ struct __pyx_vtabstruct_9pywrapfst_SymbolTableView __pyx_base;
};
static struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTableView *__pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTableView;
-/* "pywrapfst.pyx":900
+/* "pywrapfst.pyx":957
*
*
- * cdef class _FstSymbolTableView(_SymbolTable): # <<<<<<<<<<<<<<
+ * cdef class _FstSymbolTableView(SymbolTableView): # <<<<<<<<<<<<<<
*
* """
*/
struct __pyx_vtabstruct_9pywrapfst__FstSymbolTableView {
- struct __pyx_vtabstruct_9pywrapfst__SymbolTable __pyx_base;
+ struct __pyx_vtabstruct_9pywrapfst_SymbolTableView __pyx_base;
};
static struct __pyx_vtabstruct_9pywrapfst__FstSymbolTableView *__pyx_vtabptr_9pywrapfst__FstSymbolTableView;
-/* "pywrapfst.pyx":923
+/* "pywrapfst.pyx":980
*
*
- * cdef class _MutableSymbolTable(_SymbolTable): # <<<<<<<<<<<<<<
+ * cdef class _MutableSymbolTable(SymbolTableView): # <<<<<<<<<<<<<<
*
* """
*/
struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable {
- struct __pyx_vtabstruct_9pywrapfst__SymbolTable __pyx_base;
+ struct __pyx_vtabstruct_9pywrapfst_SymbolTableView __pyx_base;
fst::SymbolTable *(*_mutable_raw)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *);
fst::SymbolTable *(*_mutable_raw_ptr_or_raise)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *);
int64 (*add_symbol)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args);
- void (*add_table)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
+ void (*add_table)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
void (*set_name)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
-/* "pywrapfst.pyx":994
+/* "pywrapfst.pyx":1052
*
*
* cdef class _MutableFstSymbolTableView(_MutableSymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTableView *__pyx_vtabptr_9pywrapfst__MutableFstSymbolTableView;
-/* "pywrapfst.pyx":1009
+/* "pywrapfst.pyx":1067
*
*
* cdef class SymbolTable(_MutableSymbolTable): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_SymbolTable *__pyx_vtabptr_9pywrapfst_SymbolTable;
-/* "pywrapfst.pyx":1235
+/* "pywrapfst.pyx":1295
*
*
* cdef class EncodeMapper: # <<<<<<<<<<<<<<
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);
struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *(*output_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
- void (*_set_input_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst__SymbolTable *);
- void (*_set_output_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst__SymbolTable *);
+ void (*_set_input_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst_SymbolTableView *);
+ void (*_set_output_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst_SymbolTableView *);
};
static struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *__pyx_vtabptr_9pywrapfst_EncodeMapper;
-/* "pywrapfst.pyx":1501
+/* "pywrapfst.pyx":1561
*
*
* cdef class Fst: # <<<<<<<<<<<<<<
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);
- std::string (*text)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_text *__pyx_optional_args);
bool (*verify)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch);
std::string (*weight_type)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch);
void (*write)(struct __pyx_obj_9pywrapfst_Fst *, PyObject *, int __pyx_skip_dispatch);
static struct __pyx_vtabstruct_9pywrapfst_Fst *__pyx_vtabptr_9pywrapfst_Fst;
-/* "pywrapfst.pyx":1993
+/* "pywrapfst.pyx":2026
*
*
* cdef class MutableFst(Fst): # <<<<<<<<<<<<<<
void (*_minimize)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__minimize *__pyx_optional_args);
struct __pyx_obj_9pywrapfst_MutableArcIterator *(*mutable_arcs)(struct __pyx_obj_9pywrapfst_MutableFst *, int64, int __pyx_skip_dispatch);
int64 (*num_states)(struct __pyx_obj_9pywrapfst_MutableFst *, int __pyx_skip_dispatch);
- void (*_project)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__project *__pyx_optional_args);
+ void (*_project)(struct __pyx_obj_9pywrapfst_MutableFst *, PyObject *);
void (*_prune)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__prune *__pyx_optional_args);
void (*_push)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__push *__pyx_optional_args);
void (*_relabel_pairs)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_pairs *__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__SymbolTable *);
- void (*_set_output_symbols)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst__SymbolTable *);
+ 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 *);
void (*_topsort)(struct __pyx_obj_9pywrapfst_MutableFst *);
};
static struct __pyx_vtabstruct_9pywrapfst_MutableFst *__pyx_vtabptr_9pywrapfst_MutableFst;
-/* "pywrapfst.pyx":2863
+/* "pywrapfst.pyx":2891
*
*
* cdef class VectorFst(MutableFst): # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_VectorFst *__pyx_vtabptr_9pywrapfst_VectorFst;
-/* "pywrapfst.pyx":3039
+/* "pywrapfst.pyx":3068
*
*
* cdef class Arc: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Arc *__pyx_vtabptr_9pywrapfst_Arc;
-/* "pywrapfst.pyx":3106
+/* "pywrapfst.pyx":3135
*
*
* cdef class ArcIterator: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_ArcIterator *__pyx_vtabptr_9pywrapfst_ArcIterator;
-/* "pywrapfst.pyx":3217
+/* "pywrapfst.pyx":3246
*
*
* cdef class MutableArcIterator: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *__pyx_vtabptr_9pywrapfst_MutableArcIterator;
-/* "pywrapfst.pyx":3337
+/* "pywrapfst.pyx":3366
*
*
* cdef class StateIterator: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_StateIterator *__pyx_vtabptr_9pywrapfst_StateIterator;
-/* "pywrapfst.pyx":4242
+/* "pywrapfst.pyx":4275
*
*
* cdef class Compiler: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_Compiler *__pyx_vtabptr_9pywrapfst_Compiler;
-/* "pywrapfst.pyx":4379
+/* "pywrapfst.pyx":4412
*
*
* cdef class FarReader: # <<<<<<<<<<<<<<
static struct __pyx_vtabstruct_9pywrapfst_FarReader *__pyx_vtabptr_9pywrapfst_FarReader;
-/* "pywrapfst.pyx":4525
+/* "pywrapfst.pyx":4567
*
*
* cdef class FarWriter: # <<<<<<<<<<<<<<
/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+/* PyObjectFormatSimple.proto */
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyObject_FormatSimple(s, f) (\
+ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
+ PyObject_Format(s, f))
+#elif PY_MAJOR_VERSION < 3
+ #define __Pyx_PyObject_FormatSimple(s, f) (\
+ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
+ likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
+ PyObject_Format(s, f))
+#elif CYTHON_USE_TYPE_SLOTS
+ #define __Pyx_PyObject_FormatSimple(s, f) (\
+ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
+ likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_str(s) :\
+ likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_str(s) :\
+ PyObject_Format(s, f))
+#else
+ #define __Pyx_PyObject_FormatSimple(s, f) (\
+ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
+ PyObject_Format(s, f))
+#endif
+
+/* PyObjectFormatAndDecref.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
+static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
+
+/* IncludeStringH.proto */
+#include <string.h>
+
+/* JoinPyUnicode.proto */
+static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
+ Py_UCS4 max_char);
+
/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
-/* PyObjectCall2Args.proto */
-static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
-
/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred() PyErr_Occurred()
+#endif
+
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
+#else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
+#else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* RaiseException.proto */
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif
-/* PyThreadStateGet.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
-#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
-#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
-#else
-#define __Pyx_PyThreadState_declare
-#define __Pyx_PyThreadState_assign
-#define __Pyx_PyErr_Occurred() PyErr_Occurred()
-#endif
+/* PyObjectCall2Args.proto */
+static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
-/* PyErrFetchRestore.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
-#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
-#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
-#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
-#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
-static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
-#else
-#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
-#endif
+/* PyObjectFormat.proto */
+#if CYTHON_USE_UNICODE_WRITER
+static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
#else
-#define __Pyx_PyErr_Clear() PyErr_Clear()
-#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
-#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
-#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
-#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
-#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
-#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
-#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
#endif
-/* RaiseException.proto */
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
-
/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
#endif
-/* FastTypeChecks.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
-static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
-static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
-static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
-#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
-#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
-#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
#endif
-#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list, int wraparound, int boundscheck);
-/* PyErrExceptionMatches.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
-static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
-#else
-#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
-#endif
-
/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
if (likely(L->allocated > len)) {
Py_INCREF(x);
PyList_SET_ITEM(list, len, x);
- Py_SIZE(list) = len+1;
+ __Pyx_SET_SIZE(list, len + 1);
return 0;
}
return PyList_Append(list, x);
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif
-/* IncludeStringH.proto */
-#include <string.h>
-
/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+/* PyObjectGetAttrStrNoError.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
+
/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);
static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *);
/* CIntFromPy.proto */
-static CYTHON_INLINE time_t __Pyx_PyInt_As_time_t(PyObject *);
-
-/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
+
/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
static std::string __pyx_f_9pywrapfst_6Weight_to_string(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_6Weight_type(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_6Weight_member(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
-static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_12_SymbolTable__raw(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto*/
-static void __pyx_f_9pywrapfst_12_SymbolTable__raise_nonexistent(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto*/
-static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_12_SymbolTable__raw_ptr_or_raise(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto*/
-static int64 __pyx_f_9pywrapfst_12_SymbolTable_available_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
-static PyObject *__pyx_f_9pywrapfst_12_SymbolTable_checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
-static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_12_SymbolTable_copy(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
-static int64 __pyx_f_9pywrapfst_12_SymbolTable_get_nth_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, Py_ssize_t __pyx_v_pos, int __pyx_skip_dispatch); /* proto*/
-static PyObject *__pyx_f_9pywrapfst_12_SymbolTable_labeled_checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
-static bool __pyx_f_9pywrapfst_12_SymbolTable_member(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
-static std::string __pyx_f_9pywrapfst_12_SymbolTable_name(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
-static size_t __pyx_f_9pywrapfst_12_SymbolTable_num_symbols(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
-static void __pyx_f_9pywrapfst_12_SymbolTable_write(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
-static void __pyx_f_9pywrapfst_12_SymbolTable_write_text(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
-static PyObject *__pyx_f_9pywrapfst_12_SymbolTable_write_to_string(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
+static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_15SymbolTableView__raw(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto*/
+static void __pyx_f_9pywrapfst_15SymbolTableView__raise_nonexistent(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto*/
+static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_15SymbolTableView__raw_ptr_or_raise(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto*/
+static int64 __pyx_f_9pywrapfst_15SymbolTableView_available_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
+static PyObject *__pyx_f_9pywrapfst_15SymbolTableView_checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
+static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_15SymbolTableView_copy(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
+static int64 __pyx_f_9pywrapfst_15SymbolTableView_get_nth_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, Py_ssize_t __pyx_v_pos, int __pyx_skip_dispatch); /* proto*/
+static PyObject *__pyx_f_9pywrapfst_15SymbolTableView_labeled_checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
+static bool __pyx_f_9pywrapfst_15SymbolTableView_member(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
+static std::string __pyx_f_9pywrapfst_15SymbolTableView_name(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
+static size_t __pyx_f_9pywrapfst_15SymbolTableView_num_symbols(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
+static void __pyx_f_9pywrapfst_15SymbolTableView_write(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
+static void __pyx_f_9pywrapfst_15SymbolTableView_write_text(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
+static PyObject *__pyx_f_9pywrapfst_15SymbolTableView_write_to_string(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_28_EncodeMapperSymbolTableView__raw(struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v_self); /* proto*/
static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_19_FstSymbolTableView__raw(struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_v_self); /* proto*/
static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_19_MutableSymbolTable__raw(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self); /* proto*/
static __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_19_MutableSymbolTable__mutable_raw(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self); /* proto*/
static __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_19_MutableSymbolTable__mutable_raw_ptr_or_raise(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self); /* proto*/
static int64 __pyx_f_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args); /* proto*/
-static void __pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms, int __pyx_skip_dispatch); /* proto*/
+static void __pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_19_MutableSymbolTable_set_name(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_new_name, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_26_MutableFstSymbolTableView__mutable_raw(struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_v_self); /* proto*/
static __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_11SymbolTable__mutable_raw(struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self); /* 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 struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_9pywrapfst_12EncodeMapper_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
-static void __pyx_f_9pywrapfst_12EncodeMapper__set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto*/
-static void __pyx_f_9pywrapfst_12EncodeMapper__set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto*/
+static void __pyx_f_9pywrapfst_12EncodeMapper__set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto*/
+static void __pyx_f_9pywrapfst_12EncodeMapper__set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto*/
static std::string __pyx_f_9pywrapfst_3Fst__local_render_svg(std::string const &__pyx_v_dot); /* proto*/
static std::string __pyx_f_9pywrapfst_3Fst_arc_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_f_9pywrapfst_3Fst_arcs(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch); /* 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 std::string __pyx_f_9pywrapfst_3Fst_text(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_text *__pyx_optional_args); /* proto*/
static bool __pyx_f_9pywrapfst_3Fst_verify(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_3Fst_weight_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_3Fst_write(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
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); /* proto*/
static struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_f_9pywrapfst_10MutableFst_mutable_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static int64 __pyx_f_9pywrapfst_10MutableFst_num_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
-static void __pyx_f_9pywrapfst_10MutableFst__project(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__project *__pyx_optional_args); /* proto*/
+static void __pyx_f_9pywrapfst_10MutableFst__project(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_project_type); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__prune(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__prune *__pyx_optional_args); /* proto*/
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); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__relabel_pairs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_pairs *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__reweight(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, struct __pyx_opt_args_9pywrapfst_10MutableFst__reweight *__pyx_optional_args); /* proto*/
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); /* 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__SymbolTable *__pyx_v_syms); /* proto*/
-static void __pyx_f_9pywrapfst_10MutableFst__set_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* 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 bool __pyx_f_9pywrapfst_9FarWriter_error(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_9FarWriter_far_type(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
-/* Module declarations from 'libc.stddef' */
-
-/* Module declarations from 'libc.time' */
-
/* Module declarations from 'libcpp' */
/* Module declarations from 'libcpp.memory' */
/* Module declarations from 'libc.stdint' */
-/* Module declarations from 'basictypes' */
+/* Module declarations from 'cintegral_types' */
-/* Module declarations from 'ios' */
+/* Module declarations from 'cios' */
/* Module declarations from 'cpywrapfst' */
-/* Module declarations from 'posix.types' */
+/* Module declarations from 'libc.stddef' */
-/* Module declarations from 'posix.unistd' */
+/* Module declarations from 'libc.time' */
/* Module declarations from 'libcpp.cast' */
-/* Module declarations from 'memory' */
+/* Module declarations from 'cmemory' */
-/* Module declarations from 'utility' */
+/* Module declarations from 'cutility' */
/* Module declarations from 'pywrapfst' */
static PyTypeObject *__pyx_ptype_9pywrapfst_Weight = 0;
-static PyTypeObject *__pyx_ptype_9pywrapfst__SymbolTable = 0;
+static PyTypeObject *__pyx_ptype_9pywrapfst_SymbolTableView = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst__FstSymbolTableView = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst__MutableSymbolTable = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst___pyx_scope_struct____iter__ = 0;
static std::string __pyx_f_9pywrapfst_tostring(PyObject *); /*proto*/
static std::string __pyx_f_9pywrapfst_weight_tostring(PyObject *); /*proto*/
+static std::string __pyx_f_9pywrapfst_path_tostring(PyObject *); /*proto*/
static enum fst::ComposeFilter __pyx_f_9pywrapfst__get_compose_filter(std::string const &); /*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 struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_f_9pywrapfst__init_FstSymbolTableView(std::shared_ptr<fst::script::FstClass> , bool); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_f_9pywrapfst__init_MutableFstSymbolTableView(std::shared_ptr<fst::script::MutableFstClass> , bool); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__init_SymbolTable(std::unique_ptr<fst::SymbolTable> ); /*proto*/
-static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__read_SymbolTable_from_string(PyObject *, int __pyx_skip_dispatch); /*proto*/
+static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__read_SymbolTable_from_string(std::string, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_f_9pywrapfst__init_EncodeMapper(__pyx_t_9pywrapfst_EncodeMapperClass_ptr); /*proto*/
-static struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_f_9pywrapfst__read_EncodeMapper_from_string(PyObject *, int __pyx_skip_dispatch); /*proto*/
+static struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_f_9pywrapfst__read_EncodeMapper_from_string(std::string, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__init_Fst(__pyx_t_9pywrapfst_FstClass_ptr); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst__init_MutableFst(__pyx_t_9pywrapfst_MutableFstClass_ptr); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__init_XFst(__pyx_t_9pywrapfst_FstClass_ptr); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *, int __pyx_skip_dispatch); /*proto*/
-static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__read_Fst_from_string(PyObject *, int __pyx_skip_dispatch); /*proto*/
+static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__read_Fst_from_string(std::string, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst__init_Arc(fst::script::ArcClass const &); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__map(struct __pyx_obj_9pywrapfst_Fst *, struct __pyx_opt_args_9pywrapfst__map *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst_arcmap(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_arcmap *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_randgen(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_randgen *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_replace(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_replace *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_reverse(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_reverse *__pyx_optional_args); /*proto*/
-static std::vector<fst::script::WeightClass> *__pyx_f_9pywrapfst__shortestdistance(struct __pyx_obj_9pywrapfst_Fst *, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args); /*proto*/
+static void __pyx_f_9pywrapfst__shortestdistance(struct __pyx_obj_9pywrapfst_Fst *, std::vector<fst::script::WeightClass> *, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_shortestpath(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_shortestpath *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst_statemap(struct __pyx_obj_9pywrapfst_Fst *, PyObject *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_synchronize(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch); /*proto*/
-static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_compact_symbol_table(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch); /*proto*/
-static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_merge_symbol_table(struct __pyx_obj_9pywrapfst__SymbolTable *, struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch); /*proto*/
+static fst::FarType __pyx_f_9pywrapfst__get_far_type(std::string const &); /*proto*/
+static fst::ProjectType __pyx_f_9pywrapfst__get_project_type(std::string const &); /*proto*/
+static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_compact_symbol_table(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch); /*proto*/
+static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_merge_symbol_table(struct __pyx_obj_9pywrapfst_SymbolTableView *, struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch); /*proto*/
static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
static std::vector<int64> __pyx_convert_vector_from_py_int64(PyObject *); /*proto*/
+static std::vector<std::string> __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "pywrapfst"
extern int __pyx_module_is_main_pywrapfst;
int __pyx_module_is_main_pywrapfst = 0;
/* Implementation of 'pywrapfst' */
-static PyObject *__pyx_builtin_DeprecationWarning;
static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_IOError;
+static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_staticmethod;
-static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_builtin_id;
+static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_KeyError;
+static const char __pyx_k_[] = ": ";
static const char __pyx_k_g[] = "g";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_w[] = "w";
-static const char __pyx_k__8[] = "";
+static const char __pyx_k_x[] = "x";
+static const char __pyx_k__2[] = "<";
+static const char __pyx_k__3[] = ">";
static const char __pyx_k_id[] = "id";
+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_doc[] = "__doc__";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_lhs[] = "lhs";
static const char __pyx_k_rhs[] = "rhs";
+static const char __pyx_k_sys[] = "sys";
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_seed[] = "seed";
static const char __pyx_k_seek[] = "seek";
static const char __pyx_k_send[] = "send";
-static const char __pyx_k_syms[] = "syms";
static const char __pyx_k_test[] = "test";
-static const char __pyx_k_text[] = "text";
static const char __pyx_k_type[] = "type";
-static const char __pyx_k_utf8[] = "utf8";
-static const char __pyx_k_warn[] = "warn";
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_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_delta[] = "delta";
static const char __pyx_k_CYCLIC[] = "CYCLIC";
static const char __pyx_k_Number[] = "Number";
static const char __pyx_k_STRING[] = "STRING";
-static const char __pyx_k_Weight[] = "Weight";
-static const char __pyx_k_always[] = "always";
+static const char __pyx_k_Weight[] = " Weight ";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_divide[] = "divide";
-static const char __pyx_k_encode[] = "encode";
-static const char __pyx_k_format[] = "format";
+static const char __pyx_k_failed[] = " failed";
+static const char __pyx_k_fspath[] = "fspath";
static const char __pyx_k_height[] = "height";
static const char __pyx_k_ilabel[] = "ilabel";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_olabel[] = "olabel";
static const char __pyx_k_opairs[] = "opairs";
static const char __pyx_k_reduce[] = "__reduce__";
-static const char __pyx_k_result[] = "result";
static const char __pyx_k_select[] = "select";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_states[] = "states";
static const char __pyx_k_stdout[] = "stdout";
static const char __pyx_k_symbol[] = "symbol";
static const char __pyx_k_test_2[] = "__test__";
+static const char __pyx_k_typing[] = "typing";
static const char __pyx_k_unique[] = "unique";
static const char __pyx_k_vector[] = "vector";
static const char __pyx_k_verify[] = "verify";
static const char __pyx_k_weight[] = "weight";
static const char __pyx_k_ACYCLIC[] = "ACYCLIC";
+static const char __pyx_k_FarType[] = "FarType";
static const char __pyx_k_IOError[] = "IOError";
static const char __pyx_k_MUTABLE[] = "MUTABLE";
+static const char __pyx_k_class_2[] = "_class__";
static const char __pyx_k_compile[] = "compile";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_default[] = "default";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_ranksep[] = "ranksep";
static const char __pyx_k_reverse[] = "reverse";
+static const char __pyx_k_symbols[] = "symbols";
static const char __pyx_k_uniform[] = "uniform";
static const char __pyx_k_warning[] = "warning";
static const char __pyx_k_ACCEPTOR[] = "ACCEPTOR";
static const char __pyx_k_Compiler[] = "Compiler";
static const char __pyx_k_EPSILONS[] = "EPSILONS";
static const char __pyx_k_EXPANDED[] = "EXPANDED";
+static const char __pyx_k_Expected[] = "Expected ";
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_acceptor[] = "acceptor";
static const char __pyx_k_arc_type[] = "arc_type";
static const char __pyx_k_checksum[] = "checksum";
static const char __pyx_k_det_type[] = "det_type";
-static const char __pyx_k_distance[] = "distance";
+static const char __pyx_k_distance[] = "_distance";
static const char __pyx_k_far_type[] = "far_type";
static const char __pyx_k_fontsize[] = "fontsize";
static const char __pyx_k_fst_type[] = "fst_type";
static const char __pyx_k_to_final[] = "to_final";
static const char __pyx_k_tropical[] = "tropical";
static const char __pyx_k_vertical[] = "vertical";
-static const char __pyx_k_warnings[] = "warnings";
+static const char __pyx_k_weight_2[] = "_weight";
static const char __pyx_k_weighted[] = "weighted";
static const char __pyx_k_ARC_FLAGS[] = "ARC_FLAGS";
+static const char __pyx_k_Arc_at_0x[] = "<Arc at 0x";
static const char __pyx_k_FarReader[] = "FarReader";
static const char __pyx_k_FarWriter[] = "FarWriter";
+static const char __pyx_k_Fst_at_0x[] = " Fst at 0x";
static const char __pyx_k_NO_SYMBOL[] = "NO_SYMBOL";
+static const char __pyx_k_QueueType[] = "QueueType";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_VectorFst[] = "VectorFst";
static const char __pyx_k_add_state[] = "add_state";
static const char __pyx_k_sort_type[] = "sort_type";
static const char __pyx_k_to_string[] = "to_string";
static const char __pyx_k_ACCESSIBLE[] = "ACCESSIBLE";
+static const char __pyx_k_ArcMapType[] = "ArcMapType";
static const char __pyx_k_FstIOError[] = "FstIOError";
static const char __pyx_k_FstOpError[] = "FstOpError";
static const char __pyx_k_I_EPSILONS[] = "I_EPSILONS";
static const char __pyx_k_TOP_SORTED[] = "TOP_SORTED";
static const char __pyx_k_UNWEIGHTED[] = "UNWEIGHTED";
static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_WeightLike[] = "WeightLike";
static const char __pyx_k_add_states[] = "add_states";
static const char __pyx_k_add_symbol[] = "add_symbol";
static const char __pyx_k_functional[] = "functional";
static const char __pyx_k_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_stacklevel[] = "stacklevel";
static const char __pyx_k_subprocess[] = "subprocess";
static const char __pyx_k_write_text[] = "write_text";
static const char __pyx_k_ArcIterator[] = "ArcIterator";
-static const char __pyx_k_Arc_at_0x_x[] = "<Arc at 0x{:x}>";
static const char __pyx_k_FstArgError[] = "FstArgError";
-static const char __pyx_k_Fst_at_0x_x[] = "<{} Fst at 0x{:x}>";
static const char __pyx_k_NO_EPSILONS[] = "NO_EPSILONS";
static const char __pyx_k_NO_STATE_ID[] = "NO_STATE_ID";
-static const char __pyx_k_Read_failed[] = "Read failed";
-static const char __pyx_k_SymbolTable[] = "_SymbolTable";
+static const char __pyx_k_Open_failed[] = "Open failed: ";
+static const char __pyx_k_ProjectType[] = "ProjectType";
+static const char __pyx_k_Read_failed[] = "Read failed: ";
+static const char __pyx_k_SymbolTable[] = "<SymbolTable ";
static const char __pyx_k_communicate[] = "communicate";
static const char __pyx_k_get_nth_key[] = "get_nth_key";
static const char __pyx_k_input_table[] = "input_table";
static const char __pyx_k_EncodeMapper[] = "EncodeMapper";
static const char __pyx_k_NOT_ACCEPTOR[] = "NOT_ACCEPTOR";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
+static const char __pyx_k_StateMapType[] = "StateMapType";
+static const char __pyx_k_Write_failed[] = "Write failed: ";
static const char __pyx_k_allow_nondet[] = "allow_nondet";
+static const char __pyx_k_but_received[] = " but received ";
static const char __pyx_k_closure_plus[] = "closure_plus";
static const char __pyx_k_float_format[] = "float_format";
static const char __pyx_k_mutable_arcs[] = "mutable_arcs";
static const char __pyx_k_old_osymbols[] = "old_osymbols";
static const char __pyx_k_push_weights[] = "push_weights";
static const char __pyx_k_return_label[] = "return_label";
-static const char __pyx_k_simplefilter[] = "simplefilter";
static const char __pyx_k_staticmethod[] = "staticmethod";
+static const char __pyx_k_ComposeFilter[] = "ComposeFilter";
+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_NO_I_EPSILONS[] = "NO_I_EPSILONS";
static const char __pyx_k_NO_O_EPSILONS[] = "NO_O_EPSILONS";
-static const char __pyx_k_Open_failed_r[] = "Open failed: {!r}";
-static const char __pyx_k_Read_failed_r[] = "Read failed: {!r}";
static const char __pyx_k_StateIterator[] = "StateIterator";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_SymbolTable_2[] = "SymbolTable";
static const char __pyx_k_input_symbols[] = "input_symbols";
static const char __pyx_k_keep_isymbols[] = "keep_isymbols";
static const char __pyx_k_keep_osymbols[] = "keep_osymbols";
+static const char __pyx_k_pywrapfst_pyx[] = "pywrapfst.pyx";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_ENCODE_WEIGHTS[] = "ENCODE_WEIGHTS";
static const char __pyx_k_FST_PROPERTIES[] = "FST_PROPERTIES";
static const char __pyx_k_NOT_ACCESSIBLE[] = "NOT_ACCESSIBLE";
static const char __pyx_k_NOT_TOP_SORTED[] = "NOT_TOP_SORTED";
static const char __pyx_k_O_LABEL_SORTED[] = "O_LABEL_SORTED";
-static const char __pyx_k_Weight_at_0x_x[] = "<{} Weight {} at 0x{:x}>";
-static const char __pyx_k_Write_failed_r[] = "Write failed: {!r}";
static const char __pyx_k_compose_filter[] = "compose_filter";
static const char __pyx_k_encode_weights[] = "encode_weights";
static const char __pyx_k_output_symbols[] = "output_symbols";
-static const char __pyx_k_project_output[] = "project_output";
static const char __pyx_k_ARC_VALUE_FLAGS[] = "ARC_VALUE_FLAGS";
static const char __pyx_k_COPY_PROPERTIES[] = "COPY_PROPERTIES";
+static const char __pyx_k_DeterminizeType[] = "DeterminizeType";
+static const char __pyx_k_DrawFloatFormat[] = "DrawFloatFormat";
+static const char __pyx_k_FarReader_at_0x[] = " FarReader at 0x";
+static const char __pyx_k_FarWriter_at_0x[] = " FarWriter at 0x";
static const char __pyx_k_INITIAL_ACYCLIC[] = "INITIAL_ACYCLIC";
static const char __pyx_k_I_DETERMINISTIC[] = "I_DETERMINISTIC";
static const char __pyx_k_NULL_PROPERTIES[] = "NULL_PROPERTIES";
static const char __pyx_k_O_DETERMINISTIC[] = "O_DETERMINISTIC";
+static const char __pyx_k_SymbolTableView[] = "SymbolTableView";
static const char __pyx_k_WEIGHTED_CYCLES[] = "WEIGHTED_CYCLES";
static const char __pyx_k_eps_norm_output[] = "eps_norm_output";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_unknown_osymbol[] = "unknown_osymbol";
static const char __pyx_k_write_to_string[] = "write_to_string";
static const char __pyx_k_ARC_WEIGHT_VALUE[] = "ARC_WEIGHT_VALUE";
-static const char __pyx_k_Cannot_construct[] = "Cannot construct {}";
+static const char __pyx_k_Cannot_construct[] = "Cannot construct ";
static const char __pyx_k_NOT_COACCESSIBLE[] = "NOT_COACCESSIBLE";
static const char __pyx_k_Operation_failed[] = "Operation failed";
+static const char __pyx_k_RandArcSelection[] = "RandArcSelection";
+static const char __pyx_k_ReplaceLabelType[] = "ReplaceLabelType";
+static const char __pyx_k_Unknown_FAR_type[] = "Unknown FAR type: ";
+static const char __pyx_k_Unknown_arc_type[] = "Unknown arc type: ";
+static const char __pyx_k_Unknown_map_type[] = "Unknown map type: ";
static const char __pyx_k_labeled_checksum[] = "labeled_checksum";
static const char __pyx_k_read_from_string[] = "read_from_string";
static const char __pyx_k_shortestdistance[] = "shortestdistance";
static const char __pyx_k_ARC_I_LABEL_VALUE[] = "ARC_I_LABEL_VALUE";
static const char __pyx_k_ARC_O_LABEL_VALUE[] = "ARC_O_LABEL_VALUE";
+static const char __pyx_k_ArcIterator_at_0x[] = "<ArcIterator at 0x";
static const char __pyx_k_BINARY_PROPERTIES[] = "BINARY_PROPERTIES";
-static const char __pyx_k_FarReader_at_0x_x[] = "<{} FarReader at 0x{:x}>";
-static const char __pyx_k_FarWriter_at_0x_x[] = "<{} FarWriter at 0x{:x}>";
static const char __pyx_k_FstBadWeightError[] = "FstBadWeightError";
static const char __pyx_k_UNWEIGHTED_CYCLES[] = "UNWEIGHTED_CYCLES";
-static const char __pyx_k_Use_print_instead[] = "Use `print` instead";
+static const char __pyx_k_Unknown_sort_type[] = "Unknown sort type: ";
static const char __pyx_k_call_arc_labeling[] = "call_arc_labeling";
-static const char __pyx_k_src_pywrapfst_pyx[] = "src/pywrapfst.pyx";
static const char __pyx_k_ADD_ARC_PROPERTIES[] = "ADD_ARC_PROPERTIES";
static const char __pyx_k_Compilation_failed[] = "Compilation failed";
-static const char __pyx_k_DeprecationWarning[] = "DeprecationWarning";
+static const char __pyx_k_EncodeMapper_at_0x[] = "<EncodeMapper at 0x";
static const char __pyx_k_FstSymbolTableView[] = "_FstSymbolTableView";
static const char __pyx_k_MutableArcIterator[] = "MutableArcIterator";
static const char __pyx_k_MutableSymbolTable[] = "_MutableSymbolTable";
static const char __pyx_k_NOT_O_LABEL_SORTED[] = "NOT_O_LABEL_SORTED";
static const char __pyx_k_SET_ARC_PROPERTIES[] = "SET_ARC_PROPERTIES";
static const char __pyx_k_TRINARY_PROPERTIES[] = "TRINARY_PROPERTIES";
-static const char __pyx_k_Unknown_arc_type_r[] = "Unknown arc type: {!r}";
-static const char __pyx_k_Unknown_map_type_r[] = "Unknown map type: {!r}";
+static const char __pyx_k_Unknown_queue_type[] = "Unknown queue type: ";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_epsilon_on_replace[] = "epsilon_on_replace";
static const char __pyx_k_num_input_epsilons[] = "num_input_epsilons";
static const char __pyx_k_ARC_SORT_PROPERTIES[] = "ARC_SORT_PROPERTIES";
-static const char __pyx_k_ArcIterator_at_0x_x[] = "<ArcIterator at 0x{:x}>";
+static const char __pyx_k_Fst_SymbolTableView[] = "<Fst SymbolTableView ";
static const char __pyx_k_NON_I_DETERMINISTIC[] = "NON_I_DETERMINISTIC";
static const char __pyx_k_NON_O_DETERMINISTIC[] = "NON_O_DETERMINISTIC";
+static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
+static const char __pyx_k_StateIterator_at_0x[] = "<StateIterator at 0x";
static const char __pyx_k_SymbolTableIterator[] = "_SymbolTableIterator";
-static const char __pyx_k_Unknown_sort_type_r[] = "Unknown sort type {!r}";
static const char __pyx_k_attach_new_isymbols[] = "attach_new_isymbols";
static const char __pyx_k_attach_new_osymbols[] = "attach_new_osymbols";
static const char __pyx_k_num_output_epsilons[] = "num_output_epsilons";
static const char __pyx_k_ADD_STATE_PROPERTIES[] = "ADD_STATE_PROPERTIES";
static const char __pyx_k_ARC_NEXT_STATE_VALUE[] = "ARC_NEXT_STATE_VALUE";
static const char __pyx_k_EXTRINSIC_PROPERTIES[] = "EXTRINSIC_PROPERTIES";
-static const char __pyx_k_EncodeMapper_at_0x_x[] = "<EncodeMapper at 0x{:x}>";
static const char __pyx_k_INTRINSIC_PROPERTIES[] = "INTRINSIC_PROPERTIES";
+static const char __pyx_k_Read_from_FST_failed[] = "Read from FST failed: ";
static const char __pyx_k_SET_FINAL_PROPERTIES[] = "SET_FINAL_PROPERTIES";
static const char __pyx_k_SET_START_PROPERTIES[] = "SET_START_PROPERTIES";
-static const char __pyx_k_Unknown_queue_type_r[] = "Unknown queue type: {!r}";
static const char __pyx_k_keep_state_numbering[] = "keep_state_numbering";
static const char __pyx_k_read_Fst_from_string[] = "_read_Fst_from_string";
static const char __pyx_k_require_superinitial[] = "require_superinitial";
+static const char __pyx_k_typing_Literal_e_f_g[] = "typing.Literal[\"e\", \"f\", \"g\"]";
static const char __pyx_k_DELETE_ARC_PROPERTIES[] = "DELETE_ARC_PROPERTIES";
static const char __pyx_k_STATE_SORT_PROPERTIES[] = "STATE_SORT_PROPERTIES";
-static const char __pyx_k_StateIterator_at_0x_x[] = "<StateIterator at 0x{:x}>";
-static const char __pyx_k_SymbolTable_r_at_0x_x[] = "<SymbolTable {!r} at 0x{:x}>";
static const char __pyx_k_Weight_type_not_found[] = "Weight type not found";
static const char __pyx_k_allow_negative_labels[] = "allow_negative_labels";
-static const char __pyx_k_Conversion_to_r_failed[] = "Conversion to {!r} failed";
static const char __pyx_k_Dot_rendering_failed_s[] = "Dot rendering failed: %s";
static const char __pyx_k_NEG_TRINARY_PROPERTIES[] = "NEG_TRINARY_PROPERTIES";
static const char __pyx_k_POS_TRINARY_PROPERTIES[] = "POS_TRINARY_PROPERTIES";
static const char __pyx_k_Write_to_string_failed[] = "Write to string failed";
static const char __pyx_k_DELETE_STATE_PROPERTIES[] = "DELETE_STATE_PROPERTIES";
+static const char __pyx_k_Read_from_string_failed[] = "Read from string failed";
+static const char __pyx_k_Unknown_projection_type[] = "Unknown projection type: ";
+static const char __pyx_k_MutableArcIterator_at_0x[] = "<MutableArcIterator at 0x";
static const char __pyx_k_RM_SUPERFINAL_PROPERTIES[] = "RM_SUPERFINAL_PROPERTIES";
static const char __pyx_k_State_index_out_of_range[] = "State index out of range";
static const char __pyx_k_ADD_SUPERFINAL_PROPERTIES[] = "ADD_SUPERFINAL_PROPERTIES";
-static const char __pyx_k_Cannot_encode_as_string_r[] = "Cannot encode as string: {!r}";
static const char __pyx_k_Cannot_topsort_cyclic_FST[] = "Cannot topsort cyclic FST";
static const char __pyx_k_MutableArcIterator___iter[] = "MutableArcIterator.__iter__";
static const char __pyx_k_MutableFstSymbolTableView[] = "_MutableFstSymbolTableView";
-static const char __pyx_k_FstDeletedConstructorError[] = "FstDeletedConstructorError";
-static const char __pyx_k_MutableArcIterator_at_0x_x[] = "<MutableArcIterator at 0x{:x}>";
+static const char __pyx_k_SymbolTableIterator_at_0x[] = "<_SymbolTableIterator at 0x";
+static const char __pyx_k_const_Fst_SymbolTableView[] = "<const Fst SymbolTableView ";
+static const char __pyx_k_Unknown_replace_label_type[] = "Unknown replace label type: ";
static const char __pyx_k_EncodeMapperSymbolTableView[] = "_EncodeMapperSymbolTableView";
-static const char __pyx_k_SymbolTableIterator_at_0x_x[] = "<_SymbolTableIterator at 0x{:x}>";
+static const char __pyx_k_Unknown_compose_filter_type[] = "Unknown compose filter type: ";
static const char __pyx_k_WEIGHT_INVARIANT_PROPERTIES[] = "WEIGHT_INVARIANT_PROPERTIES";
+static const char __pyx_k_typing_Literal_input_output[] = "typing.Literal[\"input\", \"output\"]";
static const char __pyx_k_I_LABEL_INVARIANT_PROPERTIES[] = "I_LABEL_INVARIANT_PROPERTIES";
static const char __pyx_k_O_LABEL_INVARIANT_PROPERTIES[] = "O_LABEL_INVARIANT_PROPERTIES";
static const char __pyx_k_SymbolTable_no_longer_exists[] = "SymbolTable no longer exists";
-static const char __pyx_k_Unknown_replace_label_type_r[] = "Unknown replace label type: {!r}";
+static const char __pyx_k_Unknown_determinization_type[] = "Unknown determinization type: ";
static const char __pyx_k_read_SymbolTable_from_string[] = "_read_SymbolTable_from_string";
-static const char __pyx_k_Fst_SymbolTableView_r_at_0x_x[] = "<Fst SymbolTableView {!r} at 0x{:x}>";
+static const char __pyx_k_typing_Literal_ilabel_olabel[] = "typing.Literal[\"ilabel\", \"olabel\"]";
static const char __pyx_k_No_new_SymbolTables_specified[] = "No new SymbolTables specified";
static const char __pyx_k_No_relabeling_pairs_specified[] = "No relabeling pairs specified";
-static const char __pyx_k_Unknown_compose_filter_type_r[] = "Unknown compose filter type: {!r}";
static const char __pyx_k_increment_subsequential_label[] = "increment_subsequential_label";
static const char __pyx_k_read_EncodeMapper_from_string[] = "_read_EncodeMapper_from_string";
static const char __pyx_k_Incompatible_or_invalid_weight[] = "Incompatible or invalid weight";
-static const char __pyx_k_Unknown_determinization_type_r[] = "Unknown determinization type: {!r}";
-static const char __pyx_k_const_Fst_SymbolTableView_r_at[] = "<const Fst SymbolTableView {!r} at 0x{:x}>";
-static const char __pyx_k_const_EncodeMapper_SymbolTableV[] = "<const EncodeMapper SymbolTableView {!r} at 0x{:x}>";
+static const char __pyx_k_const_EncodeMapper_SymbolTableV[] = "<const EncodeMapper SymbolTableView ";
static const char __pyx_k_self__aiter_self__fst_cannot_be[] = "self._aiter,self._fst cannot be converted to a Python object for pickling";
static const char __pyx_k_self__fst_self__siter_cannot_be[] = "self._fst,self._siter cannot be converted to a Python object for pickling";
static const char __pyx_k_self__siter_cannot_be_converted[] = "self._siter cannot be converted to a Python object for pickling";
+static const char __pyx_k_typing_Literal_uniform_log_prob[] = "typing.Literal[\"uniform\", \"log_prob\", \"fast_log_prob\"]";
static const char __pyx_k_Incompatible_or_invalid_arc_type[] = "Incompatible or invalid arc type";
static const char __pyx_k_Incompatible_or_invalid_weight_t[] = "Incompatible or invalid weight type";
static const char __pyx_k_Python_interface_to_the_FST_scri[] = "Python interface to the FST scripting API.\n\nOperations which construct new FSTs are implemented as traditional functions, as\nare two-argument boolean functions like `equal` and `equivalent`. Destructive\noperations---those that mutate an FST, in place---are instance methods, as is\n`write`. Operator overloading is not used. The following example, based on\nMohri et al. 2002, shows the construction of an ASR system given a pronunciation\nlexicon L, grammar G, a transducer from context-dependent phones to\ncontext-independent phones C, and an HMM set H:\n\n L = fst.Fst.read(\"L.fst\")\n G = fst.Fst.read(\"G.fst\")\n C = fst.Fst.read(\"C.fst\")\n H = fst.Fst.read(\"H.fst\")\n LG = fst.determinize(fst.compose(L, G))\n CLG = fst.determinize(fst.compose(C, LG))\n HCLG = fst.determinize(fst.compose(H, CLG))\n HCLG.minimize() # NB: works in-place.\n\nPython variables here use snake_case and constants are in all caps, minus the\nnormal `k` prefix.\n";
-static const char __pyx_k_Unknown_random_arc_selection_typ[] = "Unknown random arc selection type: {!r}";
+static const char __pyx_k_Unknown_random_arc_selection_typ[] = "Unknown random arc selection type: ";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_self__aiter_self__mfst_cannot_be[] = "self._aiter,self._mfst cannot be converted to a Python object for pickling";
static const char __pyx_k_self__arc_cannot_be_converted_to[] = "self._arc cannot be converted to a Python object for pickling";
static const char __pyx_k_self__reader_cannot_be_converted[] = "self._reader cannot be converted to a Python object for pickling";
static const char __pyx_k_self__weight_cannot_be_converted[] = "self._weight cannot be converted to a Python object for pickling";
static const char __pyx_k_self__writer_cannot_be_converted[] = "self._writer cannot be converted to a Python object for pickling";
+static const char __pyx_k_typing_Literal_alt_sequence_auto[] = "typing.Literal[\"alt_sequence\", \"auto\", \"match\", \"no_match\",\n \"null\", \"sequence\", \"trivial\"]";
+static const char __pyx_k_typing_Literal_arc_sum_arc_uniqu[] = "typing.Literal[\"arc_sum\", \"arc_unique\", \"identity\"]";
+static const char __pyx_k_typing_Literal_auto_fifo_lifo_sh[] = "typing.Literal[\"auto\", \"fifo\", \"lifo\", \"shortest\", \"state\",\n \"top\"]";
+static const char __pyx_k_typing_Literal_fst_stlist_sttabl[] = "typing.Literal[\n \"fst\",\n \"stlist\",\n \"sttable\",\n \"default\"\n]";
+static const char __pyx_k_typing_Literal_functional_nonfun[] = "typing.Literal[\"functional\", \"nonfunctional\",\n \"disambiguate\"]";
+static const char __pyx_k_typing_Literal_identity_input_ep[] = "typing.Literal[\"identity\", \"input_epsilon\", \"invert\",\n \"output_epsilon\", \"plus\", \"power\", \"quantize\",\n \"rmweight\", \"superfinal\", \"times\", \"to_log\",\n # NOTE: Both spellings of \"to_std\"\n \"to_log64\", \"to_std\", \"to_standard\"]";
+static const char __pyx_k_typing_Literal_neither_input_out[] = "typing.Literal[\"neither\", \"input\", \"output\", \"both\"]";
+static const char __pyx_k_typing_Union_Weight_typing_Union[] = "typing.Union[Weight, typing.Union[str, int, float]]";
+static PyObject *__pyx_kp_u_;
static PyObject *__pyx_n_s_ACCEPTOR;
static PyObject *__pyx_n_s_ACCESSIBLE;
static PyObject *__pyx_n_s_ACYCLIC;
static PyObject *__pyx_n_s_ARC_WEIGHT_VALUE;
static PyObject *__pyx_n_s_Arc;
static PyObject *__pyx_n_s_ArcIterator;
-static PyObject *__pyx_kp_u_ArcIterator_at_0x_x;
-static PyObject *__pyx_kp_u_Arc_at_0x_x;
+static PyObject *__pyx_kp_u_ArcIterator_at_0x;
+static PyObject *__pyx_n_s_ArcMapType;
+static PyObject *__pyx_kp_u_Arc_at_0x;
static PyObject *__pyx_n_s_BINARY_PROPERTIES;
static PyObject *__pyx_n_s_COACCESSIBLE;
static PyObject *__pyx_n_s_COPY_PROPERTIES;
static PyObject *__pyx_n_s_CYCLIC;
static PyObject *__pyx_kp_u_Cannot_construct;
-static PyObject *__pyx_kp_u_Cannot_encode_as_string_r;
static PyObject *__pyx_kp_u_Cannot_topsort_cyclic_FST;
static PyObject *__pyx_kp_u_Compilation_failed;
static PyObject *__pyx_n_s_Compiler;
-static PyObject *__pyx_kp_u_Conversion_to_r_failed;
+static PyObject *__pyx_n_s_ComposeFilter;
+static PyObject *__pyx_kp_u_Conversion_to;
static PyObject *__pyx_n_s_DELETE_ARC_PROPERTIES;
static PyObject *__pyx_n_s_DELETE_STATE_PROPERTIES;
-static PyObject *__pyx_n_s_DeprecationWarning;
+static PyObject *__pyx_n_s_DeterminizeType;
static PyObject *__pyx_kp_u_Dot_rendering_failed_s;
+static PyObject *__pyx_n_s_DrawFloatFormat;
static PyObject *__pyx_n_s_ENCODE_FLAGS;
static PyObject *__pyx_n_s_ENCODE_LABELS;
static PyObject *__pyx_n_s_ENCODE_WEIGHTS;
static PyObject *__pyx_n_s_EXTRINSIC_PROPERTIES;
static PyObject *__pyx_n_s_EncodeMapper;
static PyObject *__pyx_n_s_EncodeMapperSymbolTableView;
-static PyObject *__pyx_kp_u_EncodeMapper_at_0x_x;
+static PyObject *__pyx_kp_u_EncodeMapper_at_0x;
+static PyObject *__pyx_kp_u_Expected;
static PyObject *__pyx_n_s_FST_PROPERTIES;
static PyObject *__pyx_n_s_FarReader;
-static PyObject *__pyx_kp_u_FarReader_at_0x_x;
+static PyObject *__pyx_kp_u_FarReader_at_0x;
+static PyObject *__pyx_n_s_FarType;
static PyObject *__pyx_n_s_FarWriter;
-static PyObject *__pyx_kp_u_FarWriter_at_0x_x;
+static PyObject *__pyx_kp_u_FarWriter_at_0x;
static PyObject *__pyx_n_s_Fst;
static PyObject *__pyx_n_s_FstArgError;
static PyObject *__pyx_n_s_FstBadWeightError;
-static PyObject *__pyx_n_s_FstDeletedConstructorError;
static PyObject *__pyx_n_s_FstError;
static PyObject *__pyx_n_s_FstIOError;
static PyObject *__pyx_n_s_FstIndexError;
static PyObject *__pyx_n_s_FstOpError;
static PyObject *__pyx_n_s_FstSymbolTableView;
-static PyObject *__pyx_kp_u_Fst_SymbolTableView_r_at_0x_x;
-static PyObject *__pyx_kp_u_Fst_at_0x_x;
+static PyObject *__pyx_kp_u_Fst_SymbolTableView;
+static PyObject *__pyx_kp_u_Fst_at_0x;
static PyObject *__pyx_n_s_INITIAL_ACYCLIC;
static PyObject *__pyx_n_s_INITIAL_CYCLIC;
static PyObject *__pyx_n_s_INTRINSIC_PROPERTIES;
static PyObject *__pyx_n_s_MUTABLE;
static PyObject *__pyx_n_s_MutableArcIterator;
static PyObject *__pyx_n_s_MutableArcIterator___iter;
-static PyObject *__pyx_kp_u_MutableArcIterator_at_0x_x;
+static PyObject *__pyx_kp_u_MutableArcIterator_at_0x;
static PyObject *__pyx_n_s_MutableFst;
static PyObject *__pyx_n_s_MutableFstSymbolTableView;
static PyObject *__pyx_n_s_MutableSymbolTable;
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_Number;
static PyObject *__pyx_n_s_O_DETERMINISTIC;
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_r;
+static PyObject *__pyx_kp_u_Open_failed;
static PyObject *__pyx_kp_u_Operation_failed;
static PyObject *__pyx_n_s_PIPE;
static PyObject *__pyx_n_s_POS_TRINARY_PROPERTIES;
static PyObject *__pyx_n_s_Popen;
+static PyObject *__pyx_n_s_ProjectType;
+static PyObject *__pyx_n_s_QueueType;
static PyObject *__pyx_n_s_RM_SUPERFINAL_PROPERTIES;
+static PyObject *__pyx_n_s_RandArcSelection;
static PyObject *__pyx_kp_u_Read_failed;
-static PyObject *__pyx_kp_u_Read_failed_r;
+static PyObject *__pyx_kp_u_Read_from_FST_failed;
+static PyObject *__pyx_kp_u_Read_from_string_failed;
+static PyObject *__pyx_n_s_ReplaceLabelType;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_SET_ARC_PROPERTIES;
static PyObject *__pyx_n_s_SET_FINAL_PROPERTIES;
static PyObject *__pyx_n_s_SET_START_PROPERTIES;
static PyObject *__pyx_n_s_STATE_SORT_PROPERTIES;
static PyObject *__pyx_n_s_STRING;
+static PyObject *__pyx_n_s_SortType;
static PyObject *__pyx_n_s_StateIterator;
-static PyObject *__pyx_kp_u_StateIterator_at_0x_x;
+static PyObject *__pyx_kp_u_StateIterator_at_0x;
+static PyObject *__pyx_n_s_StateMapType;
static PyObject *__pyx_kp_u_State_index_out_of_range;
static PyObject *__pyx_n_s_StopIteration;
-static PyObject *__pyx_n_s_SymbolTable;
+static PyObject *__pyx_kp_u_SymbolTable;
static PyObject *__pyx_n_s_SymbolTableIterator;
-static PyObject *__pyx_kp_u_SymbolTableIterator_at_0x_x;
+static PyObject *__pyx_kp_u_SymbolTableIterator_at_0x;
+static PyObject *__pyx_n_s_SymbolTableView;
static PyObject *__pyx_n_s_SymbolTable_2;
static PyObject *__pyx_kp_u_SymbolTable_no_longer_exists;
-static PyObject *__pyx_kp_u_SymbolTable_r_at_0x_x;
static PyObject *__pyx_n_s_TOP_SORTED;
static PyObject *__pyx_n_s_TRINARY_PROPERTIES;
static PyObject *__pyx_kp_u_Tsvg;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_UNWEIGHTED;
static PyObject *__pyx_n_s_UNWEIGHTED_CYCLES;
-static PyObject *__pyx_kp_u_Unknown_arc_type_r;
-static PyObject *__pyx_kp_u_Unknown_compose_filter_type_r;
-static PyObject *__pyx_kp_u_Unknown_determinization_type_r;
-static PyObject *__pyx_kp_u_Unknown_map_type_r;
-static PyObject *__pyx_kp_u_Unknown_queue_type_r;
+static PyObject *__pyx_kp_u_Unknown_FAR_type;
+static PyObject *__pyx_kp_u_Unknown_arc_type;
+static PyObject *__pyx_kp_u_Unknown_compose_filter_type;
+static PyObject *__pyx_kp_u_Unknown_determinization_type;
+static PyObject *__pyx_kp_u_Unknown_map_type;
+static PyObject *__pyx_kp_u_Unknown_projection_type;
+static PyObject *__pyx_kp_u_Unknown_queue_type;
static PyObject *__pyx_kp_u_Unknown_random_arc_selection_typ;
-static PyObject *__pyx_kp_u_Unknown_replace_label_type_r;
-static PyObject *__pyx_kp_u_Unknown_sort_type_r;
-static PyObject *__pyx_kp_u_Use_print_instead;
+static PyObject *__pyx_kp_u_Unknown_replace_label_type;
+static PyObject *__pyx_kp_u_Unknown_sort_type;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_VectorFst;
static PyObject *__pyx_n_s_WEIGHTED;
static PyObject *__pyx_n_s_WEIGHTED_CYCLES;
static PyObject *__pyx_n_s_WEIGHT_INVARIANT_PROPERTIES;
-static PyObject *__pyx_n_s_Weight;
-static PyObject *__pyx_kp_u_Weight_at_0x_x;
+static PyObject *__pyx_kp_u_Weight;
+static PyObject *__pyx_n_s_WeightLike;
+static PyObject *__pyx_n_s_Weight_2;
static PyObject *__pyx_kp_u_Weight_type_not_found;
-static PyObject *__pyx_kp_u_Write_failed_r;
+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_b__8;
+static PyObject *__pyx_kp_u__11;
+static PyObject *__pyx_kp_u__2;
+static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_n_s_acceptor;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_state;
static PyObject *__pyx_n_s_add_table;
static PyObject *__pyx_n_s_allow_negative_labels;
static PyObject *__pyx_n_s_allow_nondet;
-static PyObject *__pyx_n_u_always;
static PyObject *__pyx_n_s_arc;
static PyObject *__pyx_n_s_arc_type;
static PyObject *__pyx_n_s_arcs;
static PyObject *__pyx_n_s_args;
+static PyObject *__pyx_kp_u_at_0x;
static PyObject *__pyx_n_s_attach_new_isymbols;
static PyObject *__pyx_n_s_attach_new_osymbols;
-static PyObject *__pyx_n_b_auto;
+static PyObject *__pyx_n_u_auto;
static PyObject *__pyx_n_s_available_key;
+static PyObject *__pyx_kp_u_but_received;
static PyObject *__pyx_n_s_call_arc_labeling;
static PyObject *__pyx_n_s_checksum;
static PyObject *__pyx_n_s_class;
+static PyObject *__pyx_n_s_class_2;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_closure_plus;
static PyObject *__pyx_n_s_compose_filter;
static PyObject *__pyx_n_s_connect;
static PyObject *__pyx_kp_u_const_EncodeMapper_SymbolTableV;
-static PyObject *__pyx_kp_u_const_Fst_SymbolTableView_r_at;
+static PyObject *__pyx_kp_u_const_Fst_SymbolTableView;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_create;
-static PyObject *__pyx_n_b_default;
+static PyObject *__pyx_n_u_default;
static PyObject *__pyx_n_s_delta;
static PyObject *__pyx_n_s_det_type;
static PyObject *__pyx_n_s_distance;
static PyObject *__pyx_n_s_done;
static PyObject *__pyx_n_u_dot;
static PyObject *__pyx_n_s_draw;
-static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_encode_labels;
static PyObject *__pyx_n_s_encode_weights;
static PyObject *__pyx_n_s_eps_norm_output;
static PyObject *__pyx_n_s_epsilon_on_replace;
static PyObject *__pyx_n_s_error;
+static PyObject *__pyx_kp_u_failed;
static PyObject *__pyx_n_s_far_type;
static PyObject *__pyx_n_s_final;
static PyObject *__pyx_n_s_find;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_float_format;
static PyObject *__pyx_n_s_fontsize;
-static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_fspath;
static PyObject *__pyx_n_s_fst_type;
-static PyObject *__pyx_n_b_functional;
-static PyObject *__pyx_n_b_g;
+static PyObject *__pyx_n_u_functional;
+static PyObject *__pyx_n_u_g;
static PyObject *__pyx_n_s_get_fst;
static PyObject *__pyx_n_s_get_key;
static PyObject *__pyx_n_s_get_nth_key;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_height;
static PyObject *__pyx_n_s_id;
-static PyObject *__pyx_n_b_identity;
+static PyObject *__pyx_n_u_identity;
static PyObject *__pyx_n_s_ifst;
static PyObject *__pyx_n_s_ifst1;
static PyObject *__pyx_n_s_ifst2;
-static PyObject *__pyx_n_b_ilabel;
static PyObject *__pyx_n_s_ilabel;
+static PyObject *__pyx_n_u_ilabel;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_increment_subsequential_label;
-static PyObject *__pyx_n_b_input;
+static PyObject *__pyx_n_u_input;
static PyObject *__pyx_n_s_input_symbols;
static PyObject *__pyx_n_s_input_table;
static PyObject *__pyx_n_s_ipairs;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
-static PyObject *__pyx_n_b_neither;
+static PyObject *__pyx_n_u_neither;
static PyObject *__pyx_n_s_new_isymbols;
static PyObject *__pyx_n_s_new_osymbols;
static PyObject *__pyx_n_s_next;
static PyObject *__pyx_n_s_old_osymbols;
static PyObject *__pyx_n_s_opairs;
static PyObject *__pyx_n_s_open;
+static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_osymbols;
static PyObject *__pyx_n_s_output_symbols;
static PyObject *__pyx_n_s_pairs;
static PyObject *__pyx_n_s_precision;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
-static PyObject *__pyx_n_s_project_output;
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_pywrapfst_2;
+static PyObject *__pyx_kp_s_pywrapfst_pyx;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_queue_type;
static PyObject *__pyx_n_s_remove_total_weight;
static PyObject *__pyx_n_s_require_superinitial;
static PyObject *__pyx_n_s_reset;
-static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_return_arc_labeling;
static PyObject *__pyx_n_s_return_label;
static PyObject *__pyx_n_s_reverse;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_shortestdistance;
static PyObject *__pyx_n_s_show_weight_one;
-static PyObject *__pyx_n_s_simplefilter;
static PyObject *__pyx_n_s_sort_type;
static PyObject *__pyx_n_s_source;
-static PyObject *__pyx_kp_s_src_pywrapfst_pyx;
static PyObject *__pyx_n_s_ssymbols;
-static PyObject *__pyx_n_s_stacklevel;
-static PyObject *__pyx_n_b_standard;
+static PyObject *__pyx_n_u_standard;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_states;
static PyObject *__pyx_n_s_subprocess;
static PyObject *__pyx_n_s_subsequential_label;
static PyObject *__pyx_n_s_symbol;
-static PyObject *__pyx_n_s_syms;
+static PyObject *__pyx_n_s_symbols;
+static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_test_2;
-static PyObject *__pyx_n_s_text;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_times;
static PyObject *__pyx_n_s_title;
static PyObject *__pyx_n_s_to_final;
static PyObject *__pyx_n_s_to_string;
static PyObject *__pyx_n_s_type;
-static PyObject *__pyx_n_b_uniform;
+static PyObject *__pyx_n_s_typing;
+static PyObject *__pyx_kp_u_typing_Literal_alt_sequence_auto;
+static PyObject *__pyx_kp_u_typing_Literal_arc_sum_arc_uniqu;
+static PyObject *__pyx_kp_u_typing_Literal_auto_fifo_lifo_sh;
+static PyObject *__pyx_kp_u_typing_Literal_e_f_g;
+static PyObject *__pyx_kp_u_typing_Literal_fst_stlist_sttabl;
+static PyObject *__pyx_kp_u_typing_Literal_functional_nonfun;
+static PyObject *__pyx_kp_u_typing_Literal_identity_input_ep;
+static PyObject *__pyx_kp_u_typing_Literal_ilabel_olabel;
+static PyObject *__pyx_kp_u_typing_Literal_input_output;
+static PyObject *__pyx_kp_u_typing_Literal_neither_input_out;
+static PyObject *__pyx_kp_u_typing_Literal_uniform_log_prob;
+static PyObject *__pyx_kp_u_typing_Union_Weight_typing_Union;
+static PyObject *__pyx_n_u_uniform;
static PyObject *__pyx_n_s_unique;
static PyObject *__pyx_n_s_unknown_isymbol;
static PyObject *__pyx_n_s_unknown_osymbol;
static PyObject *__pyx_kp_u_unspecified;
-static PyObject *__pyx_n_u_utf8;
static PyObject *__pyx_n_s_value;
-static PyObject *__pyx_n_b_vector;
+static PyObject *__pyx_n_u_vector;
static PyObject *__pyx_n_s_verify;
static PyObject *__pyx_n_s_vertical;
static PyObject *__pyx_n_s_w;
-static PyObject *__pyx_n_s_warn;
static PyObject *__pyx_n_s_warning;
-static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_s_weight;
+static PyObject *__pyx_n_s_weight_2;
static PyObject *__pyx_n_s_weight_type;
static PyObject *__pyx_n_s_weighted;
static PyObject *__pyx_n_s_width;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_write_text;
static PyObject *__pyx_n_s_write_to_string;
+static PyObject *__pyx_n_u_x;
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 PyObject *__pyx_pf_9pywrapfst_2times(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4divide(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6power(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w, size_t __pyx_v_n); /* proto */
-static int __pyx_pf_9pywrapfst_12_SymbolTable___init__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_2__iter__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_4__reduce__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_6available_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_8checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_10copy(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_12find(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_14get_nth_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, Py_ssize_t __pyx_v_pos); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_16labeled_checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_18member(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static int __pyx_pf_9pywrapfst_12_SymbolTable_20__contains__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_22name(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_24num_symbols(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_26write(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_28write_text(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_30write_to_string(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
+static int __pyx_pf_9pywrapfst_15SymbolTableView___init__(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_2__iter__(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_4__reduce__(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_6available_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_8checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_10copy(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_12find(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_14get_nth_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, Py_ssize_t __pyx_v_pos); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_16labeled_checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_18member(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_20name(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_22num_symbols(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_24write(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_26write_text(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_28write_to_string(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_28_EncodeMapperSymbolTableView___repr__(struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_FstSymbolTableView___repr__(struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, int64 __pyx_v_key); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_2add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_2add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_4set_name(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_new_name); /* proto */
static PyObject *__pyx_pf_9pywrapfst_26_MutableFstSymbolTableView___repr__(struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable___repr__(struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_4read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_6read_text(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, bool __pyx_v_allow_negative_labels); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_8read_fst(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, bool __pyx_v_input_table); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_8_read_SymbolTable_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_10compact_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12merge_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_lhs, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_rhs); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_8_read_SymbolTable_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_10compact_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_12merge_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator___repr__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self); /* proto */
-static int __pyx_pf_9pywrapfst_20_SymbolTableIterator_2__init__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
+static int __pyx_pf_9pywrapfst_20_SymbolTableIterator_2__init__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator_4__iter__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator_6__next__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_22write_to_string(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_24input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_26output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_28set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_30set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_14_read_EncodeMapper_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_28set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_30set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_14_read_EncodeMapper_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst__repr_svg_(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_3Fst_2__init__(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_4__reduce__(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_10arc_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_12arcs(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_14copy(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_3Fst_16draw(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, PyObject *__pyx_v_title, double __pyx_v_width, double __pyx_v_height, bool __pyx_v_portrait, bool __pyx_v_vertical, double __pyx_v_ranksep, double __pyx_v_nodesep, int32 __pyx_v_fontsize, int32 __pyx_v_precision, PyObject *__pyx_v_float_format, bool __pyx_v_show_weight_one); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_3Fst_16draw(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, 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, PyObject *__pyx_v_title, double __pyx_v_width, double __pyx_v_height, bool __pyx_v_portrait, bool __pyx_v_vertical, double __pyx_v_ranksep, double __pyx_v_nodesep, int32 __pyx_v_fontsize, int32 __pyx_v_precision, PyObject *__pyx_v_float_format, bool __pyx_v_show_weight_one); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_18final(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_20fst_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_22input_symbols(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_26num_input_epsilons(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state); /* 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__SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_show_weight_one, PyObject *__pyx_v_missing_sym); /* 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_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_3Fst_42states(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_3Fst_44text(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_show_weight_one, PyObject *__pyx_v_missing_sym); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_3Fst_46verify(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_3Fst_48weight_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_3Fst_50write(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_3Fst_52write_to_string(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_3Fst_44verify(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_3Fst_46weight_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_3Fst_48write(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_3Fst_50write_to_string(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_add_arc(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_2add_state(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_4add_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, size_t __pyx_v_n); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_28mutable_input_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_30mutable_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_32num_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_10MutableFst_34project(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, bool __pyx_v_project_output); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_10MutableFst_34project(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_project_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_36prune(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, int64 __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_38push(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_remove_total_weight, bool __pyx_v_to_final); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_40relabel_pairs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_ipairs, PyObject *__pyx_v_opairs); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_10MutableFst_42relabel_tables(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_10MutableFst_42relabel_tables(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_44reserve_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, size_t __pyx_v_n); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_46reserve_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_n); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_48reweight(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, bool __pyx_v_to_final); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_50rmepsilon(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, int64 __pyx_v_nstate, float __pyx_v_delta); /* 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__SymbolTable *__pyx_v_syms); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_10MutableFst_56set_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_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_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 int __pyx_pf_9pywrapfst_9VectorFst___init__(struct __pyx_obj_9pywrapfst_VectorFst *__pyx_v_self, PyObject *__pyx_v_arc_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_16_read_Fst(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_18_read_Fst_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_18_read_Fst_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Arc___repr__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_3Arc_2__init__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_ilabel, int64 __pyx_v_olabel, PyObject *__pyx_v_weight, int64 __pyx_v_nextstate); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Arc_4copy(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_40isomorphic(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_9pywrapfst_42prune(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64 __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_44push(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, bool __pyx_v_push_weights, bool __pyx_v_push_labels, bool __pyx_v_remove_common_affix, bool __pyx_v_remove_total_weight, bool __pyx_v_to_final); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_46randequivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2, int32 __pyx_v_npath, float __pyx_v_delta, time_t __pyx_v_seed, PyObject *__pyx_v_select, int32 __pyx_v_max_length); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_48randgen(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, int32 __pyx_v_npath, time_t __pyx_v_seed, PyObject *__pyx_v_select, int32 __pyx_v_max_length, bool __pyx_v_weighted, bool __pyx_v_remove_total_weight); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_46randequivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2, int32 __pyx_v_npath, float __pyx_v_delta, PyObject *__pyx_v_select, int32 __pyx_v_max_length, uint64 __pyx_v_seed); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_48randgen(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, int32 __pyx_v_npath, PyObject *__pyx_v_select, int32 __pyx_v_max_length, bool __pyx_v_weighted, bool __pyx_v_remove_total_weight, uint64 __pyx_v_seed); /* proto */
static PyObject *__pyx_pf_9pywrapfst_50replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pairs, PyObject *__pyx_v_call_arc_labeling, PyObject *__pyx_v_return_arc_labeling, bool __pyx_v_epsilon_on_replace, int64 __pyx_v_return_label); /* proto */
static PyObject *__pyx_pf_9pywrapfst_52reverse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, bool __pyx_v_require_superinitial); /* proto */
static PyObject *__pyx_pf_9pywrapfst_54shortestdistance(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_reverse); /* proto */
static PyObject *__pyx_pf_9pywrapfst_56shortestpath(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int32 __pyx_v_nshortest, int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_unique, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_58statemap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, PyObject *__pyx_v_map_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_60synchronize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst); /* proto */
-static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, std::string __pyx_v_fst_type, std::string __pyx_v_arc_type, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_keep_isymbols, bool __pyx_v_keep_osymbols, bool __pyx_v_keep_state_numbering, bool __pyx_v_allow_negative_labels); /* proto */
+static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_fst_type, PyObject *__pyx_v_arc_type, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_keep_isymbols, bool __pyx_v_keep_osymbols, bool __pyx_v_keep_state_numbering, bool __pyx_v_allow_negative_labels); /* proto */
static PyObject *__pyx_pf_9pywrapfst_8Compiler_2compile(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_8Compiler_4write(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_expression); /* proto */
static PyObject *__pyx_pf_9pywrapfst_8Compiler_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_20next(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_22reset(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_24__getitem__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_9FarReader_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_9FarReader_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_9FarReader_26__next__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_9FarReader_28__iter__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_9FarReader_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_9FarReader_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_9pywrapfst_9FarWriter___init__(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, PyObject *__pyx_v_arc_type, PyObject *__pyx_v_far_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_9pywrapfst_Weight(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_9pywrapfst__SymbolTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_9pywrapfst_SymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__EncodeMapperSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__FstSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__MutableSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_FarReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_FarWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_int_2;
-static int64 __pyx_k__3;
-static float __pyx_k__10;
-static float __pyx_k__11;
+static int64 __pyx_k__6;
static float __pyx_k__12;
-static int64 __pyx_k__13;
+static float __pyx_k__13;
static float __pyx_k__14;
static int64 __pyx_k__15;
static float __pyx_k__16;
-static float __pyx_k__17;
-static int64 __pyx_k__18;
+static int64 __pyx_k__17;
+static float __pyx_k__18;
static float __pyx_k__19;
static int64 __pyx_k__20;
static float __pyx_k__21;
-static float __pyx_k__30;
-static float __pyx_k__31;
+static int64 __pyx_k__22;
+static float __pyx_k__23;
static float __pyx_k__32;
-static int64 __pyx_k__33;
+static float __pyx_k__33;
static float __pyx_k__34;
static int64 __pyx_k__35;
static float __pyx_k__36;
-static float __pyx_k__37;
+static int64 __pyx_k__37;
static float __pyx_k__38;
static float __pyx_k__39;
-static int64 __pyx_k__40;
+static float __pyx_k__40;
static float __pyx_k__41;
-static float __pyx_k__42;
-static int32 __pyx_k__43;
-static int32 __pyx_k__44;
-static float __pyx_k__45;
-static int64 __pyx_k__46;
+static int64 __pyx_k__42;
+static float __pyx_k__43;
+static float __pyx_k__44;
+static int32 __pyx_k__45;
+static int32 __pyx_k__46;
static float __pyx_k__47;
static int64 __pyx_k__48;
static float __pyx_k__49;
static int64 __pyx_k__50;
-static std::string __pyx_k__51;
-static std::string __pyx_k__52;
-static PyObject *__pyx_tuple_;
-static PyObject *__pyx_tuple__2;
+static float __pyx_k__51;
+static int64 __pyx_k__52;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
-static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
+static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_tuple__22;
-static PyObject *__pyx_tuple__23;
+static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
+static PyObject *__pyx_tuple__30;
+static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
-static PyObject *__pyx_tuple__60;
-static PyObject *__pyx_tuple__62;
-static PyObject *__pyx_tuple__64;
-static PyObject *__pyx_tuple__66;
-static PyObject *__pyx_tuple__68;
-static PyObject *__pyx_tuple__70;
-static PyObject *__pyx_codeobj__61;
-static PyObject *__pyx_codeobj__63;
-static PyObject *__pyx_codeobj__65;
-static PyObject *__pyx_codeobj__67;
-static PyObject *__pyx_codeobj__69;
-static PyObject *__pyx_codeobj__71;
+static PyObject *__pyx_tuple__61;
+static PyObject *__pyx_tuple__63;
+static PyObject *__pyx_tuple__65;
+static PyObject *__pyx_tuple__67;
+static PyObject *__pyx_tuple__69;
+static PyObject *__pyx_codeobj__60;
+static PyObject *__pyx_codeobj__62;
+static PyObject *__pyx_codeobj__64;
+static PyObject *__pyx_codeobj__66;
+static PyObject *__pyx_codeobj__68;
+static PyObject *__pyx_codeobj__70;
/* Late includes */
-/* "pywrapfst.pyx":150
+/* "pywrapfst.pyx":174
*
*
* cdef string tostring(data) except *: # <<<<<<<<<<<<<<
int __pyx_t_2;
std::string __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
+ Py_ssize_t __pyx_t_5;
+ Py_UCS4 __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("tostring", 0);
- /* "pywrapfst.pyx":170
+ /* "pywrapfst.pyx":193
* """
- * # A Python bytestring can be implicitly cast to a C++ string.
- * if isinstance(data, bytes): # <<<<<<<<<<<<<<
+ * # A Python string can be implicitly cast to a C++ string.
+ * if isinstance(data, str): # <<<<<<<<<<<<<<
* return data
- * elif isinstance(data, unicode):
+ * raise TypeError(f"Expected {str.__name__} but received "
*/
- __pyx_t_1 = PyBytes_Check(__pyx_v_data);
+ __pyx_t_1 = PyUnicode_Check(__pyx_v_data);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":171
- * # A Python bytestring can be implicitly cast to a C++ string.
- * if isinstance(data, bytes):
+ /* "pywrapfst.pyx":194
+ * # A Python string can be implicitly cast to a C++ string.
+ * if isinstance(data, str):
* return data # <<<<<<<<<<<<<<
- * elif isinstance(data, unicode):
- * return data.encode("utf8")
+ * 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, 171, __pyx_L1_error)
+ __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_r = __pyx_t_3;
goto __pyx_L0;
- /* "pywrapfst.pyx":170
+ /* "pywrapfst.pyx":193
* """
- * # A Python bytestring can be implicitly cast to a C++ string.
- * if isinstance(data, bytes): # <<<<<<<<<<<<<<
+ * # A Python string can be implicitly cast to a C++ string.
+ * if isinstance(data, str): # <<<<<<<<<<<<<<
* return data
- * elif isinstance(data, unicode):
+ * raise TypeError(f"Expected {str.__name__} but received "
*/
}
- /* "pywrapfst.pyx":172
- * if isinstance(data, bytes):
+ /* "pywrapfst.pyx":195
+ * if isinstance(data, str):
* return data
- * elif isinstance(data, unicode): # <<<<<<<<<<<<<<
- * return data.encode("utf8")
- * raise FstArgError("Cannot encode as string: {!r}".format(data))
+ * raise TypeError(f"Expected {str.__name__} but received " # <<<<<<<<<<<<<<
+ * f"{type(data).__name__}: {data!r}")
+ *
*/
- __pyx_t_2 = PyUnicode_Check(__pyx_v_data);
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "pywrapfst.pyx":173
+ __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = 0;
+ __pyx_t_6 = 127;
+ __Pyx_INCREF(__pyx_kp_u_Expected);
+ __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_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_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_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
+ __pyx_t_8 = 0;
+ __Pyx_INCREF(__pyx_kp_u_but_received);
+ __pyx_t_5 += 14;
+ __Pyx_GIVEREF(__pyx_kp_u_but_received);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_but_received);
+
+ /* "pywrapfst.pyx":196
* return data
- * elif isinstance(data, unicode):
- * return data.encode("utf8") # <<<<<<<<<<<<<<
- * raise FstArgError("Cannot encode as string: {!r}".format(data))
+ * raise TypeError(f"Expected {str.__name__} but received "
+ * f"{type(data).__name__}: {data!r}") # <<<<<<<<<<<<<<
+ *
*
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(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_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_utf8);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_r = __pyx_t_3;
- goto __pyx_L0;
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __Pyx_INCREF(__pyx_kp_u_);
+ __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_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);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_7);
+ __pyx_t_7 = 0;
- /* "pywrapfst.pyx":172
- * if isinstance(data, bytes):
+ /* "pywrapfst.pyx":195
+ * if isinstance(data, str):
* return data
- * elif isinstance(data, unicode): # <<<<<<<<<<<<<<
- * return data.encode("utf8")
- * raise FstArgError("Cannot encode as string: {!r}".format(data))
- */
- }
-
- /* "pywrapfst.pyx":174
- * elif isinstance(data, unicode):
- * return data.encode("utf8")
- * raise FstArgError("Cannot encode as string: {!r}".format(data)) # <<<<<<<<<<<<<<
- *
+ * raise TypeError(f"Expected {str.__name__} but received " # <<<<<<<<<<<<<<
+ * f"{type(data).__name__}: {data!r}")
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Cannot_encode_as_string_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 174, __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, 195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
- }
- }
- __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data);
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- }
- }
- __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, 174, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __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, 174, __pyx_L1_error)
+ __PYX_ERR(0, 195, __pyx_L1_error)
- /* "pywrapfst.pyx":150
+ /* "pywrapfst.pyx":174
*
*
* cdef string tostring(data) except *: # <<<<<<<<<<<<<<
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("pywrapfst.tostring", __pyx_clineno, __pyx_lineno, __pyx_filename);
return __pyx_r;
}
-/* "pywrapfst.pyx":177
+/* "pywrapfst.pyx":199
*
*
* cdef string weight_tostring(data) except *: # <<<<<<<<<<<<<<
std::string __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_6;
+ Py_UCS4 __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("weight_tostring", 0);
- /* "pywrapfst.pyx":201
+ /* "pywrapfst.pyx":221
* """
- * # A Python bytestring can be implicitly cast to a C++ string.
- * if isinstance(data, bytes): # <<<<<<<<<<<<<<
+ * # A Python string can be implicitly cast to a C++ string.
+ * if isinstance(data, str): # <<<<<<<<<<<<<<
* return data
- * elif isinstance(data, unicode):
+ * elif isinstance(data, numbers.Number):
*/
- __pyx_t_1 = PyBytes_Check(__pyx_v_data);
+ __pyx_t_1 = PyUnicode_Check(__pyx_v_data);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":202
- * # A Python bytestring can be implicitly cast to a C++ string.
- * if isinstance(data, bytes):
+ /* "pywrapfst.pyx":222
+ * # A Python string can be implicitly cast to a C++ string.
+ * if isinstance(data, str):
* return data # <<<<<<<<<<<<<<
- * elif isinstance(data, unicode):
- * return data.encode("utf8")
+ * 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, 202, __pyx_L1_error)
+ __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_r = __pyx_t_3;
goto __pyx_L0;
- /* "pywrapfst.pyx":201
+ /* "pywrapfst.pyx":221
* """
- * # A Python bytestring can be implicitly cast to a C++ string.
- * if isinstance(data, bytes): # <<<<<<<<<<<<<<
+ * # A Python string can be implicitly cast to a C++ string.
+ * if isinstance(data, str): # <<<<<<<<<<<<<<
* return data
- * elif isinstance(data, unicode):
+ * elif isinstance(data, numbers.Number):
*/
}
- /* "pywrapfst.pyx":203
- * if isinstance(data, bytes):
+ /* "pywrapfst.pyx":223
+ * if isinstance(data, str):
* return data
- * elif isinstance(data, unicode): # <<<<<<<<<<<<<<
- * return data.encode("utf8")
- * elif isinstance(data, numbers.Number):
+ * elif isinstance(data, numbers.Number): # <<<<<<<<<<<<<<
+ * return str(data)
+ * raise TypeError(f"Expected {str.__name__} but received "
*/
- __pyx_t_2 = PyUnicode_Check(__pyx_v_data);
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numbers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":204
+ /* "pywrapfst.pyx":224
* return data
- * elif isinstance(data, unicode):
- * return data.encode("utf8") # <<<<<<<<<<<<<<
* elif isinstance(data, numbers.Number):
- * return str(data).encode("utf8")
+ * return str(data) # <<<<<<<<<<<<<<
+ * raise TypeError(f"Expected {str.__name__} but received "
+ * f"{type(data).__name__}: {data!r}")
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_5);
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(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_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_utf8);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
+ __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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
goto __pyx_L0;
- /* "pywrapfst.pyx":203
- * if isinstance(data, bytes):
+ /* "pywrapfst.pyx":223
+ * if isinstance(data, str):
* return data
- * elif isinstance(data, unicode): # <<<<<<<<<<<<<<
- * return data.encode("utf8")
- * elif isinstance(data, numbers.Number):
+ * elif isinstance(data, numbers.Number): # <<<<<<<<<<<<<<
+ * return str(data)
+ * raise TypeError(f"Expected {str.__name__} but received "
*/
}
- /* "pywrapfst.pyx":205
- * elif isinstance(data, unicode):
- * return data.encode("utf8")
- * elif isinstance(data, numbers.Number): # <<<<<<<<<<<<<<
- * return str(data).encode("utf8")
- * raise FstArgError("Cannot encode as string: {!r}".format(data))
+ /* "pywrapfst.pyx":225
+ * 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_GOTREF(__pyx_t_5);
+ __pyx_t_6 = 0;
+ __pyx_t_7 = 127;
+ __Pyx_INCREF(__pyx_kp_u_Expected);
+ __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_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_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_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
+ __pyx_t_8 = 0;
+ __Pyx_INCREF(__pyx_kp_u_but_received);
+ __pyx_t_6 += 14;
+ __Pyx_GIVEREF(__pyx_kp_u_but_received);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_but_received);
+
+ /* "pywrapfst.pyx":226
+ * 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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __Pyx_INCREF(__pyx_kp_u_);
+ __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_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);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "pywrapfst.pyx":225
+ * elif isinstance(data, numbers.Number):
+ * return str(data)
+ * raise TypeError(f"Expected {str.__name__} but received " # <<<<<<<<<<<<<<
+ * f"{type(data).__name__}: {data!r}")
+ *
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numbers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __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, 225, __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, 205, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_1 = PyObject_IsInstance(__pyx_v_data, __pyx_t_5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 205, __pyx_L1_error)
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
+ __PYX_ERR(0, 225, __pyx_L1_error)
- /* "pywrapfst.pyx":206
- * return data.encode("utf8")
- * elif isinstance(data, numbers.Number):
- * return str(data).encode("utf8") # <<<<<<<<<<<<<<
- * raise FstArgError("Cannot encode as string: {!r}".format(data))
+ /* "pywrapfst.pyx":199
+ *
+ *
+ * cdef string weight_tostring(data) except *: # <<<<<<<<<<<<<<
+ * """Converts strings or numerics to bytestrings.
*
*/
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_r = __pyx_t_3;
- goto __pyx_L0;
- /* "pywrapfst.pyx":205
- * elif isinstance(data, unicode):
- * return data.encode("utf8")
- * elif isinstance(data, numbers.Number): # <<<<<<<<<<<<<<
- * return str(data).encode("utf8")
- * raise FstArgError("Cannot encode as string: {!r}".format(data))
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("pywrapfst.weight_tostring", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_pretend_to_initialize(&__pyx_r);
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "pywrapfst.pyx":229
+ *
+ *
+ * cdef string path_tostring(data) except *: # <<<<<<<<<<<<<<
+ * return tostring(os.fspath(data))
+ *
*/
- }
- /* "pywrapfst.pyx":207
- * elif isinstance(data, numbers.Number):
- * return str(data).encode("utf8")
- * raise FstArgError("Cannot encode as string: {!r}".format(data)) # <<<<<<<<<<<<<<
+static std::string __pyx_f_9pywrapfst_path_tostring(PyObject *__pyx_v_data) {
+ std::string __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ std::string __pyx_t_4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("path_tostring", 0);
+
+ /* "pywrapfst.pyx":230
+ *
+ * cdef string path_tostring(data) except *:
+ * return tostring(os.fspath(data)) # <<<<<<<<<<<<<<
*
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Cannot_encode_as_string_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
- }
- }
- __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data);
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_7);
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __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_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
}
}
- __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, 207, __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, 207, __pyx_L1_error)
+ __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)
+ __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_4;
+ goto __pyx_L0;
- /* "pywrapfst.pyx":177
+ /* "pywrapfst.pyx":229
*
*
- * cdef string weight_tostring(data) except *: # <<<<<<<<<<<<<<
- * """Converts strings or numerics to bytestrings.
+ * cdef string path_tostring(data) except *: # <<<<<<<<<<<<<<
+ * return tostring(os.fspath(data))
*
*/
/* function exit code */
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("pywrapfst.weight_tostring", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("pywrapfst.path_tostring", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_pretend_to_initialize(&__pyx_r);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":210
+/* "pywrapfst.pyx":233
*
*
- * cdef fst.ComposeFilter _get_compose_filter( # <<<<<<<<<<<<<<
- * const string &compose_filter) except *:
- * """Matches string with the appropriate ComposeFilter enum value.
+ * cdef fst.FarType _get_far_type(const string &far_type) except *: # <<<<<<<<<<<<<<
+ * """Matches string with the appropriate FarType enum value.
+ *
*/
-static enum fst::ComposeFilter __pyx_f_9pywrapfst__get_compose_filter(std::string const &__pyx_v_compose_filter) {
- enum fst::ComposeFilter __pyx_v_compose_filter_enum;
- enum fst::ComposeFilter __pyx_r;
+static fst::FarType __pyx_f_9pywrapfst__get_far_type(std::string const &__pyx_v_far_type) {
+ fst::FarType __pyx_v__far_type;
+ fst::FarType __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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;
- PyObject *__pyx_t_7 = NULL;
- __Pyx_RefNannySetupContext("_get_compose_filter", 0);
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_get_far_type", 0);
- /* "pywrapfst.pyx":232
+ /* "pywrapfst.pyx":249
* """
- * cdef fst.ComposeFilter compose_filter_enum
- * if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown compose filter type: {!r}".format(
- * compose_filter))
+ * 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_t_1 = ((!(fst::script::GetComposeFilter(__pyx_v_compose_filter, (&__pyx_v_compose_filter_enum)) != 0)) != 0);
+ __pyx_t_1 = ((!(fst::script::GetFarType(__pyx_v_far_type, (&__pyx_v__far_type)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":233
- * cdef fst.ComposeFilter compose_filter_enum
- * if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)):
- * raise FstArgError("Unknown compose filter type: {!r}".format( # <<<<<<<<<<<<<<
- * compose_filter))
- * return compose_filter_enum
+ /* "pywrapfst.pyx":250
+ * 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, 233, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_compose_filter_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __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, 250, __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_GOTREF(__pyx_t_5);
-
- /* "pywrapfst.pyx":234
- * if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)):
- * raise FstArgError("Unknown compose filter type: {!r}".format(
- * compose_filter)) # <<<<<<<<<<<<<<
- * return compose_filter_enum
- *
- */
- __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_compose_filter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- }
- }
- __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, 233, __pyx_L1_error)
+ __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_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, 233, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __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, 233, __pyx_L1_error)
+ __PYX_ERR(0, 250, __pyx_L1_error)
- /* "pywrapfst.pyx":232
+ /* "pywrapfst.pyx":249
* """
- * cdef fst.ComposeFilter compose_filter_enum
- * if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown compose filter type: {!r}".format(
- * compose_filter))
+ * 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
*/
}
- /* "pywrapfst.pyx":235
- * raise FstArgError("Unknown compose filter type: {!r}".format(
- * compose_filter))
- * return compose_filter_enum # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":251
+ * 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_compose_filter_enum;
+ __pyx_r = __pyx_v__far_type;
goto __pyx_L0;
- /* "pywrapfst.pyx":210
+ /* "pywrapfst.pyx":233
+ *
+ *
+ * cdef fst.FarType _get_far_type(const string &far_type) except *: # <<<<<<<<<<<<<<
+ * """Matches string with the appropriate FarType enum value.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("pywrapfst._get_far_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = (fst::FarType) 0;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "pywrapfst.pyx":254
+ *
+ *
+ * cdef fst.ComposeFilter _get_compose_filter( # <<<<<<<<<<<<<<
+ * const string &compose_filter) except *:
+ * """Matches string with the appropriate ComposeFilter enum value.
+ */
+
+static enum fst::ComposeFilter __pyx_f_9pywrapfst__get_compose_filter(std::string const &__pyx_v_compose_filter) {
+ enum fst::ComposeFilter __pyx_v__compose_filter;
+ enum fst::ComposeFilter __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_get_compose_filter", 0);
+
+ /* "pywrapfst.pyx":276
+ * """
+ * 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_t_1 = ((!(fst::script::GetComposeFilter(__pyx_v_compose_filter, (&__pyx_v__compose_filter)) != 0)) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "pywrapfst.pyx":277
+ * 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_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_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_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_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ __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)
+ __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)
+
+ /* "pywrapfst.pyx":276
+ * """
+ * 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
+ */
+ }
+
+ /* "pywrapfst.pyx":278
+ * 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
*
*
* cdef fst.ComposeFilter _get_compose_filter( # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst._get_compose_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = (enum fst::ComposeFilter) 0;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":238
+/* "pywrapfst.pyx":281
*
*
* cdef fst.DeterminizeType _get_determinize_type(const string &det_type) except *: # <<<<<<<<<<<<<<
*/
static enum fst::DeterminizeType __pyx_f_9pywrapfst__get_determinize_type(std::string const &__pyx_v_det_type) {
- enum fst::DeterminizeType __pyx_v_det_type_enum;
+ enum fst::DeterminizeType __pyx_v__det_type;
enum fst::DeterminizeType __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_determinize_type", 0);
- /* "pywrapfst.pyx":254
+ /* "pywrapfst.pyx":297
* """
- * cdef fst.DeterminizeType det_type_enum
- * if not fst.GetDeterminizeType(det_type, addr(det_type_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown determinization type: {!r}".format(det_type))
- * return det_type_enum
+ * 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_t_1 = ((!(fst::script::GetDeterminizeType(__pyx_v_det_type, (&__pyx_v_det_type_enum)) != 0)) != 0);
+ __pyx_t_1 = ((!(fst::script::GetDeterminizeType(__pyx_v_det_type, (&__pyx_v__det_type)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":255
- * cdef fst.DeterminizeType det_type_enum
- * if not fst.GetDeterminizeType(det_type, addr(det_type_enum)):
- * raise FstArgError("Unknown determinization type: {!r}".format(det_type)) # <<<<<<<<<<<<<<
- * return det_type_enum
+ /* "pywrapfst.pyx":298
+ * 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, 255, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_determinization_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __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, 298, __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_GOTREF(__pyx_t_5);
- __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_det_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- }
- }
- __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, 255, __pyx_L1_error)
+ __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_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, 255, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __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, 255, __pyx_L1_error)
+ __PYX_ERR(0, 298, __pyx_L1_error)
- /* "pywrapfst.pyx":254
+ /* "pywrapfst.pyx":297
* """
- * cdef fst.DeterminizeType det_type_enum
- * if not fst.GetDeterminizeType(det_type, addr(det_type_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown determinization type: {!r}".format(det_type))
- * return det_type_enum
+ * 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
*/
}
- /* "pywrapfst.pyx":256
- * if not fst.GetDeterminizeType(det_type, addr(det_type_enum)):
- * raise FstArgError("Unknown determinization type: {!r}".format(det_type))
- * return det_type_enum # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":299
+ * 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_enum;
+ __pyx_r = __pyx_v__det_type;
goto __pyx_L0;
- /* "pywrapfst.pyx":238
+ /* "pywrapfst.pyx":281
*
*
* cdef fst.DeterminizeType _get_determinize_type(const string &det_type) except *: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst._get_determinize_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = (enum fst::DeterminizeType) 0;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":259
+/* "pywrapfst.pyx":302
+ *
+ *
+ * cdef fst.ProjectType _get_project_type(const string &project_type) except *: # <<<<<<<<<<<<<<
+ * """Matches string with the appropriate ProjectType enum value.
+ *
+ */
+
+static fst::ProjectType __pyx_f_9pywrapfst__get_project_type(std::string const &__pyx_v_project_type) {
+ fst::ProjectType __pyx_v__project_type;
+ fst::ProjectType __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_get_project_type", 0);
+
+ /* "pywrapfst.pyx":318
+ * """
+ * 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_t_1 = ((!(fst::script::GetProjectType(__pyx_v_project_type, (&__pyx_v__project_type)) != 0)) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "pywrapfst.pyx":319
+ * 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_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_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_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_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ __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)
+ __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)
+
+ /* "pywrapfst.pyx":318
+ * """
+ * 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
+ */
+ }
+
+ /* "pywrapfst.pyx":320
+ * 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
+ *
+ *
+ * cdef fst.ProjectType _get_project_type(const string &project_type) except *: # <<<<<<<<<<<<<<
+ * """Matches string with the appropriate ProjectType enum value.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("pywrapfst._get_project_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = (fst::ProjectType) 0;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "pywrapfst.pyx":323
*
*
* cdef fst.QueueType _get_queue_type(const string &queue_type) except *: # <<<<<<<<<<<<<<
*/
static enum fst::QueueType __pyx_f_9pywrapfst__get_queue_type(std::string const &__pyx_v_queue_type) {
- enum fst::QueueType __pyx_v_queue_type_enum;
+ enum fst::QueueType __pyx_v__queue_type;
enum fst::QueueType __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_queue_type", 0);
- /* "pywrapfst.pyx":278
+ /* "pywrapfst.pyx":342
* """
- * cdef fst.QueueType queue_type_enum
- * if not fst.GetQueueType(queue_type, addr(queue_type_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown queue type: {!r}".format(queue_type))
- * return queue_type_enum
+ * 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_t_1 = ((!(fst::script::GetQueueType(__pyx_v_queue_type, (&__pyx_v_queue_type_enum)) != 0)) != 0);
+ __pyx_t_1 = ((!(fst::script::GetQueueType(__pyx_v_queue_type, (&__pyx_v__queue_type)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":279
- * cdef fst.QueueType queue_type_enum
- * if not fst.GetQueueType(queue_type, addr(queue_type_enum)):
- * raise FstArgError("Unknown queue type: {!r}".format(queue_type)) # <<<<<<<<<<<<<<
- * return queue_type_enum
+ /* "pywrapfst.pyx":343
+ * 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, 279, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_queue_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __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, 343, __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_GOTREF(__pyx_t_5);
- __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_queue_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- }
- }
- __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, 279, __pyx_L1_error)
+ __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_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, 279, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __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, 279, __pyx_L1_error)
+ __PYX_ERR(0, 343, __pyx_L1_error)
- /* "pywrapfst.pyx":278
+ /* "pywrapfst.pyx":342
* """
- * cdef fst.QueueType queue_type_enum
- * if not fst.GetQueueType(queue_type, addr(queue_type_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown queue type: {!r}".format(queue_type))
- * return queue_type_enum
+ * 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
*/
}
- /* "pywrapfst.pyx":280
- * if not fst.GetQueueType(queue_type, addr(queue_type_enum)):
- * raise FstArgError("Unknown queue type: {!r}".format(queue_type))
- * return queue_type_enum # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":344
+ * 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_enum;
+ __pyx_r = __pyx_v__queue_type;
goto __pyx_L0;
- /* "pywrapfst.pyx":259
+ /* "pywrapfst.pyx":323
*
*
* cdef fst.QueueType _get_queue_type(const string &queue_type) except *: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst._get_queue_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = (enum fst::QueueType) 0;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":283
+/* "pywrapfst.pyx":347
*
*
* cdef fst.RandArcSelection _get_rand_arc_selection( # <<<<<<<<<<<<<<
*/
static enum fst::script::RandArcSelection __pyx_f_9pywrapfst__get_rand_arc_selection(std::string const &__pyx_v_select) {
- enum fst::script::RandArcSelection __pyx_v_select_enum;
+ enum fst::script::RandArcSelection __pyx_v__select;
enum fst::script::RandArcSelection __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_rand_arc_selection", 0);
- /* "pywrapfst.pyx":303
+ /* "pywrapfst.pyx":367
* """
- * cdef fst.RandArcSelection select_enum
- * if not fst.GetRandArcSelection(select, addr(select_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown random arc selection type: {!r}".format(select))
- * return select_enum
+ * cdef fst.RandArcSelection _select
+ * if not fst.GetRandArcSelection(select, addr(_select)): # <<<<<<<<<<<<<<
+ * raise FstArgError(f"Unknown random arc selection type: {select!r}")
+ * return _select
*/
- __pyx_t_1 = ((!(fst::script::GetRandArcSelection(__pyx_v_select, (&__pyx_v_select_enum)) != 0)) != 0);
+ __pyx_t_1 = ((!(fst::script::GetRandArcSelection(__pyx_v_select, (&__pyx_v__select)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":304
- * cdef fst.RandArcSelection select_enum
- * if not fst.GetRandArcSelection(select, addr(select_enum)):
- * raise FstArgError("Unknown random arc selection type: {!r}".format(select)) # <<<<<<<<<<<<<<
- * return select_enum
+ /* "pywrapfst.pyx":368
+ * 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, 304, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_random_arc_selection_typ, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __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, 368, __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_GOTREF(__pyx_t_5);
- __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_select); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- }
- }
- __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, 304, __pyx_L1_error)
+ __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_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, 304, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __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, 304, __pyx_L1_error)
+ __PYX_ERR(0, 368, __pyx_L1_error)
- /* "pywrapfst.pyx":303
+ /* "pywrapfst.pyx":367
* """
- * cdef fst.RandArcSelection select_enum
- * if not fst.GetRandArcSelection(select, addr(select_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown random arc selection type: {!r}".format(select))
- * return select_enum
+ * cdef fst.RandArcSelection _select
+ * if not fst.GetRandArcSelection(select, addr(_select)): # <<<<<<<<<<<<<<
+ * raise FstArgError(f"Unknown random arc selection type: {select!r}")
+ * return _select
*/
}
- /* "pywrapfst.pyx":305
- * if not fst.GetRandArcSelection(select, addr(select_enum)):
- * raise FstArgError("Unknown random arc selection type: {!r}".format(select))
- * return select_enum # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":369
+ * if not fst.GetRandArcSelection(select, addr(_select)):
+ * raise FstArgError(f"Unknown random arc selection type: {select!r}")
+ * return _select # <<<<<<<<<<<<<<
*
*
*/
- __pyx_r = __pyx_v_select_enum;
+ __pyx_r = __pyx_v__select;
goto __pyx_L0;
- /* "pywrapfst.pyx":283
+ /* "pywrapfst.pyx":347
*
*
* cdef fst.RandArcSelection _get_rand_arc_selection( # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst._get_rand_arc_selection", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = (enum fst::script::RandArcSelection) 0;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":308
+/* "pywrapfst.pyx":372
*
*
* cdef fst.ReplaceLabelType _get_replace_label_type( # <<<<<<<<<<<<<<
*/
static enum fst::ReplaceLabelType __pyx_f_9pywrapfst__get_replace_label_type(std::string const &__pyx_v_replace_label_type, bool __pyx_v_epsilon_on_replace) {
- enum fst::ReplaceLabelType __pyx_v_replace_label_type_enum;
+ enum fst::ReplaceLabelType __pyx_v__replace_label_type;
enum fst::ReplaceLabelType __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_replace_label_type", 0);
- /* "pywrapfst.pyx":329
+ /* "pywrapfst.pyx":393
* """
- * cdef fst.ReplaceLabelType replace_label_type_enum
- * if not fst.GetReplaceLabelType(replace_label_type, epsilon_on_replace, # <<<<<<<<<<<<<<
- * addr(replace_label_type_enum)):
- * raise FstArgError("Unknown replace label type: {!r}".format(
+ * cdef fst.ReplaceLabelType _replace_label_type
+ * if not fst.GetReplaceLabelType(replace_label_type, # <<<<<<<<<<<<<<
+ * epsilon_on_replace,
+ * addr(_replace_label_type)):
*/
- __pyx_t_1 = ((!(fst::script::GetReplaceLabelType(__pyx_v_replace_label_type, __pyx_v_epsilon_on_replace, (&__pyx_v_replace_label_type_enum)) != 0)) != 0);
+ __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":331
- * if not fst.GetReplaceLabelType(replace_label_type, epsilon_on_replace,
- * addr(replace_label_type_enum)):
- * raise FstArgError("Unknown replace label type: {!r}".format( # <<<<<<<<<<<<<<
- * replace_label_type))
- * return replace_label_type_enum
+ /* "pywrapfst.pyx":396
+ * 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, 331, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_replace_label_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __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, 396, __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_GOTREF(__pyx_t_5);
-
- /* "pywrapfst.pyx":332
- * addr(replace_label_type_enum)):
- * raise FstArgError("Unknown replace label type: {!r}".format(
- * replace_label_type)) # <<<<<<<<<<<<<<
- * return replace_label_type_enum
- *
- */
- __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_replace_label_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- }
- }
- __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, 331, __pyx_L1_error)
+ __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_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, 331, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __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, 331, __pyx_L1_error)
+ __PYX_ERR(0, 396, __pyx_L1_error)
- /* "pywrapfst.pyx":329
+ /* "pywrapfst.pyx":393
* """
- * cdef fst.ReplaceLabelType replace_label_type_enum
- * if not fst.GetReplaceLabelType(replace_label_type, epsilon_on_replace, # <<<<<<<<<<<<<<
- * addr(replace_label_type_enum)):
- * raise FstArgError("Unknown replace label type: {!r}".format(
+ * cdef fst.ReplaceLabelType _replace_label_type
+ * if not fst.GetReplaceLabelType(replace_label_type, # <<<<<<<<<<<<<<
+ * epsilon_on_replace,
+ * addr(_replace_label_type)):
*/
}
- /* "pywrapfst.pyx":333
- * raise FstArgError("Unknown replace label type: {!r}".format(
- * replace_label_type))
- * return replace_label_type_enum # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":397
+ * 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_enum;
+ __pyx_r = __pyx_v__replace_label_type;
goto __pyx_L0;
- /* "pywrapfst.pyx":308
+ /* "pywrapfst.pyx":372
*
*
* cdef fst.ReplaceLabelType _get_replace_label_type( # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst._get_replace_label_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = (enum fst::ReplaceLabelType) 0;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":359
+/* "pywrapfst.pyx":423
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<{} Weight {} at 0x{:x}>".format(self.type(), self.to_string(),
- * id(self))
+ * return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
+ *
*/
/* Python wrapper */
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":360
+ /* "pywrapfst.pyx":424
*
* def __repr__(self):
- * return "<{} Weight {} at 0x{:x}>".format(self.type(), self.to_string(), # <<<<<<<<<<<<<<
- * id(self))
+ * return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>" # <<<<<<<<<<<<<<
*
+ * def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Weight_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u__2);
+ __pyx_t_2 += 1;
+ __Pyx_GIVEREF(__pyx_kp_u__2);
+ 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, 360, __pyx_L1_error)
+ __PYX_ERR(0, 424, __pyx_L1_error)
}
- __pyx_t_3 = __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_3)) __PYX_ERR(0, 360, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
+ __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_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_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __Pyx_INCREF(__pyx_kp_u_Weight);
+ __pyx_t_2 += 8;
+ __Pyx_GIVEREF(__pyx_kp_u_Weight);
+ 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, 360, __pyx_L1_error)
+ __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, 360, __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_GOTREF(__pyx_t_4);
-
- /* "pywrapfst.pyx":361
- * def __repr__(self):
- * return "<{} Weight {} at 0x{:x}>".format(self.type(), self.to_string(),
- * id(self)) # <<<<<<<<<<<<<<
- *
- * def __str__(self):
- */
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __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_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __Pyx_INCREF(__pyx_kp_u_at_0x);
+ __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_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_GOTREF(__pyx_t_5);
- __pyx_t_6 = NULL;
- __pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- __pyx_t_7 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 360, __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_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
+ __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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__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_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":359
+ /* "pywrapfst.pyx":423
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<{} Weight {} at 0x{:x}>".format(self.type(), self.to_string(),
- * id(self))
+ * return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
+ *
*/
/* 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_AddTraceback("pywrapfst.Weight.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":363
- * id(self))
+/* "pywrapfst.pyx":426
+ * return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
*
* def __str__(self): # <<<<<<<<<<<<<<
* return self.to_string()
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("__str__", 0);
- /* "pywrapfst.pyx":364
+ /* "pywrapfst.pyx":427
*
* 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, 364, __pyx_L1_error)
+ __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, 364, __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":363
- * id(self))
+ /* "pywrapfst.pyx":426
+ * return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
*
* def __str__(self): # <<<<<<<<<<<<<<
* return self.to_string()
return __pyx_r;
}
-/* "pywrapfst.pyx":369
+/* "pywrapfst.pyx":432
* # ValueError when that is not appropriate.
*
* def __float__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__float__", 0);
- /* "pywrapfst.pyx":370
+ /* "pywrapfst.pyx":433
*
* 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, 370, __pyx_L1_error)
+ __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, 370, __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_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __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":369
+ /* "pywrapfst.pyx":432
* # ValueError when that is not appropriate.
*
* def __float__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":372
+/* "pywrapfst.pyx":435
* return float(self.to_string())
*
* def __init__(self, weight_type, weight): # <<<<<<<<<<<<<<
static int __pyx_pw_9pywrapfst_6Weight_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_weight_type = 0;
PyObject *__pyx_v_weight = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
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, 372, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 435, __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, 372, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 435, __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, 372, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 435, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Weight.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
std::string __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":373
+ /* "pywrapfst.pyx":436
*
* 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, 373, __pyx_L1_error)
+ __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, 373, __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)
- /* "pywrapfst.pyx":374
+ /* "pywrapfst.pyx":437
* 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, 374, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error)
- /* "pywrapfst.pyx":373
+ /* "pywrapfst.pyx":436
*
* 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":375
+ /* "pywrapfst.pyx":438
* 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, 375, __pyx_L1_error)
+ __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, 375, __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)
- /* "pywrapfst.pyx":372
+ /* "pywrapfst.pyx":435
* return float(self.to_string())
*
* def __init__(self, weight_type, weight): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":377
+/* "pywrapfst.pyx":440
* self._check_weight()
*
* cdef void _check_weight(self) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_check_weight", 0);
- /* "pywrapfst.pyx":378
+ /* "pywrapfst.pyx":441
*
* 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, 378, __pyx_L1_error)
+ __PYX_ERR(0, 441, __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":379
+ /* "pywrapfst.pyx":442
* 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, 379, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __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, 379, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 379, __pyx_L1_error)
+ __PYX_ERR(0, 442, __pyx_L1_error)
- /* "pywrapfst.pyx":378
+ /* "pywrapfst.pyx":441
*
* cdef void _check_weight(self) except *:
* if self.type() == b"none": # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":380
+ /* "pywrapfst.pyx":443
* 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, 380, __pyx_L1_error)
+ __PYX_ERR(0, 443, __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":381
+ /* "pywrapfst.pyx":444
* 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, 381, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __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, 381, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __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, 381, __pyx_L1_error)
+ __PYX_ERR(0, 444, __pyx_L1_error)
- /* "pywrapfst.pyx":380
+ /* "pywrapfst.pyx":443
* if self.type() == b"none":
* raise FstArgError("Weight type not found")
* if not self.member(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":377
+ /* "pywrapfst.pyx":440
* self._check_weight()
*
* cdef void _check_weight(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":383
+/* "pywrapfst.pyx":446
* raise FstBadWeightError("Invalid weight")
*
* cpdef Weight copy(self): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_6Weight_9copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_6Weight_copy(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Weight *__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;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 383, __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, 446, __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, 383, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __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, 383, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 446, __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":389
+ /* "pywrapfst.pyx":452
* Returns a copy of the Weight.
* """
- * cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
- * result._weight.reset(new fst.WeightClass(deref(self._weight)))
- * return result
+ * 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, 389, __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, 452, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":390
+ /* "pywrapfst.pyx":453
* """
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(deref(self._weight))) # <<<<<<<<<<<<<<
- * return result
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(deref(self._weight))) # <<<<<<<<<<<<<<
+ * return _weight
*
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 390, __pyx_L1_error)
+ __PYX_ERR(0, 453, __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, 390, __pyx_L1_error)
+ __PYX_ERR(0, 453, __pyx_L1_error)
}
- __pyx_v_result->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_weight)));
+ __pyx_v__weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_weight)));
- /* "pywrapfst.pyx":391
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(deref(self._weight)))
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":454
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(deref(self._weight)))
+ * return _weight # <<<<<<<<<<<<<<
*
* # To get around the inability to declare cdef class methods, we define the
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":383
+ /* "pywrapfst.pyx":446
* raise FstBadWeightError("Invalid weight")
*
* cpdef Weight copy(self): # <<<<<<<<<<<<<<
__Pyx_AddTraceback("pywrapfst.Weight.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
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("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, 383, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":397
+/* "pywrapfst.pyx":460
*
* @classmethod
* def Zero(cls, 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);
- /* "pywrapfst.pyx":403
+ /* "pywrapfst.pyx":466
* Constructs semiring zero.
* """
* 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, 403, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":397
+ /* "pywrapfst.pyx":460
*
* @classmethod
* def Zero(cls, weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":406
+/* "pywrapfst.pyx":469
*
* @classmethod
* def One(cls, 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);
- /* "pywrapfst.pyx":412
+ /* "pywrapfst.pyx":475
* Constructs semiring One.
* """
* 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, 412, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":406
+ /* "pywrapfst.pyx":469
*
* @classmethod
* def One(cls, weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":415
+/* "pywrapfst.pyx":478
*
* @classmethod
* def NoWeight(cls, 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);
- /* "pywrapfst.pyx":421
+ /* "pywrapfst.pyx":484
* Constructs a non-member weight in the semiring.
* """
* return _NoWeight(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, 421, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":415
+ /* "pywrapfst.pyx":478
*
* @classmethod
* def NoWeight(cls, weight_type): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":423
+/* "pywrapfst.pyx":486
* return _NoWeight(weight_type)
*
* def __eq__(Weight w1, Weight w2): # <<<<<<<<<<<<<<
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_17__eq__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_17__eq__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
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, 423, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_ptype_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 486, __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 */
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("__eq__", 0);
- /* "pywrapfst.pyx":424
+ /* "pywrapfst.pyx":487
*
* 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, 424, __pyx_L1_error)
+ __PYX_ERR(0, 487, __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, 424, __pyx_L1_error)
+ __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, 424, __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":423
+ /* "pywrapfst.pyx":486
* return _NoWeight(weight_type)
*
* def __eq__(Weight w1, Weight w2): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":426
+/* "pywrapfst.pyx":489
* return fst.Eq(deref(w1._weight), deref(w2._weight))
*
* def __ne__(Weight w1, Weight w2): # <<<<<<<<<<<<<<
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_19__ne__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_19__ne__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
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, 426, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_ptype_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 489, __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 */
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__ne__", 0);
- /* "pywrapfst.pyx":427
+ /* "pywrapfst.pyx":490
*
* 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, 427, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 427, __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, 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_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, 427, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __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":489
* return fst.Eq(deref(w1._weight), deref(w2._weight))
*
* def __ne__(Weight w1, Weight w2): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":429
+/* "pywrapfst.pyx":492
* return not w1 == w2
*
* cpdef string to_string(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("to_string", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 429, __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, 492, __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, 429, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __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, 429, __pyx_L1_error)
+ __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_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":430
+ /* "pywrapfst.pyx":493
*
* 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, 430, __pyx_L1_error)
+ __PYX_ERR(0, 493, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_weight.get()->ToString();
goto __pyx_L0;
- /* "pywrapfst.pyx":429
+ /* "pywrapfst.pyx":492
* return not w1 == w2
*
* cpdef string to_string(self): # <<<<<<<<<<<<<<
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("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, 429, __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, 492, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":432
+/* "pywrapfst.pyx":495
* return self._weight.get().ToString()
*
* cpdef string type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("type", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 432, __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, 495, __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, 432, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 432, __pyx_L1_error)
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 495, __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":437
+ /* "pywrapfst.pyx":500
* 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, 437, __pyx_L1_error)
+ __PYX_ERR(0, 500, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_weight.get()->Type();
goto __pyx_L0;
- /* "pywrapfst.pyx":432
+ /* "pywrapfst.pyx":495
* return self._weight.get().ToString()
*
* cpdef string type(self): # <<<<<<<<<<<<<<
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("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, 432, __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, 495, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":439
+/* "pywrapfst.pyx":502
* return self._weight.get().Type()
*
* cpdef bool member(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
bool __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("member", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 439, __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, 502, __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, 439, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __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, 439, __pyx_L1_error)
+ __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_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":440
+ /* "pywrapfst.pyx":503
*
* 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, 440, __pyx_L1_error)
+ __PYX_ERR(0, 503, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_weight.get()->Member();
goto __pyx_L0;
- /* "pywrapfst.pyx":439
+ /* "pywrapfst.pyx":502
* return self._weight.get().Type()
*
* cpdef bool member(self): # <<<<<<<<<<<<<<
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("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, 439, __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, 502, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
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("__reduce_cython__", 0);
/* "(tree fragment)":2
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._weight cannot be converted to a Python object for pickling")
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
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("__setstate_cython__", 0);
/* "(tree fragment)":4
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._weight cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":443
+/* "pywrapfst.pyx":506
*
*
* cdef Weight _plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__plus(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Weight *__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("_plus", 0);
- /* "pywrapfst.pyx":444
+ /* "pywrapfst.pyx":507
*
* cdef Weight _plus(Weight lhs, Weight rhs):
- * cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
- * result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
- * deref(rhs._weight))))
+ * 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, 444, __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, 507, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":445
+ /* "pywrapfst.pyx":508
* cdef Weight _plus(Weight lhs, Weight rhs):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight), # <<<<<<<<<<<<<<
- * deref(rhs._weight))))
- * return result
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight), # <<<<<<<<<<<<<<
+ * deref(rhs._weight))))
+ * return _weight
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 445, __pyx_L1_error)
+ __PYX_ERR(0, 508, __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, 445, __pyx_L1_error)
+ __PYX_ERR(0, 508, __pyx_L1_error)
}
- /* "pywrapfst.pyx":446
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
- * deref(rhs._weight)))) # <<<<<<<<<<<<<<
- * return result
+ /* "pywrapfst.pyx":509
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
+ * deref(rhs._weight)))) # <<<<<<<<<<<<<<
+ * return _weight
*
*/
if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 446, __pyx_L1_error)
+ __PYX_ERR(0, 509, __pyx_L1_error)
}
- /* "pywrapfst.pyx":445
+ /* "pywrapfst.pyx":508
* cdef Weight _plus(Weight lhs, Weight rhs):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight), # <<<<<<<<<<<<<<
- * deref(rhs._weight))))
- * return result
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight), # <<<<<<<<<<<<<<
+ * deref(rhs._weight))))
+ * return _weight
*/
- __pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::Plus((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));
+ __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::Plus((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));
- /* "pywrapfst.pyx":447
- * result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
- * deref(rhs._weight))))
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":510
+ * _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
+ * deref(rhs._weight))))
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":443
+ /* "pywrapfst.pyx":506
*
*
* cdef Weight _plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst._plus", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":450
+/* "pywrapfst.pyx":513
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_1plus(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs = 0;
struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("plus (wrapper)", 0);
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, 450, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, 1); __PYX_ERR(0, 513, __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, 450, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "plus") < 0)) __PYX_ERR(0, 513, __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, 450, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 513, __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, 450, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 450, __pyx_L1_error)
+ 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)
__pyx_r = __pyx_pf_9pywrapfst_plus(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
/* function exit code */
}
static PyObject *__pyx_pf_9pywrapfst_plus(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
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("plus", 0);
- /* "pywrapfst.pyx":470
+ /* "pywrapfst.pyx":533
* FstBadWeightError: invalid weight.
* """
- * cdef Weight result = _plus(lhs, rhs) # <<<<<<<<<<<<<<
- * result._check_weight()
- * return result
+ * 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, 470, __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, 533, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":471
+ /* "pywrapfst.pyx":534
* """
- * cdef Weight result = _plus(lhs, rhs)
- * result._check_weight() # <<<<<<<<<<<<<<
- * return result
+ * cdef Weight _weight = _plus(lhs, rhs)
+ * _weight._check_weight() # <<<<<<<<<<<<<<
+ * return _weight
*
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
- __PYX_ERR(0, 471, __pyx_L1_error)
+ __PYX_ERR(0, 534, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_result->__pyx_vtab)->_check_weight(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L1_error)
+ ((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)
- /* "pywrapfst.pyx":472
- * cdef Weight result = _plus(lhs, rhs)
- * result._check_weight()
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":535
+ * cdef Weight _weight = _plus(lhs, rhs)
+ * _weight._check_weight()
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = ((PyObject *)__pyx_v_result);
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = ((PyObject *)__pyx_v__weight);
goto __pyx_L0;
- /* "pywrapfst.pyx":450
+ /* "pywrapfst.pyx":513
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
__Pyx_AddTraceback("pywrapfst.plus", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":475
+/* "pywrapfst.pyx":538
*
*
* cdef Weight _times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__times(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Weight *__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("_times", 0);
- /* "pywrapfst.pyx":476
+ /* "pywrapfst.pyx":539
*
* cdef Weight _times(Weight lhs, Weight rhs):
- * cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
- * result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
- * deref(rhs._weight))))
+ * 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, 476, __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, 539, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":477
+ /* "pywrapfst.pyx":540
* cdef Weight _times(Weight lhs, Weight rhs):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight), # <<<<<<<<<<<<<<
- * deref(rhs._weight))))
- * return result
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight), # <<<<<<<<<<<<<<
+ * deref(rhs._weight))))
+ * return _weight
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 477, __pyx_L1_error)
+ __PYX_ERR(0, 540, __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, 477, __pyx_L1_error)
+ __PYX_ERR(0, 540, __pyx_L1_error)
}
- /* "pywrapfst.pyx":478
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
- * deref(rhs._weight)))) # <<<<<<<<<<<<<<
- * return result
+ /* "pywrapfst.pyx":541
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
+ * deref(rhs._weight)))) # <<<<<<<<<<<<<<
+ * return _weight
*
*/
if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 478, __pyx_L1_error)
+ __PYX_ERR(0, 541, __pyx_L1_error)
}
- /* "pywrapfst.pyx":477
+ /* "pywrapfst.pyx":540
* cdef Weight _times(Weight lhs, Weight rhs):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight), # <<<<<<<<<<<<<<
- * deref(rhs._weight))))
- * return result
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight), # <<<<<<<<<<<<<<
+ * deref(rhs._weight))))
+ * return _weight
*/
- __pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::Times((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));
+ __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::Times((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));
- /* "pywrapfst.pyx":479
- * result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
- * deref(rhs._weight))))
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":542
+ * _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
+ * deref(rhs._weight))))
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":475
+ /* "pywrapfst.pyx":538
*
*
* cdef Weight _times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst._times", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":482
+/* "pywrapfst.pyx":545
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_3times(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs = 0;
struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("times (wrapper)", 0);
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, 482, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, 1); __PYX_ERR(0, 545, __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, 482, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "times") < 0)) __PYX_ERR(0, 545, __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, 482, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 545, __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, 482, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 482, __pyx_L1_error)
+ 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)
__pyx_r = __pyx_pf_9pywrapfst_2times(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
/* function exit code */
}
static PyObject *__pyx_pf_9pywrapfst_2times(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
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("times", 0);
- /* "pywrapfst.pyx":502
+ /* "pywrapfst.pyx":565
* FstBadWeightError: Invalid weight.
* """
- * cdef Weight result = _times(lhs, rhs) # <<<<<<<<<<<<<<
- * result._check_weight()
- * return result
+ * 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, 502, __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, 565, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":503
+ /* "pywrapfst.pyx":566
* """
- * cdef Weight result = _times(lhs, rhs)
- * result._check_weight() # <<<<<<<<<<<<<<
- * return result
+ * cdef Weight _weight = _times(lhs, rhs)
+ * _weight._check_weight() # <<<<<<<<<<<<<<
+ * return _weight
*
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
- __PYX_ERR(0, 503, __pyx_L1_error)
+ __PYX_ERR(0, 566, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_result->__pyx_vtab)->_check_weight(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L1_error)
+ ((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)
- /* "pywrapfst.pyx":504
- * cdef Weight result = _times(lhs, rhs)
- * result._check_weight()
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":567
+ * cdef Weight _weight = _times(lhs, rhs)
+ * _weight._check_weight()
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = ((PyObject *)__pyx_v_result);
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = ((PyObject *)__pyx_v__weight);
goto __pyx_L0;
- /* "pywrapfst.pyx":482
+ /* "pywrapfst.pyx":545
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
__Pyx_AddTraceback("pywrapfst.times", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":507
+/* "pywrapfst.pyx":570
*
*
* cdef Weight _divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__divide(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Weight *__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("_divide", 0);
- /* "pywrapfst.pyx":508
+ /* "pywrapfst.pyx":571
*
* cdef Weight _divide(Weight lhs, Weight rhs):
- * cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
- * result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
- * deref(rhs._weight))))
+ * 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, 508, __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, 571, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":509
+ /* "pywrapfst.pyx":572
* cdef Weight _divide(Weight lhs, Weight rhs):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight), # <<<<<<<<<<<<<<
- * deref(rhs._weight))))
- * return result
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight), # <<<<<<<<<<<<<<
+ * deref(rhs._weight))))
+ * return _weight
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 509, __pyx_L1_error)
+ __PYX_ERR(0, 572, __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, 509, __pyx_L1_error)
+ __PYX_ERR(0, 572, __pyx_L1_error)
}
- /* "pywrapfst.pyx":510
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
- * deref(rhs._weight)))) # <<<<<<<<<<<<<<
- * return result
+ /* "pywrapfst.pyx":573
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
+ * deref(rhs._weight)))) # <<<<<<<<<<<<<<
+ * return _weight
*
*/
if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 510, __pyx_L1_error)
+ __PYX_ERR(0, 573, __pyx_L1_error)
}
- /* "pywrapfst.pyx":509
+ /* "pywrapfst.pyx":572
* cdef Weight _divide(Weight lhs, Weight rhs):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight), # <<<<<<<<<<<<<<
- * deref(rhs._weight))))
- * return result
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight), # <<<<<<<<<<<<<<
+ * deref(rhs._weight))))
+ * return _weight
*/
- __pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::Divide((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));
+ __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::Divide((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));
- /* "pywrapfst.pyx":511
- * result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
- * deref(rhs._weight))))
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":574
+ * _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
+ * deref(rhs._weight))))
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":507
+ /* "pywrapfst.pyx":570
*
*
* cdef Weight _divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst._divide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":514
+/* "pywrapfst.pyx":577
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_5divide(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs = 0;
struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("divide (wrapper)", 0);
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, 514, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, 1); __PYX_ERR(0, 577, __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, 514, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "divide") < 0)) __PYX_ERR(0, 577, __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, 514, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 577, __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, 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)
+ 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)
__pyx_r = __pyx_pf_9pywrapfst_4divide(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
/* function exit code */
}
static PyObject *__pyx_pf_9pywrapfst_4divide(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
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("divide", 0);
- /* "pywrapfst.pyx":536
+ /* "pywrapfst.pyx":599
* FstBadWeightError: Invalid weight.
* """
- * cdef Weight result = _divide(lhs, rhs) # <<<<<<<<<<<<<<
- * result._check_weight()
- * return result
+ * 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, 536, __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, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":537
+ /* "pywrapfst.pyx":600
* """
- * cdef Weight result = _divide(lhs, rhs)
- * result._check_weight() # <<<<<<<<<<<<<<
- * return result
+ * cdef Weight _weight = _divide(lhs, rhs)
+ * _weight._check_weight() # <<<<<<<<<<<<<<
+ * return _weight
*
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
- __PYX_ERR(0, 537, __pyx_L1_error)
+ __PYX_ERR(0, 600, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_result->__pyx_vtab)->_check_weight(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 537, __pyx_L1_error)
+ ((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)
- /* "pywrapfst.pyx":538
- * cdef Weight result = _divide(lhs, rhs)
- * result._check_weight()
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":601
+ * cdef Weight _weight = _divide(lhs, rhs)
+ * _weight._check_weight()
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = ((PyObject *)__pyx_v_result);
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = ((PyObject *)__pyx_v__weight);
goto __pyx_L0;
- /* "pywrapfst.pyx":514
+ /* "pywrapfst.pyx":577
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
__Pyx_AddTraceback("pywrapfst.divide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":541
+/* "pywrapfst.pyx":604
*
*
* cdef Weight _power(Weight w, size_t n): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__power(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w, size_t __pyx_v_n) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Weight *__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("_power", 0);
- /* "pywrapfst.pyx":542
+ /* "pywrapfst.pyx":605
*
* cdef Weight _power(Weight w, size_t n):
- * cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
- * result._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
- * return result
+ * 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, 542, __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, 605, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":543
+ /* "pywrapfst.pyx":606
* cdef Weight _power(Weight w, size_t n):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n))) # <<<<<<<<<<<<<<
- * return result
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n))) # <<<<<<<<<<<<<<
+ * return _weight
*
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 543, __pyx_L1_error)
+ __PYX_ERR(0, 606, __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, 543, __pyx_L1_error)
+ __PYX_ERR(0, 606, __pyx_L1_error)
}
- __pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::Power((*__pyx_v_w->_weight), __pyx_v_n)));
+ __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::Power((*__pyx_v_w->_weight), __pyx_v_n)));
- /* "pywrapfst.pyx":544
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":607
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":541
+ /* "pywrapfst.pyx":604
*
*
* cdef Weight _power(Weight w, size_t n): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst._power", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":547
+/* "pywrapfst.pyx":610
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_7power(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w = 0;
size_t __pyx_v_n;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("power (wrapper)", 0);
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, 547, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, 1); __PYX_ERR(0, 610, __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, 547, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "power") < 0)) __PYX_ERR(0, 610, __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, 547, __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, 610, __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, 547, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 610, __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, 547, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_9pywrapfst_Weight, 1, "w", 0))) __PYX_ERR(0, 610, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_6power(__pyx_self, __pyx_v_w, __pyx_v_n);
/* function exit code */
}
static PyObject *__pyx_pf_9pywrapfst_6power(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w, size_t __pyx_v_n) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
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("power", 0);
- /* "pywrapfst.pyx":564
+ /* "pywrapfst.pyx":627
* FstBadWeightError: Invalid weight.
* """
- * cdef Weight result = _power(w, n) # <<<<<<<<<<<<<<
- * result._check_weight()
- * return result
+ * 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, 564, __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, 627, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":565
+ /* "pywrapfst.pyx":628
* """
- * cdef Weight result = _power(w, n)
- * result._check_weight() # <<<<<<<<<<<<<<
- * return result
+ * cdef Weight _weight = _power(w, n)
+ * _weight._check_weight() # <<<<<<<<<<<<<<
+ * return _weight
*
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
- __PYX_ERR(0, 565, __pyx_L1_error)
+ __PYX_ERR(0, 628, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_result->__pyx_vtab)->_check_weight(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 565, __pyx_L1_error)
+ ((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)
- /* "pywrapfst.pyx":566
- * cdef Weight result = _power(w, n)
- * result._check_weight()
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":629
+ * cdef Weight _weight = _power(w, n)
+ * _weight._check_weight()
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = ((PyObject *)__pyx_v_result);
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = ((PyObject *)__pyx_v__weight);
goto __pyx_L0;
- /* "pywrapfst.pyx":547
+ /* "pywrapfst.pyx":610
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
__Pyx_AddTraceback("pywrapfst.power", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":569
+/* "pywrapfst.pyx":632
*
*
* cdef fst.WeightClass _get_WeightClass_or_Zero(const string &weight_type, # <<<<<<<<<<<<<<
*/
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_result;
+ fst::script::WeightClass __pyx_v__weight;
fst::script::WeightClass __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_WeightClass_or_Zero", 0);
- /* "pywrapfst.pyx":587
+ /* "pywrapfst.pyx":650
* """
- * cdef fst.WeightClass result
+ * cdef fst.WeightClass _weight
* if weight is None: # <<<<<<<<<<<<<<
- * result = fst.WeightClass.Zero(weight_type)
+ * _weight = fst.WeightClass.Zero(weight_type)
* elif isinstance(weight, Weight):
*/
__pyx_t_1 = (__pyx_v_weight == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":588
- * cdef fst.WeightClass result
+ /* "pywrapfst.pyx":651
+ * cdef fst.WeightClass _weight
* if weight is None:
- * result = fst.WeightClass.Zero(weight_type) # <<<<<<<<<<<<<<
+ * _weight = fst.WeightClass.Zero(weight_type) # <<<<<<<<<<<<<<
* elif isinstance(weight, Weight):
- * result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
+ * _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
*/
- __pyx_v_result = fst::script::WeightClass::Zero(__pyx_v_weight_type);
+ __pyx_v__weight = fst::script::WeightClass::Zero(__pyx_v_weight_type);
- /* "pywrapfst.pyx":587
+ /* "pywrapfst.pyx":650
* """
- * cdef fst.WeightClass result
+ * cdef fst.WeightClass _weight
* if weight is None: # <<<<<<<<<<<<<<
- * result = fst.WeightClass.Zero(weight_type)
+ * _weight = fst.WeightClass.Zero(weight_type)
* elif isinstance(weight, Weight):
*/
goto __pyx_L3;
}
- /* "pywrapfst.pyx":589
+ /* "pywrapfst.pyx":652
* if weight is None:
- * result = fst.WeightClass.Zero(weight_type)
+ * _weight = fst.WeightClass.Zero(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
- * result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
+ * _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
* else:
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_weight, __pyx_ptype_9pywrapfst_Weight);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":590
- * result = fst.WeightClass.Zero(weight_type)
+ /* "pywrapfst.pyx":653
+ * _weight = fst.WeightClass.Zero(weight_type)
* elif isinstance(weight, Weight):
- * result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get()) # <<<<<<<<<<<<<<
+ * _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get()) # <<<<<<<<<<<<<<
* else:
- * result = fst.WeightClass(weight_type, weight_tostring(weight))
+ * _weight = fst.WeightClass(weight_type, weight_tostring(weight))
*/
if (unlikely(__pyx_v_weight == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 590, __pyx_L1_error)
+ __PYX_ERR(0, 653, __pyx_L1_error)
}
- __pyx_v_result = (*((fst::script::WeightClass *)((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));
+ __pyx_v__weight = (*((fst::script::WeightClass *)((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));
- /* "pywrapfst.pyx":589
+ /* "pywrapfst.pyx":652
* if weight is None:
- * result = fst.WeightClass.Zero(weight_type)
+ * _weight = fst.WeightClass.Zero(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
- * result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
+ * _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
* else:
*/
goto __pyx_L3;
}
- /* "pywrapfst.pyx":592
- * result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
+ /* "pywrapfst.pyx":655
+ * _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
* else:
- * result = fst.WeightClass(weight_type, weight_tostring(weight)) # <<<<<<<<<<<<<<
- * if not result.Member():
+ * _weight = fst.WeightClass(weight_type, weight_tostring(weight)) # <<<<<<<<<<<<<<
+ * if not _weight.Member():
* raise FstBadWeightError(weight_tostring(weight))
*/
/*else*/ {
- __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 592, __pyx_L1_error)
- __pyx_v_result = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);
+ __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 655, __pyx_L1_error)
+ __pyx_v__weight = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);
- /* "pywrapfst.pyx":593
+ /* "pywrapfst.pyx":656
* else:
- * result = fst.WeightClass(weight_type, weight_tostring(weight))
- * if not result.Member(): # <<<<<<<<<<<<<<
+ * _weight = fst.WeightClass(weight_type, weight_tostring(weight))
+ * if not _weight.Member(): # <<<<<<<<<<<<<<
* raise FstBadWeightError(weight_tostring(weight))
- * return result
+ * return _weight
*/
- __pyx_t_1 = ((!(__pyx_v_result.Member() != 0)) != 0);
+ __pyx_t_1 = ((!(__pyx_v__weight.Member() != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":594
- * result = fst.WeightClass(weight_type, weight_tostring(weight))
- * if not result.Member():
+ /* "pywrapfst.pyx":657
+ * _weight = fst.WeightClass(weight_type, weight_tostring(weight))
+ * if not _weight.Member():
* raise FstBadWeightError(weight_tostring(weight)) # <<<<<<<<<<<<<<
- * return result
+ * return _weight
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __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, 594, __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, 594, __pyx_L1_error)
+ __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_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, 594, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __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, 594, __pyx_L1_error)
+ __PYX_ERR(0, 657, __pyx_L1_error)
- /* "pywrapfst.pyx":593
+ /* "pywrapfst.pyx":656
* else:
- * result = fst.WeightClass(weight_type, weight_tostring(weight))
- * if not result.Member(): # <<<<<<<<<<<<<<
+ * _weight = fst.WeightClass(weight_type, weight_tostring(weight))
+ * if not _weight.Member(): # <<<<<<<<<<<<<<
* raise FstBadWeightError(weight_tostring(weight))
- * return result
+ * return _weight
*/
}
}
__pyx_L3:;
- /* "pywrapfst.pyx":595
- * if not result.Member():
+ /* "pywrapfst.pyx":658
+ * if not _weight.Member():
* raise FstBadWeightError(weight_tostring(weight))
- * return result # <<<<<<<<<<<<<<
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
- __pyx_r = __pyx_v_result;
+ __pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":569
+ /* "pywrapfst.pyx":632
*
*
* cdef fst.WeightClass _get_WeightClass_or_Zero(const string &weight_type, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":598
+/* "pywrapfst.pyx":661
*
*
* cdef fst.WeightClass _get_WeightClass_or_One(const string &weight_type, # <<<<<<<<<<<<<<
*/
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_result;
+ fst::script::WeightClass __pyx_v__weight;
fst::script::WeightClass __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_WeightClass_or_One", 0);
- /* "pywrapfst.pyx":616
+ /* "pywrapfst.pyx":679
* """
- * cdef fst.WeightClass result
+ * cdef fst.WeightClass _weight
* if weight is None: # <<<<<<<<<<<<<<
- * result = fst.WeightClass.One(weight_type)
+ * _weight = fst.WeightClass.One(weight_type)
* elif isinstance(weight, Weight):
*/
__pyx_t_1 = (__pyx_v_weight == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":617
- * cdef fst.WeightClass result
+ /* "pywrapfst.pyx":680
+ * cdef fst.WeightClass _weight
* if weight is None:
- * result = fst.WeightClass.One(weight_type) # <<<<<<<<<<<<<<
+ * _weight = fst.WeightClass.One(weight_type) # <<<<<<<<<<<<<<
* elif isinstance(weight, Weight):
- * result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
+ * _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
*/
- __pyx_v_result = fst::script::WeightClass::One(__pyx_v_weight_type);
+ __pyx_v__weight = fst::script::WeightClass::One(__pyx_v_weight_type);
- /* "pywrapfst.pyx":616
+ /* "pywrapfst.pyx":679
* """
- * cdef fst.WeightClass result
+ * cdef fst.WeightClass _weight
* if weight is None: # <<<<<<<<<<<<<<
- * result = fst.WeightClass.One(weight_type)
+ * _weight = fst.WeightClass.One(weight_type)
* elif isinstance(weight, Weight):
*/
goto __pyx_L3;
}
- /* "pywrapfst.pyx":618
+ /* "pywrapfst.pyx":681
* if weight is None:
- * result = fst.WeightClass.One(weight_type)
+ * _weight = fst.WeightClass.One(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
- * result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
+ * _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
* else:
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_weight, __pyx_ptype_9pywrapfst_Weight);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":619
- * result = fst.WeightClass.One(weight_type)
+ /* "pywrapfst.pyx":682
+ * _weight = fst.WeightClass.One(weight_type)
* elif isinstance(weight, Weight):
- * result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get()) # <<<<<<<<<<<<<<
+ * _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get()) # <<<<<<<<<<<<<<
* else:
- * result = fst.WeightClass(weight_type, weight_tostring(weight))
+ * _weight = fst.WeightClass(weight_type, weight_tostring(weight))
*/
if (unlikely(__pyx_v_weight == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 619, __pyx_L1_error)
+ __PYX_ERR(0, 682, __pyx_L1_error)
}
- __pyx_v_result = (*((fst::script::WeightClass *)((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));
+ __pyx_v__weight = (*((fst::script::WeightClass *)((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));
- /* "pywrapfst.pyx":618
+ /* "pywrapfst.pyx":681
* if weight is None:
- * result = fst.WeightClass.One(weight_type)
+ * _weight = fst.WeightClass.One(weight_type)
* elif isinstance(weight, Weight): # <<<<<<<<<<<<<<
- * result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
+ * _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
* else:
*/
goto __pyx_L3;
}
- /* "pywrapfst.pyx":621
- * result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
+ /* "pywrapfst.pyx":684
+ * _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
* else:
- * result = fst.WeightClass(weight_type, weight_tostring(weight)) # <<<<<<<<<<<<<<
- * if not result.Member():
+ * _weight = fst.WeightClass(weight_type, weight_tostring(weight)) # <<<<<<<<<<<<<<
+ * if not _weight.Member():
* raise FstBadWeightError(weight_tostring(weight))
*/
/*else*/ {
- __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 621, __pyx_L1_error)
- __pyx_v_result = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);
+ __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 684, __pyx_L1_error)
+ __pyx_v__weight = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);
- /* "pywrapfst.pyx":622
+ /* "pywrapfst.pyx":685
* else:
- * result = fst.WeightClass(weight_type, weight_tostring(weight))
- * if not result.Member(): # <<<<<<<<<<<<<<
+ * _weight = fst.WeightClass(weight_type, weight_tostring(weight))
+ * if not _weight.Member(): # <<<<<<<<<<<<<<
* raise FstBadWeightError(weight_tostring(weight))
- * return result
+ * return _weight
*/
- __pyx_t_1 = ((!(__pyx_v_result.Member() != 0)) != 0);
+ __pyx_t_1 = ((!(__pyx_v__weight.Member() != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":623
- * result = fst.WeightClass(weight_type, weight_tostring(weight))
- * if not result.Member():
+ /* "pywrapfst.pyx":686
+ * _weight = fst.WeightClass(weight_type, weight_tostring(weight))
+ * if not _weight.Member():
* raise FstBadWeightError(weight_tostring(weight)) # <<<<<<<<<<<<<<
- * return result
+ * return _weight
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __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, 623, __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, 623, __pyx_L1_error)
+ __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_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, 623, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __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, 623, __pyx_L1_error)
+ __PYX_ERR(0, 686, __pyx_L1_error)
- /* "pywrapfst.pyx":622
+ /* "pywrapfst.pyx":685
* else:
- * result = fst.WeightClass(weight_type, weight_tostring(weight))
- * if not result.Member(): # <<<<<<<<<<<<<<
+ * _weight = fst.WeightClass(weight_type, weight_tostring(weight))
+ * if not _weight.Member(): # <<<<<<<<<<<<<<
* raise FstBadWeightError(weight_tostring(weight))
- * return result
+ * return _weight
*/
}
}
__pyx_L3:;
- /* "pywrapfst.pyx":624
- * if not result.Member():
+ /* "pywrapfst.pyx":687
+ * if not _weight.Member():
* raise FstBadWeightError(weight_tostring(weight))
- * return result # <<<<<<<<<<<<<<
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
- __pyx_r = __pyx_v_result;
+ __pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":598
+ /* "pywrapfst.pyx":661
*
*
* cdef fst.WeightClass _get_WeightClass_or_One(const string &weight_type, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":627
+/* "pywrapfst.pyx":690
*
*
* cdef Weight _Zero(weight_type): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(
*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__Zero(PyObject *__pyx_v_weight_type) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_Zero", 0);
- /* "pywrapfst.pyx":628
+ /* "pywrapfst.pyx":691
*
* cdef Weight _Zero(weight_type):
- * cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
- * result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
- * tostring(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, 628, __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, 691, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":629
+ /* "pywrapfst.pyx":692
* cdef Weight _Zero(weight_type):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero( # <<<<<<<<<<<<<<
- * tostring(weight_type))))
- * if result._weight.get().Type() == b"none":
+ * 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":
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 629, __pyx_L1_error)
+ __PYX_ERR(0, 692, __pyx_L1_error)
}
- /* "pywrapfst.pyx":630
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
- * tostring(weight_type)))) # <<<<<<<<<<<<<<
- * if result._weight.get().Type() == b"none":
+ /* "pywrapfst.pyx":693
+ * 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, 630, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 693, __pyx_L1_error)
- /* "pywrapfst.pyx":629
+ /* "pywrapfst.pyx":692
* cdef Weight _Zero(weight_type):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero( # <<<<<<<<<<<<<<
- * tostring(weight_type))))
- * if result._weight.get().Type() == b"none":
+ * 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":
*/
- __pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::Zero(__pyx_t_2)));
+ __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::Zero(__pyx_t_2)));
- /* "pywrapfst.pyx":631
- * result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
- * tostring(weight_type))))
- * if result._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":694
+ * _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")
- * return result
+ * return _weight
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 631, __pyx_L1_error)
+ __PYX_ERR(0, 694, __pyx_L1_error)
}
- __pyx_t_3 = ((__pyx_v_result->_weight.get()->Type() == ((char const *)"none")) != 0);
+ __pyx_t_3 = ((__pyx_v__weight->_weight.get()->Type() == ((char const *)"none")) != 0);
if (unlikely(__pyx_t_3)) {
- /* "pywrapfst.pyx":632
- * tostring(weight_type))))
- * if result._weight.get().Type() == b"none":
+ /* "pywrapfst.pyx":695
+ * new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
+ * if _weight._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found") # <<<<<<<<<<<<<<
- * return result
+ * return _weight
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __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, 632, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __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, 632, __pyx_L1_error)
+ __PYX_ERR(0, 695, __pyx_L1_error)
- /* "pywrapfst.pyx":631
- * result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
- * tostring(weight_type))))
- * if result._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":694
+ * _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")
- * return result
+ * return _weight
*/
}
- /* "pywrapfst.pyx":633
- * if result._weight.get().Type() == b"none":
+ /* "pywrapfst.pyx":696
+ * if _weight._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found")
- * return result # <<<<<<<<<<<<<<
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":627
+ /* "pywrapfst.pyx":690
*
*
* cdef Weight _Zero(weight_type): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst._Zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":636
+/* "pywrapfst.pyx":699
*
*
* cdef Weight _One(weight_type): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(
*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__One(PyObject *__pyx_v_weight_type) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_One", 0);
- /* "pywrapfst.pyx":637
+ /* "pywrapfst.pyx":700
*
* cdef Weight _One(weight_type):
- * cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
- * result._weight.reset(new fst.WeightClass(
- * fst.WeightClass.One(tostring(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, 637, __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, 700, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":638
+ /* "pywrapfst.pyx":701
* cdef Weight _One(weight_type):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass( # <<<<<<<<<<<<<<
- * fst.WeightClass.One(tostring(weight_type))))
- * if result._weight.get().Type() == b"none":
+ * 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":
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 638, __pyx_L1_error)
+ __PYX_ERR(0, 701, __pyx_L1_error)
}
- /* "pywrapfst.pyx":639
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(
- * fst.WeightClass.One(tostring(weight_type)))) # <<<<<<<<<<<<<<
- * if result._weight.get().Type() == b"none":
+ /* "pywrapfst.pyx":702
+ * 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, 639, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L1_error)
- /* "pywrapfst.pyx":638
+ /* "pywrapfst.pyx":701
* cdef Weight _One(weight_type):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass( # <<<<<<<<<<<<<<
- * fst.WeightClass.One(tostring(weight_type))))
- * if result._weight.get().Type() == b"none":
+ * 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":
*/
- __pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::One(__pyx_t_2)));
+ __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::One(__pyx_t_2)));
- /* "pywrapfst.pyx":640
- * result._weight.reset(new fst.WeightClass(
- * fst.WeightClass.One(tostring(weight_type))))
- * if result._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":703
+ * _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")
- * return result
+ * return _weight
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 640, __pyx_L1_error)
+ __PYX_ERR(0, 703, __pyx_L1_error)
}
- __pyx_t_3 = ((__pyx_v_result->_weight.get()->Type() == ((char const *)"none")) != 0);
+ __pyx_t_3 = ((__pyx_v__weight->_weight.get()->Type() == ((char const *)"none")) != 0);
if (unlikely(__pyx_t_3)) {
- /* "pywrapfst.pyx":641
- * fst.WeightClass.One(tostring(weight_type))))
- * if result._weight.get().Type() == b"none":
+ /* "pywrapfst.pyx":704
+ * new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
+ * if _weight._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found") # <<<<<<<<<<<<<<
- * return result
+ * return _weight
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __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, 641, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __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, 641, __pyx_L1_error)
+ __PYX_ERR(0, 704, __pyx_L1_error)
- /* "pywrapfst.pyx":640
- * result._weight.reset(new fst.WeightClass(
- * fst.WeightClass.One(tostring(weight_type))))
- * if result._weight.get().Type() == b"none": # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":703
+ * _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")
- * return result
+ * return _weight
*/
}
- /* "pywrapfst.pyx":642
- * if result._weight.get().Type() == b"none":
+ /* "pywrapfst.pyx":705
+ * if _weight._weight.get().Type() == b"none":
* raise FstArgError("Weight type not found")
- * return result # <<<<<<<<<<<<<<
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":636
+ /* "pywrapfst.pyx":699
*
*
* cdef Weight _One(weight_type): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst._One", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":645
+/* "pywrapfst.pyx":708
*
*
* cdef Weight _NoWeight(weight_type): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(
*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__NoWeight(PyObject *__pyx_v_weight_type) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
std::string __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_NoWeight", 0);
- /* "pywrapfst.pyx":646
+ /* "pywrapfst.pyx":709
*
* cdef Weight _NoWeight(weight_type):
- * cdef Weight result = Weight.__new__(Weight) # <<<<<<<<<<<<<<
- * result._weight.reset(new fst.WeightClass(
- * fst.WeightClass.NoWeight(tostring(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, 646, __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, 709, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":647
+ /* "pywrapfst.pyx":710
* cdef Weight _NoWeight(weight_type):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass( # <<<<<<<<<<<<<<
- * fst.WeightClass.NoWeight(tostring(weight_type))))
- * return result
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset( # <<<<<<<<<<<<<<
+ * new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))
+ * return _weight
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 647, __pyx_L1_error)
+ __PYX_ERR(0, 710, __pyx_L1_error)
}
- /* "pywrapfst.pyx":648
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(
- * fst.WeightClass.NoWeight(tostring(weight_type)))) # <<<<<<<<<<<<<<
- * return result
+ /* "pywrapfst.pyx":711
+ * 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, 648, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 711, __pyx_L1_error)
- /* "pywrapfst.pyx":647
+ /* "pywrapfst.pyx":710
* cdef Weight _NoWeight(weight_type):
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass( # <<<<<<<<<<<<<<
- * fst.WeightClass.NoWeight(tostring(weight_type))))
- * return result
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset( # <<<<<<<<<<<<<<
+ * new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))
+ * return _weight
*/
- __pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::NoWeight(__pyx_t_2)));
+ __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::NoWeight(__pyx_t_2)));
- /* "pywrapfst.pyx":649
- * result._weight.reset(new fst.WeightClass(
- * fst.WeightClass.NoWeight(tostring(weight_type))))
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":712
+ * _weight._weight.reset(
+ * new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))
+ * return _weight # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":645
+ /* "pywrapfst.pyx":708
*
*
* cdef Weight _NoWeight(weight_type): # <<<<<<<<<<<<<<
- * cdef Weight result = Weight.__new__(Weight)
- * result._weight.reset(new fst.WeightClass(
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst._NoWeight", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":683
+/* "pywrapfst.pyx":744
* # Doing so will allow undefined behavior.
*
* def __init__(self): # <<<<<<<<<<<<<<
- * raise FstDeletedConstructorError(
- * "Cannot construct {}".format(self.__class__.__name__))
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
+ *
*/
/* Python wrapper */
-static int __pyx_pw_9pywrapfst_12_SymbolTable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_9pywrapfst_12_SymbolTable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static int __pyx_pw_9pywrapfst_15SymbolTableView_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_9pywrapfst_15SymbolTableView_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable___init__(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView___init__(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static int __pyx_pf_9pywrapfst_12_SymbolTable___init__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
+static int __pyx_pf_9pywrapfst_15SymbolTableView___init__(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
int __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_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":684
- *
- * def __init__(self):
- * raise FstDeletedConstructorError( # <<<<<<<<<<<<<<
- * "Cannot construct {}".format(self.__class__.__name__))
+ /* "pywrapfst.pyx":745
*
- */
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
-
- /* "pywrapfst.pyx":685
* def __init__(self):
- * raise FstDeletedConstructorError(
- * "Cannot construct {}".format(self.__class__.__name__)) # <<<<<<<<<<<<<<
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}") # <<<<<<<<<<<<<<
*
* def __iter__(self):
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(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_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, 685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- }
- }
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __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, 745, __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_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_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_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_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, 684, __pyx_L1_error)
+ __PYX_ERR(0, 745, __pyx_L1_error)
- /* "pywrapfst.pyx":683
+ /* "pywrapfst.pyx":744
* # Doing so will allow undefined behavior.
*
* def __init__(self): # <<<<<<<<<<<<<<
- * raise FstDeletedConstructorError(
- * "Cannot construct {}".format(self.__class__.__name__))
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":687
- * "Cannot construct {}".format(self.__class__.__name__))
+/* "pywrapfst.pyx":747
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
*
* def __iter__(self): # <<<<<<<<<<<<<<
* return _SymbolTableIterator(self)
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_3__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_3__iter__(PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_3__iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_3__iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_2__iter__(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_2__iter__(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_2__iter__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_2__iter__(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
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("__iter__", 0);
- /* "pywrapfst.pyx":688
+ /* "pywrapfst.pyx":748
*
* 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, 688, __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, 748, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":687
- * "Cannot construct {}".format(self.__class__.__name__))
+ /* "pywrapfst.pyx":747
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
*
* def __iter__(self): # <<<<<<<<<<<<<<
* return _SymbolTableIterator(self)
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":692
+/* "pywrapfst.pyx":752
* # Registers the class for pickling.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_4__reduce__(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_4__reduce__(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_4__reduce__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_4__reduce__(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__reduce__", 0);
- /* "pywrapfst.pyx":693
+ /* "pywrapfst.pyx":753
*
* 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, 693, __pyx_L1_error)
+ __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_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, 693, __pyx_L1_error)
+ __PYX_ERR(0, 753, __pyx_L1_error)
}
- __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __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_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __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, 693, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __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":692
+ /* "pywrapfst.pyx":752
* # Registers the class for pickling.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":699
+/* "pywrapfst.pyx":759
* # 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): # <<<<<<<<<<<<<<
*
*/
-static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_12_SymbolTable__raw(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
+static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_15SymbolTableView__raw(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
__pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_raw", 0);
- /* "pywrapfst.pyx":700
+ /* "pywrapfst.pyx":760
* # 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":699
+ /* "pywrapfst.pyx":759
* # 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":703
+/* "pywrapfst.pyx":763
*
* # Raises an FstOpError for a nonexistent SymbolTable.
* cdef void _raise_nonexistent(self) except *: # <<<<<<<<<<<<<<
*
*/
-static void __pyx_f_9pywrapfst_12_SymbolTable__raise_nonexistent(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
+static void __pyx_f_9pywrapfst_15SymbolTableView__raise_nonexistent(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_raise_nonexistent", 0);
- /* "pywrapfst.pyx":704
+ /* "pywrapfst.pyx":764
* # 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, 704, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __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, 704, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __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, 704, __pyx_L1_error)
+ __PYX_ERR(0, 764, __pyx_L1_error)
- /* "pywrapfst.pyx":703
+ /* "pywrapfst.pyx":763
*
* # Raises an FstOpError for a nonexistent SymbolTable.
* cdef void _raise_nonexistent(self) except *: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("pywrapfst._SymbolTable._raise_nonexistent", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView._raise_nonexistent", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":708
+/* "pywrapfst.pyx":768
* # 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 *: # <<<<<<<<<<<<<<
- * cdef const_SymbolTable_ptr raw = self._raw()
- * if raw == NULL:
+ * cdef const_SymbolTable_ptr _raw = self._raw()
+ * if _raw == NULL:
*/
-static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_12_SymbolTable__raw_ptr_or_raise(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
- __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v_raw;
+static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_15SymbolTableView__raw_ptr_or_raise(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
+ __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v__raw;
__pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_raw_ptr_or_raise", 0);
- /* "pywrapfst.pyx":709
+ /* "pywrapfst.pyx":769
* # fst.SymbolTable is required.
* cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *:
- * cdef const_SymbolTable_ptr raw = self._raw() # <<<<<<<<<<<<<<
- * if raw == NULL:
+ * 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'", "_raw");
- __PYX_ERR(0, 709, __pyx_L1_error)
+ __PYX_ERR(0, 769, __pyx_L1_error)
}
- __pyx_v_raw = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raw(__pyx_v_self);
+ __pyx_v__raw = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw(__pyx_v_self);
- /* "pywrapfst.pyx":710
+ /* "pywrapfst.pyx":770
* cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *:
- * cdef const_SymbolTable_ptr raw = self._raw()
- * if raw == NULL: # <<<<<<<<<<<<<<
+ * cdef const_SymbolTable_ptr _raw = self._raw()
+ * if _raw == NULL: # <<<<<<<<<<<<<<
* self._raise_nonexistent()
- * return raw
+ * return _raw
*/
- __pyx_t_1 = ((__pyx_v_raw == NULL) != 0);
+ __pyx_t_1 = ((__pyx_v__raw == NULL) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":711
- * cdef const_SymbolTable_ptr raw = self._raw()
- * if raw == NULL:
+ /* "pywrapfst.pyx":771
+ * cdef const_SymbolTable_ptr _raw = self._raw()
+ * if _raw == NULL:
* self._raise_nonexistent() # <<<<<<<<<<<<<<
- * return raw
+ * return _raw
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raise_nonexistent");
- __PYX_ERR(0, 711, __pyx_L1_error)
+ __PYX_ERR(0, 771, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raise_nonexistent(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 711, __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)
- /* "pywrapfst.pyx":710
+ /* "pywrapfst.pyx":770
* cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *:
- * cdef const_SymbolTable_ptr raw = self._raw()
- * if raw == NULL: # <<<<<<<<<<<<<<
+ * cdef const_SymbolTable_ptr _raw = self._raw()
+ * if _raw == NULL: # <<<<<<<<<<<<<<
* self._raise_nonexistent()
- * return raw
+ * return _raw
*/
}
- /* "pywrapfst.pyx":712
- * if raw == NULL:
+ /* "pywrapfst.pyx":772
+ * if _raw == NULL:
* self._raise_nonexistent()
- * return raw # <<<<<<<<<<<<<<
+ * return _raw # <<<<<<<<<<<<<<
*
* cpdef int64 available_key(self) except *:
*/
- __pyx_r = __pyx_v_raw;
+ __pyx_r = __pyx_v__raw;
goto __pyx_L0;
- /* "pywrapfst.pyx":708
+ /* "pywrapfst.pyx":768
* # 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 *: # <<<<<<<<<<<<<<
- * cdef const_SymbolTable_ptr raw = self._raw()
- * if raw == NULL:
+ * cdef const_SymbolTable_ptr _raw = self._raw()
+ * if _raw == NULL:
*/
/* function exit code */
__pyx_L1_error:;
- __Pyx_AddTraceback("pywrapfst._SymbolTable._raw_ptr_or_raise", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView._raw_ptr_or_raise", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":714
- * return raw
+/* "pywrapfst.pyx":774
+ * return _raw
*
* cpdef int64 available_key(self) except *: # <<<<<<<<<<<<<<
* """
* available_key(self)
*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_7available_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static int64 __pyx_f_9pywrapfst_12_SymbolTable_available_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_7available_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int64 __pyx_f_9pywrapfst_15SymbolTableView_available_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
int64 __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_4 = NULL;
int64 __pyx_t_5;
fst::SymbolTable const *__pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("available_key", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 714, __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, 774, __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_12_SymbolTable_7available_key)) {
+ 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_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __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, 714, __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, 774, __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":720
+ /* "pywrapfst.pyx":780
* 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, 720, __pyx_L1_error)
+ __PYX_ERR(0, 780, __pyx_L1_error)
}
- __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 720, __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_r = __pyx_t_6->AvailableKey();
goto __pyx_L0;
- /* "pywrapfst.pyx":714
- * return raw
+ /* "pywrapfst.pyx":774
+ * return _raw
*
* cpdef int64 available_key(self) except *: # <<<<<<<<<<<<<<
* """
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.available_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.available_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_7available_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_6available_key[] = "\n available_key(self)\n\n Returns an integer indicating the next available key index in the table.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_7available_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_7available_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_15SymbolTableView_6available_key[] = "\n available_key(self)\n\n Returns an integer indicating the next available key index in the table.\n ";
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_7available_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("available_key (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_6available_key(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_6available_key(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_6available_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_6available_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int64 __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("available_key", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_12_SymbolTable_available_key(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.available_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.available_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":722
+/* "pywrapfst.pyx":782
* return self._raw_ptr_or_raise().AvailableKey()
*
* cpdef bytes checksum(self): # <<<<<<<<<<<<<<
* checksum(self)
*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_9checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_f_9pywrapfst_12_SymbolTable_checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_9checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_9pywrapfst_15SymbolTableView_checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
fst::SymbolTable const *__pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("checksum", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 722, __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, 782, __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_12_SymbolTable_9checksum)) {
+ if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_15SymbolTableView_9checksum)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
}
__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, 722, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __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, 722, __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, 782, __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":728
+ /* "pywrapfst.pyx":788
* 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, 728, __pyx_L1_error)
+ __PYX_ERR(0, 788, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 728, __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, 728, __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_GOTREF(__pyx_t_1);
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":722
+ /* "pywrapfst.pyx":782
* return self._raw_ptr_or_raise().AvailableKey()
*
* cpdef bytes checksum(self): # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_9checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_8checksum[] = "\n checksum(self)\n\n Returns a bytestring indicating the label-independent MD5 checksum.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_9checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_9checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_15SymbolTableView_8checksum[] = "\n checksum(self)\n\n Returns a bytestring indicating the label-independent MD5 checksum.\n ";
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_9checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("checksum (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_8checksum(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_8checksum(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_8checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_8checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
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("checksum", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_12_SymbolTable_checksum(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":730
+/* "pywrapfst.pyx":790
* return self._raw_ptr_or_raise().CheckSum()
*
* cpdef SymbolTable copy(self): # <<<<<<<<<<<<<<
* copy(self)
*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_11copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_12_SymbolTable_copy(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_11copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_15SymbolTableView_copy(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
fst::SymbolTable const *__pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 730, __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, 790, __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_12_SymbolTable_11copy)) {
+ 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_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
}
__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, 730, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __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, 730, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_SymbolTable))))) __PYX_ERR(0, 790, __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":736
+ /* "pywrapfst.pyx":796
* 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, 736, __pyx_L1_error)
+ __PYX_ERR(0, 796, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 736, __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, 736, __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_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":730
+ /* "pywrapfst.pyx":790
* return self._raw_ptr_or_raise().CheckSum()
*
* cpdef SymbolTable copy(self): # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF((PyObject *)__pyx_r);
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_11copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_10copy[] = "\n copy(self)\n\n Returns a mutable copy of the SymbolTable.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_11copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_11copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_15SymbolTableView_10copy[] = "\n copy(self)\n\n Returns a mutable copy of the SymbolTable.\n ";
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_11copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("copy (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_10copy(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_10copy(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_10copy(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_10copy(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
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("copy", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_12_SymbolTable_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":738
+/* "pywrapfst.pyx":798
* return _init_SymbolTable(WrapUnique(self._raw_ptr_or_raise().Copy()))
*
* def find(self, key): # <<<<<<<<<<<<<<
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_13find(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_12find[] = "\n find(self, key)\n\n Given a symbol or index, finds the other one.\n\n This method returns the index associated with a symbol key, or the symbol\n associated with a index key.\n\n Args:\n key: Either a string or an index.\n\n Returns:\n If the key is a string, the associated index or NO_LABEL if not found; if\n the key is an integer, the associated symbol or an empty string if\n not found.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_13find(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_13find(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
+static char __pyx_doc_9pywrapfst_15SymbolTableView_12find[] = "\n find(self, key)\n\n Given a symbol or index, finds the other one.\n\n This method returns the index associated with a symbol key, or the symbol\n associated with a index key.\n\n Args:\n key: Either a string or an index.\n\n Returns:\n If the key is a string, the associated index or NO_LABEL if not found; if\n the key is an integer, the associated symbol or an empty string if\n not found.\n ";
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_13find(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("find (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_12find(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v_key));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_12find(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), ((PyObject *)__pyx_v_key));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_12find(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key) {
- __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v_raw;
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_12find(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key) {
+ __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v__raw;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
fst::SymbolTable const *__pyx_t_1;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
- int __pyx_t_10;
- int64 __pyx_t_11;
+ int64 __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("find", 0);
- /* "pywrapfst.pyx":755
+ /* "pywrapfst.pyx":815
* not found.
* """
- * cdef const_SymbolTable_ptr raw = self._raw_ptr_or_raise() # <<<<<<<<<<<<<<
+ * cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise() # <<<<<<<<<<<<<<
* try:
- * return raw.FindIndex(tostring(key))
+ * return _raw.FindIndex(tostring(key))
*/
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, 755, __pyx_L1_error)
+ __PYX_ERR(0, 815, __pyx_L1_error)
}
- __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 755, __pyx_L1_error)
- __pyx_v_raw = __pyx_t_1;
+ __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_v__raw = __pyx_t_1;
- /* "pywrapfst.pyx":756
+ /* "pywrapfst.pyx":816
* """
- * cdef const_SymbolTable_ptr raw = self._raw_ptr_or_raise()
+ * cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try: # <<<<<<<<<<<<<<
- * return raw.FindIndex(tostring(key))
- * except FstArgError:
+ * return _raw.FindIndex(tostring(key))
+ * except TypeError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_XGOTREF(__pyx_t_4);
/*try:*/ {
- /* "pywrapfst.pyx":757
- * cdef const_SymbolTable_ptr raw = self._raw_ptr_or_raise()
+ /* "pywrapfst.pyx":817
+ * cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try:
- * return raw.FindIndex(tostring(key)) # <<<<<<<<<<<<<<
- * except FstArgError:
- * return raw.FindSymbol(key)
+ * return _raw.FindIndex(tostring(key)) # <<<<<<<<<<<<<<
+ * except TypeError:
+ * 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, 757, __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, 757, __pyx_L3_error)
+ __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_GOTREF(__pyx_t_6);
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L7_try_return;
- /* "pywrapfst.pyx":756
+ /* "pywrapfst.pyx":816
* """
- * cdef const_SymbolTable_ptr raw = self._raw_ptr_or_raise()
+ * cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try: # <<<<<<<<<<<<<<
- * return raw.FindIndex(tostring(key))
- * except FstArgError:
+ * return _raw.FindIndex(tostring(key))
+ * except TypeError:
*/
}
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "pywrapfst.pyx":758
+ /* "pywrapfst.pyx":818
* try:
- * return raw.FindIndex(tostring(key))
- * except FstArgError: # <<<<<<<<<<<<<<
- * return raw.FindSymbol(key)
+ * return _raw.FindIndex(tostring(key))
+ * except TypeError: # <<<<<<<<<<<<<<
+ * return _raw.FindSymbol(key)
*
*/
- __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
- __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 758, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_6, __pyx_t_9);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
- __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0;
- if (__pyx_t_10) {
- __Pyx_AddTraceback("pywrapfst._SymbolTable.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(0, 758, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GOTREF(__pyx_t_7);
+ __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)
__Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_9);
- /* "pywrapfst.pyx":759
- * return raw.FindIndex(tostring(key))
- * except FstArgError:
- * return raw.FindSymbol(key) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":819
+ * 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_11 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_11 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 759, __pyx_L5_except_error)
- __pyx_t_9 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_raw->Find(__pyx_t_11)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 759, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_r = __pyx_t_9;
- __pyx_t_9 = 0;
+ __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_GOTREF(__pyx_t_11);
+ __pyx_r = __pyx_t_11;
+ __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L6_except_return;
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
- /* "pywrapfst.pyx":756
+ /* "pywrapfst.pyx":816
* """
- * cdef const_SymbolTable_ptr raw = self._raw_ptr_or_raise()
+ * cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try: # <<<<<<<<<<<<<<
- * return raw.FindIndex(tostring(key))
- * except FstArgError:
+ * return _raw.FindIndex(tostring(key))
+ * except TypeError:
*/
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
goto __pyx_L0;
}
- /* "pywrapfst.pyx":738
+ /* "pywrapfst.pyx":798
* return _init_SymbolTable(WrapUnique(self._raw_ptr_or_raise().Copy()))
*
* def find(self, key): # <<<<<<<<<<<<<<
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":761
- * return raw.FindSymbol(key)
+/* "pywrapfst.pyx":821
+ * return _raw.FindSymbol(key)
*
* cpdef int64 get_nth_key(self, ssize_t pos) except *: # <<<<<<<<<<<<<<
* """
* get_nth_key(self, pos)
*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_15get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos); /*proto*/
-static int64 __pyx_f_9pywrapfst_12_SymbolTable_get_nth_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, Py_ssize_t __pyx_v_pos, int __pyx_skip_dispatch) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_15get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos); /*proto*/
+static int64 __pyx_f_9pywrapfst_15SymbolTableView_get_nth_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, Py_ssize_t __pyx_v_pos, int __pyx_skip_dispatch) {
int64 __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_5 = NULL;
int64 __pyx_t_6;
fst::SymbolTable const *__pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_nth_key", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 761, __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, 821, __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_12_SymbolTable_15get_nth_key)) {
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
+ 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_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, 761, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __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, 761, __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, 821, __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":773
+ /* "pywrapfst.pyx":833
* 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, 773, __pyx_L1_error)
+ __PYX_ERR(0, 833, __pyx_L1_error)
}
- __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 773, __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_r = __pyx_t_7->GetNthKey(__pyx_v_pos);
goto __pyx_L0;
- /* "pywrapfst.pyx":761
- * return raw.FindSymbol(key)
+ /* "pywrapfst.pyx":821
+ * return _raw.FindSymbol(key)
*
* cpdef int64 get_nth_key(self, ssize_t pos) except *: # <<<<<<<<<<<<<<
* """
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.get_nth_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.get_nth_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_15get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_14get_nth_key[] = "\n get_nth_key(self, pos)\n\n Retrieves the integer index of the n-th key in the table.\n\n Args:\n pos: The n-th key to retrieve.\n\n Returns:\n The integer index of the n-th key, or NO_LABEL if not found.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_15get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_15get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos); /*proto*/
+static char __pyx_doc_9pywrapfst_15SymbolTableView_14get_nth_key[] = "\n get_nth_key(self, pos)\n\n Retrieves the integer index of the n-th key in the table.\n\n Args:\n pos: The n-th key to retrieve.\n\n Returns:\n The integer index of the n-th key, or NO_LABEL if not found.\n ";
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_15get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos) {
Py_ssize_t __pyx_v_pos;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_nth_key (wrapper)", 0);
assert(__pyx_arg_pos); {
- __pyx_v_pos = PyInt_AsSsize_t(__pyx_arg_pos); if (unlikely((__pyx_v_pos == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 761, __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, 821, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
- __Pyx_AddTraceback("pywrapfst._SymbolTable.get_nth_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.get_nth_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_14get_nth_key(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((Py_ssize_t)__pyx_v_pos));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_14get_nth_key(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), ((Py_ssize_t)__pyx_v_pos));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_14get_nth_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, Py_ssize_t __pyx_v_pos) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_14get_nth_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, Py_ssize_t __pyx_v_pos) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int64 __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_nth_key", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_12_SymbolTable_get_nth_key(__pyx_v_self, __pyx_v_pos, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __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, 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_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.get_nth_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.get_nth_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":775
+/* "pywrapfst.pyx":835
* return self._raw_ptr_or_raise().GetNthKey(pos)
*
* cpdef bytes labeled_checksum(self): # <<<<<<<<<<<<<<
* labeled_checksum(self)
*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_17labeled_checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_f_9pywrapfst_12_SymbolTable_labeled_checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_17labeled_checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_9pywrapfst_15SymbolTableView_labeled_checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
fst::SymbolTable const *__pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("labeled_checksum", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 775, __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, 835, __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_12_SymbolTable_17labeled_checksum)) {
+ 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_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
}
__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, 775, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 835, __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, 775, __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, 835, __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":781
+ /* "pywrapfst.pyx":841
* 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, 781, __pyx_L1_error)
+ __PYX_ERR(0, 841, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __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, 781, __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_GOTREF(__pyx_t_1);
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":775
+ /* "pywrapfst.pyx":835
* return self._raw_ptr_or_raise().GetNthKey(pos)
*
* cpdef bytes labeled_checksum(self): # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.labeled_checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.labeled_checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_17labeled_checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_16labeled_checksum[] = "\n labeled_checksum(self)\n\n Returns a bytestring indicating the label-dependent MD5 checksum.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_17labeled_checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_17labeled_checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_15SymbolTableView_16labeled_checksum[] = "\n labeled_checksum(self)\n\n Returns a bytestring indicating the label-dependent MD5 checksum.\n ";
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_17labeled_checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("labeled_checksum (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_16labeled_checksum(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_16labeled_checksum(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_16labeled_checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_16labeled_checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
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("labeled_checksum", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_12_SymbolTable_labeled_checksum(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.labeled_checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.labeled_checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":783
+/* "pywrapfst.pyx":843
* return self._raw_ptr_or_raise().LabeledCheckSum()
*
* cpdef bool member(self, key) except *: # <<<<<<<<<<<<<<
* member(self, key)
*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_19member(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static bool __pyx_f_9pywrapfst_12_SymbolTable_member(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
- __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v_raw;
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_19member(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
+static bool __pyx_f_9pywrapfst_15SymbolTableView_member(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
+ __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v__raw;
bool __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
std::string __pyx_t_10;
int __pyx_t_11;
int64 __pyx_t_12;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("member", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 783, __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, 843, __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_12_SymbolTable_19member)) {
+ 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_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 783, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __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, 783, __pyx_L1_error)
+ __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_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":799
+ /* "pywrapfst.pyx":859
* 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() # <<<<<<<<<<<<<<
+ * cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise() # <<<<<<<<<<<<<<
* try:
- * return raw.MemberSymbol(tostring(key))
+ * return _raw.MemberSymbol(tostring(key))
*/
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, 799, __pyx_L1_error)
+ __PYX_ERR(0, 859, __pyx_L1_error)
}
- __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 799, __pyx_L1_error)
- __pyx_v_raw = __pyx_t_6;
+ __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_v__raw = __pyx_t_6;
- /* "pywrapfst.pyx":800
+ /* "pywrapfst.pyx":860
* """
- * cdef const_SymbolTable_ptr raw = self._raw_ptr_or_raise()
+ * cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try: # <<<<<<<<<<<<<<
- * return raw.MemberSymbol(tostring(key))
- * except FstArgError:
+ * return _raw.MemberSymbol(tostring(key))
+ * except TypeError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_XGOTREF(__pyx_t_9);
/*try:*/ {
- /* "pywrapfst.pyx":801
- * cdef const_SymbolTable_ptr raw = self._raw_ptr_or_raise()
+ /* "pywrapfst.pyx":861
+ * cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try:
- * return raw.MemberSymbol(tostring(key)) # <<<<<<<<<<<<<<
- * except FstArgError:
- * return raw.MemberIndex(key)
+ * 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, 801, __pyx_L3_error)
- __pyx_r = __pyx_v_raw->Member(__pyx_t_10);
+ __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L3_error)
+ __pyx_r = __pyx_v__raw->Member(__pyx_t_10);
goto __pyx_L7_try_return;
- /* "pywrapfst.pyx":800
+ /* "pywrapfst.pyx":860
* """
- * cdef const_SymbolTable_ptr raw = self._raw_ptr_or_raise()
+ * cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try: # <<<<<<<<<<<<<<
- * return raw.MemberSymbol(tostring(key))
- * except FstArgError:
+ * return _raw.MemberSymbol(tostring(key))
+ * except TypeError:
*/
}
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "pywrapfst.pyx":802
+ /* "pywrapfst.pyx":862
* try:
- * return raw.MemberSymbol(tostring(key))
- * except FstArgError: # <<<<<<<<<<<<<<
- * return raw.MemberIndex(key)
+ * return _raw.MemberSymbol(tostring(key))
+ * except TypeError: # <<<<<<<<<<<<<<
+ * return _raw.MemberIndex(key)
*
*/
- __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_4);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_3);
- __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0;
+ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
if (__pyx_t_11) {
- __Pyx_AddTraceback("pywrapfst._SymbolTable.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 802, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GOTREF(__pyx_t_2);
+ __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)
__Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_t_3);
- /* "pywrapfst.pyx":803
- * return raw.MemberSymbol(tostring(key))
- * except FstArgError:
- * return raw.MemberIndex(key) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":863
+ * return _raw.MemberSymbol(tostring(key))
+ * except TypeError:
+ * return _raw.MemberIndex(key) # <<<<<<<<<<<<<<
*
- * def __contains__(self, 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, 803, __pyx_L5_except_error)
- __pyx_r = __pyx_v_raw->Member(__pyx_t_12);
+ __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_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;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
- /* "pywrapfst.pyx":800
+ /* "pywrapfst.pyx":860
* """
- * cdef const_SymbolTable_ptr raw = self._raw_ptr_or_raise()
+ * cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
* try: # <<<<<<<<<<<<<<
- * return raw.MemberSymbol(tostring(key))
- * except FstArgError:
+ * return _raw.MemberSymbol(tostring(key))
+ * except TypeError:
*/
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
goto __pyx_L0;
}
- /* "pywrapfst.pyx":783
+ /* "pywrapfst.pyx":843
* return self._raw_ptr_or_raise().LabeledCheckSum()
*
* cpdef bool member(self, key) except *: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_19member(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_18member[] = "\n member(self, key)\n\n Given a symbol or index, returns whether it is found in the table.\n\n This method returns a boolean indicating whether the given symbol or index\n is present in the table. If one intends to perform subsequent lookup, it is\n better to simply call the find method, catching the KeyError.\n\n Args:\n key: Either a string or an index.\n\n Returns:\n Whether or not the key is present (as a string or a index) in the table.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_19member(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_19member(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
+static char __pyx_doc_9pywrapfst_15SymbolTableView_18member[] = "\n member(self, key)\n\n Given a symbol or index, returns whether it is found in the table.\n\n This method returns a boolean indicating whether the given symbol or index\n is present in the table. If one intends to perform subsequent lookup, it is\n better to simply call the find method, catching the KeyError.\n\n Args:\n key: Either a string or an index.\n\n Returns:\n Whether or not the key is present (as a string or a index) in the table.\n ";
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_19member(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("member (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_18member(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v_key));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_18member(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), ((PyObject *)__pyx_v_key));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_18member(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_18member(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
bool __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("member", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_12_SymbolTable_member(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 783, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __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, 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_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":805
- * return raw.MemberIndex(key)
- *
- * def __contains__(self, key): # <<<<<<<<<<<<<<
- * return self.member(key)
- *
- */
-
-/* Python wrapper */
-static int __pyx_pw_9pywrapfst_12_SymbolTable_21__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static int __pyx_pw_9pywrapfst_12_SymbolTable_21__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_20__contains__(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v_key));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_9pywrapfst_12_SymbolTable_20__contains__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- bool __pyx_t_1;
- __Pyx_RefNannySetupContext("__contains__", 0);
-
- /* "pywrapfst.pyx":806
- *
- * def __contains__(self, key):
- * return self.member(key) # <<<<<<<<<<<<<<
- *
- * cpdef string name(self) except *:
- */
- if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "member");
- __PYX_ERR(0, 806, __pyx_L1_error)
- }
- __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->member(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 806, __pyx_L1_error)
- __pyx_r = __pyx_t_1;
- goto __pyx_L0;
-
- /* "pywrapfst.pyx":805
- * return raw.MemberIndex(key)
- *
- * def __contains__(self, key): # <<<<<<<<<<<<<<
- * return self.member(key)
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_AddTraceback("pywrapfst._SymbolTable.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "pywrapfst.pyx":808
- * return self.member(key)
+/* "pywrapfst.pyx":865
+ * return _raw.MemberIndex(key)
*
* cpdef string name(self) except *: # <<<<<<<<<<<<<<
* """
* name(self)
*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_23name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static std::string __pyx_f_9pywrapfst_12_SymbolTable_name(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_21name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static std::string __pyx_f_9pywrapfst_15SymbolTableView_name(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
std::string __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
fst::SymbolTable const *__pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("name", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 808, __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, 865, __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_12_SymbolTable_23name)) {
+ 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_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __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, 808, __pyx_L1_error)
+ __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_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":814
+ /* "pywrapfst.pyx":871
* 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, 814, __pyx_L1_error)
+ __PYX_ERR(0, 871, __pyx_L1_error)
}
- __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 814, __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_r = __pyx_t_6->Name();
goto __pyx_L0;
- /* "pywrapfst.pyx":808
- * return self.member(key)
+ /* "pywrapfst.pyx":865
+ * return _raw.MemberIndex(key)
*
* cpdef string name(self) except *: # <<<<<<<<<<<<<<
* """
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_pretend_to_initialize(&__pyx_r);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_23name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_22name[] = "\n name(self)\n\n Returns the symbol table's name.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_23name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_21name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_15SymbolTableView_20name[] = "\n name(self)\n\n Returns the symbol table's name.\n ";
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_21name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("name (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_22name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_20name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_22name(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_20name(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("name", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_12_SymbolTable_name(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 808, __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, 808, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":816
+/* "pywrapfst.pyx":873
* return self._raw_ptr_or_raise().Name()
*
* cpdef size_t num_symbols(self) except *: # <<<<<<<<<<<<<<
* num_symbols(self)
*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_25num_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static size_t __pyx_f_9pywrapfst_12_SymbolTable_num_symbols(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_23num_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static size_t __pyx_f_9pywrapfst_15SymbolTableView_num_symbols(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
size_t __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_4 = NULL;
size_t __pyx_t_5;
fst::SymbolTable const *__pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("num_symbols", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 816, __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, 873, __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_12_SymbolTable_25num_symbols)) {
+ 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_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __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, 816, __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, 873, __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":822
+ /* "pywrapfst.pyx":879
* 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, 822, __pyx_L1_error)
+ __PYX_ERR(0, 879, __pyx_L1_error)
}
- __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 822, __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_r = __pyx_t_6->NumSymbols();
goto __pyx_L0;
- /* "pywrapfst.pyx":816
+ /* "pywrapfst.pyx":873
* return self._raw_ptr_or_raise().Name()
*
* cpdef size_t num_symbols(self) except *: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.num_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.num_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_25num_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_24num_symbols[] = "\n num_symbols(self)\n\n Returns the number of symbols in the symbol table.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_25num_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_23num_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_15SymbolTableView_22num_symbols[] = "\n num_symbols(self)\n\n Returns the number of symbols in the symbol table.\n ";
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_23num_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("num_symbols (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_24num_symbols(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_22num_symbols(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_24num_symbols(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_22num_symbols(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
size_t __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("num_symbols", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_12_SymbolTable_num_symbols(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.num_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.num_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":824
+/* "pywrapfst.pyx":881
* return self._raw_ptr_or_raise().NumSymbols()
*
* cpdef void write(self, source) except *: # <<<<<<<<<<<<<<
* write(self, source)
*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_27write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
-static void __pyx_f_9pywrapfst_12_SymbolTable_write(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_25write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
+static void __pyx_f_9pywrapfst_15SymbolTableView_write(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch) {
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
fst::SymbolTable const *__pyx_t_5;
std::string __pyx_t_6;
int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 824, __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, 881, __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_12_SymbolTable_27write)) {
+ 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_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 824, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __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":838
+ /* "pywrapfst.pyx":895
* FstIOError: Write failed.
* """
- * if not self._raw_ptr_or_raise().Write(tostring(source)): # <<<<<<<<<<<<<<
- * raise FstIOError("Write failed: {!r}".format(source))
+ * if not self._raw_ptr_or_raise().Write(path_tostring(source)): # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Write failed: {source!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, 838, __pyx_L1_error)
+ __PYX_ERR(0, 895, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 838, __pyx_L1_error)
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 838, __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_7 = ((!(__pyx_t_5->Write(__pyx_t_6) != 0)) != 0);
if (unlikely(__pyx_t_7)) {
- /* "pywrapfst.pyx":839
+ /* "pywrapfst.pyx":896
* """
- * if not self._raw_ptr_or_raise().Write(tostring(source)):
- * raise FstIOError("Write failed: {!r}".format(source)) # <<<<<<<<<<<<<<
+ * 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, 839, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- }
- }
- __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_source);
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __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, 896, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
+ __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_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error)
+ __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)
__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, 839, __pyx_L1_error)
+ __PYX_ERR(0, 896, __pyx_L1_error)
- /* "pywrapfst.pyx":838
+ /* "pywrapfst.pyx":895
* FstIOError: Write failed.
* """
- * if not self._raw_ptr_or_raise().Write(tostring(source)): # <<<<<<<<<<<<<<
- * raise FstIOError("Write failed: {!r}".format(source))
+ * if not self._raw_ptr_or_raise().Write(path_tostring(source)): # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Write failed: {source!r}")
*
*/
}
- /* "pywrapfst.pyx":824
+ /* "pywrapfst.pyx":881
* return self._raw_ptr_or_raise().NumSymbols()
*
* cpdef void write(self, source) except *: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_27write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_26write[] = "\n write(self, source)\n\n Serializes symbol table to a file.\n\n This methods writes the SymbolTable to a file in binary format.\n\n Args:\n source: The string location of the output file.\n\n Raises:\n FstIOError: Write failed.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_27write(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_25write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
+static char __pyx_doc_9pywrapfst_15SymbolTableView_24write[] = "\n write(self, source)\n\n Serializes symbol table to a file.\n\n This methods writes the SymbolTable to a file in binary format.\n\n Args:\n source: The string location of the output file.\n\n Raises:\n FstIOError: Write failed.\n ";
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_25write(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_26write(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v_source));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_24write(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), ((PyObject *)__pyx_v_source));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_26write(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_source) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_24write(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source) {
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("write", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_12_SymbolTable_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 824, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":841
- * raise FstIOError("Write failed: {!r}".format(source))
+/* "pywrapfst.pyx":898
+ * raise FstIOError(f"Write failed: {source!r}")
*
* cpdef void write_text(self, source) except *: # <<<<<<<<<<<<<<
* """
* write_text(self, source)
*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_29write_text(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
-static void __pyx_f_9pywrapfst_12_SymbolTable_write_text(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_27write_text(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
+static void __pyx_f_9pywrapfst_15SymbolTableView_write_text(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch) {
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
fst::SymbolTable const *__pyx_t_5;
std::string __pyx_t_6;
int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 841, __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, 898, __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_12_SymbolTable_29write_text)) {
+ 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_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 841, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __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":855
+ /* "pywrapfst.pyx":912
* FstIOError: Write failed.
* """
- * if not self._raw_ptr_or_raise().WriteText(tostring(source)): # <<<<<<<<<<<<<<
- * raise FstIOError("Write failed: {!r}".format(source))
+ * if not self._raw_ptr_or_raise().WriteText(path_tostring(source)): # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Write failed: {source!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, 855, __pyx_L1_error)
+ __PYX_ERR(0, 912, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error)
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 855, __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_7 = ((!(__pyx_t_5->WriteText(__pyx_t_6) != 0)) != 0);
if (unlikely(__pyx_t_7)) {
- /* "pywrapfst.pyx":856
+ /* "pywrapfst.pyx":913
* """
- * if not self._raw_ptr_or_raise().WriteText(tostring(source)):
- * raise FstIOError("Write failed: {!r}".format(source)) # <<<<<<<<<<<<<<
+ * 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, 856, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- }
- }
- __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_source);
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __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, 913, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
+ __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_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
+ __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)
__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, 856, __pyx_L1_error)
+ __PYX_ERR(0, 913, __pyx_L1_error)
- /* "pywrapfst.pyx":855
+ /* "pywrapfst.pyx":912
* FstIOError: Write failed.
* """
- * if not self._raw_ptr_or_raise().WriteText(tostring(source)): # <<<<<<<<<<<<<<
- * raise FstIOError("Write failed: {!r}".format(source))
+ * if not self._raw_ptr_or_raise().WriteText(path_tostring(source)): # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Write failed: {source!r}")
*
*/
}
- /* "pywrapfst.pyx":841
- * raise FstIOError("Write failed: {!r}".format(source))
+ /* "pywrapfst.pyx":898
+ * raise FstIOError(f"Write failed: {source!r}")
*
* cpdef void write_text(self, source) except *: # <<<<<<<<<<<<<<
* """
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_29write_text(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_28write_text[] = "\n write_text(self, source)\n\n Writes symbol table to text file.\n\n This method writes the SymbolTable to a file in human-readable format.\n\n Args:\n source: The string location of the output file.\n\n Raises:\n FstIOError: Write failed.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_29write_text(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_27write_text(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
+static char __pyx_doc_9pywrapfst_15SymbolTableView_26write_text[] = "\n write_text(self, source)\n\n Writes symbol table to text file.\n\n This method writes the SymbolTable to a file in human-readable format.\n\n Args:\n source: The string location of the output file.\n\n Raises:\n FstIOError: Write failed.\n ";
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_27write_text(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_text (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_28write_text(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v_source));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_26write_text(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), ((PyObject *)__pyx_v_source));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_28write_text(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_source) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_26write_text(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source) {
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("write_text", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_12_SymbolTable_write_text(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 841, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 841, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":858
- * raise FstIOError("Write failed: {!r}".format(source))
+/* "pywrapfst.pyx":915
+ * raise FstIOError(f"Write failed: {source!r}")
*
* cpdef bytes write_to_string(self): # <<<<<<<<<<<<<<
* """
* write_to_string(self)
*/
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_31write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_f_9pywrapfst_12_SymbolTable_write_to_string(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch) {
- std::stringstream __pyx_v_sstrm;
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_29write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_9pywrapfst_15SymbolTableView_write_to_string(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
+ std::stringstream __pyx_v__sstrm;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_4 = NULL;
fst::SymbolTable const *__pyx_t_5;
int __pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_to_string", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 858, __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, 915, __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_12_SymbolTable_31write_to_string)) {
+ 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_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
}
__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, 858, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __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, 858, __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, 915, __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":871
+ /* "pywrapfst.pyx":928
* """
- * cdef stringstream sstrm
- * if not self._raw_ptr_or_raise().Write(sstrm): # <<<<<<<<<<<<<<
+ * cdef stringstream _sstrm
+ * if not self._raw_ptr_or_raise().Write(_sstrm): # <<<<<<<<<<<<<<
* raise FstIOError("Write to string failed")
- * return sstrm.str()
+ * return _sstrm.str()
*/
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, 928, __pyx_L1_error)
}
- __pyx_t_5 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__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 = ((!(__pyx_t_5->Write(__pyx_v_sstrm) != 0)) != 0);
+ __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_6 = ((!(__pyx_t_5->Write(__pyx_v__sstrm) != 0)) != 0);
if (unlikely(__pyx_t_6)) {
- /* "pywrapfst.pyx":872
- * cdef stringstream sstrm
- * if not self._raw_ptr_or_raise().Write(sstrm):
+ /* "pywrapfst.pyx":929
+ * cdef stringstream _sstrm
+ * if not self._raw_ptr_or_raise().Write(_sstrm):
* raise FstIOError("Write to string failed") # <<<<<<<<<<<<<<
- * return sstrm.str()
+ * return _sstrm.str()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __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, 872, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __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, 872, __pyx_L1_error)
+ __PYX_ERR(0, 929, __pyx_L1_error)
- /* "pywrapfst.pyx":871
+ /* "pywrapfst.pyx":928
* """
- * cdef stringstream sstrm
- * if not self._raw_ptr_or_raise().Write(sstrm): # <<<<<<<<<<<<<<
+ * cdef stringstream _sstrm
+ * if not self._raw_ptr_or_raise().Write(_sstrm): # <<<<<<<<<<<<<<
* raise FstIOError("Write to string failed")
- * return sstrm.str()
+ * return _sstrm.str()
*/
}
- /* "pywrapfst.pyx":873
- * if not self._raw_ptr_or_raise().Write(sstrm):
+ /* "pywrapfst.pyx":930
+ * if not self._raw_ptr_or_raise().Write(_sstrm):
* raise FstIOError("Write to string failed")
- * return sstrm.str() # <<<<<<<<<<<<<<
+ * 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, 873, __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, 930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":858
- * raise FstIOError("Write failed: {!r}".format(source))
+ /* "pywrapfst.pyx":915
+ * raise FstIOError(f"Write failed: {source!r}")
*
* cpdef bytes write_to_string(self): # <<<<<<<<<<<<<<
* """
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.write_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.write_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_31write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_12_SymbolTable_30write_to_string[] = "\n write_to_string(self)\n\n Serializes SymbolTable to a string.\n\n Returns:\n A bytestring.\n\n Raises:\n FstIOError: Write to string failed.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_31write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_29write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_15SymbolTableView_28write_to_string[] = "\n write_to_string(self)\n\n Serializes SymbolTable to a string.\n\n Returns:\n A bytestring.\n\n Raises:\n FstIOError: Write to string failed.\n ";
+static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_29write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_to_string (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_30write_to_string(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_28write_to_string(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_30write_to_string(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_28write_to_string(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
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("write_to_string", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_9pywrapfst_12_SymbolTable_write_to_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __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, 915, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("pywrapfst._SymbolTable.write_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("pywrapfst.SymbolTableView.write_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":891
+/* "pywrapfst.pyx":948
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<const EncodeMapper SymbolTableView {!r} at 0x{:x}>".format(
- * self.name(), id(self))
+ * return (f"<const EncodeMapper SymbolTableView {self.name()!r} "
+ * f"at 0x{id(self):x}>")
*/
/* Python wrapper */
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- std::string __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
+ std::string __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":892
+ /* "pywrapfst.pyx":949
*
* def __repr__(self):
- * return "<const EncodeMapper SymbolTableView {!r} at 0x{:x}>".format( # <<<<<<<<<<<<<<
- * self.name(), id(self))
+ * return (f"<const EncodeMapper SymbolTableView {self.name()!r} " # <<<<<<<<<<<<<<
+ * f"at 0x{id(self):x}>")
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_const_EncodeMapper_SymbolTableV, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u_const_EncodeMapper_SymbolTableV);
+ __pyx_t_2 += 36;
+ __Pyx_GIVEREF(__pyx_kp_u_const_EncodeMapper_SymbolTableV);
+ 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_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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __Pyx_INCREF(__pyx_kp_u_at_0x);
+ __pyx_t_2 += 6;
+ __Pyx_GIVEREF(__pyx_kp_u_at_0x);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_at_0x);
- /* "pywrapfst.pyx":893
+ /* "pywrapfst.pyx":950
* def __repr__(self):
- * return "<const EncodeMapper SymbolTableView {!r} at 0x{:x}>".format(
- * self.name(), id(self)) # <<<<<<<<<<<<<<
+ * return (f"<const EncodeMapper SymbolTableView {self.name()!r} "
+ * f"at 0x{id(self):x}>") # <<<<<<<<<<<<<<
*
* cdef const_SymbolTable_ptr _raw(self):
*/
- if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
- __PYX_ERR(0, 893, __pyx_L1_error)
- }
- __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 893, __pyx_L1_error)
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error)
+ __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_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_GOTREF(__pyx_t_5);
- __pyx_t_6 = NULL;
- __pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- __pyx_t_7 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 892, __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_4);
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
+ __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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__3);
+ __pyx_t_2 += 1;
+ __Pyx_GIVEREF(__pyx_kp_u__3);
+ PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
+
+ /* "pywrapfst.pyx":949
+ *
+ * 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_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":891
+ /* "pywrapfst.pyx":948
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<const EncodeMapper SymbolTableView {!r} at 0x{:x}>".format(
- * self.name(), id(self))
+ * return (f"<const EncodeMapper SymbolTableView {self.name()!r} "
+ * f"at 0x{id(self):x}>")
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("pywrapfst._EncodeMapperSymbolTableView.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":895
- * self.name(), id(self))
+/* "pywrapfst.pyx":952
+ * f"at 0x{id(self):x}>")
*
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
* return (self._mapper.get().InputSymbols() if self._input_side
__pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_r;
__Pyx_RefNannyDeclarations
fst::SymbolTable const *__pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_raw", 0);
- /* "pywrapfst.pyx":896
+ /* "pywrapfst.pyx":953
*
* 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, 896, __pyx_L1_error)
+ __PYX_ERR(0, 953, __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, 896, __pyx_L1_error)
+ __PYX_ERR(0, 953, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mapper.get()->InputSymbols();
} else {
- /* "pywrapfst.pyx":897
+ /* "pywrapfst.pyx":954
* 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, 897, __pyx_L1_error)
+ __PYX_ERR(0, 954, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mapper.get()->OutputSymbols();
}
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "pywrapfst.pyx":895
- * self.name(), id(self))
+ /* "pywrapfst.pyx":952
+ * f"at 0x{id(self):x}>")
*
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
* return (self._mapper.get().InputSymbols() if self._input_side
return __pyx_r;
}
-/* "pywrapfst.pyx":914
+/* "pywrapfst.pyx":971
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<const Fst SymbolTableView {!r} at 0x{:x}>".format(self.name(),
- * id(self))
+ * return (f"<const Fst SymbolTableView {self.name()!r} "
+ * f"at 0x{id(self):x}>")
*/
/* Python wrapper */
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- std::string __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
+ std::string __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":915
+ /* "pywrapfst.pyx":972
*
* def __repr__(self):
- * return "<const Fst SymbolTableView {!r} at 0x{:x}>".format(self.name(), # <<<<<<<<<<<<<<
- * id(self))
+ * return (f"<const Fst SymbolTableView {self.name()!r} " # <<<<<<<<<<<<<<
+ * f"at 0x{id(self):x}>")
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_const_Fst_SymbolTableView_r_at, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u_const_Fst_SymbolTableView);
+ __pyx_t_2 += 27;
+ __Pyx_GIVEREF(__pyx_kp_u_const_Fst_SymbolTableView);
+ 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, 915, __pyx_L1_error)
+ __PYX_ERR(0, 972, __pyx_L1_error)
}
- __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst__FstSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 915, __pyx_L1_error)
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 915, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __Pyx_INCREF(__pyx_kp_u_at_0x);
+ __pyx_t_2 += 6;
+ __Pyx_GIVEREF(__pyx_kp_u_at_0x);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_at_0x);
- /* "pywrapfst.pyx":916
+ /* "pywrapfst.pyx":973
* def __repr__(self):
- * return "<const Fst SymbolTableView {!r} at 0x{:x}>".format(self.name(),
- * id(self)) # <<<<<<<<<<<<<<
+ * return (f"<const Fst SymbolTableView {self.name()!r} "
+ * f"at 0x{id(self):x}>") # <<<<<<<<<<<<<<
*
* cdef const_SymbolTable_ptr _raw(self):
*/
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
+ __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_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_GOTREF(__pyx_t_5);
- __pyx_t_6 = NULL;
- __pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- __pyx_t_7 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 915, __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_4);
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
+ __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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__3);
+ __pyx_t_2 += 1;
+ __Pyx_GIVEREF(__pyx_kp_u__3);
+ PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
+
+ /* "pywrapfst.pyx":972
+ *
+ * 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_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":914
+ /* "pywrapfst.pyx":971
* # Doing so will allow undefined behavior.
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<const Fst SymbolTableView {!r} at 0x{:x}>".format(self.name(),
- * id(self))
+ * return (f"<const Fst SymbolTableView {self.name()!r} "
+ * f"at 0x{id(self):x}>")
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("pywrapfst._FstSymbolTableView.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":918
- * id(self))
+/* "pywrapfst.pyx":975
+ * f"at 0x{id(self):x}>")
*
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
* return (self._fst.get().InputSymbols() if self._input_side
__pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_r;
__Pyx_RefNannyDeclarations
fst::SymbolTable const *__pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_raw", 0);
- /* "pywrapfst.pyx":919
+ /* "pywrapfst.pyx":976
*
* 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, 919, __pyx_L1_error)
+ __PYX_ERR(0, 976, __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, 919, __pyx_L1_error)
+ __PYX_ERR(0, 976, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_fst.get()->InputSymbols();
} else {
- /* "pywrapfst.pyx":920
+ /* "pywrapfst.pyx":977
* 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, 920, __pyx_L1_error)
+ __PYX_ERR(0, 977, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_fst.get()->OutputSymbols();
}
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "pywrapfst.pyx":918
- * id(self))
+ /* "pywrapfst.pyx":975
+ * f"at 0x{id(self):x}>")
*
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
* return (self._fst.get().InputSymbols() if self._input_side
return __pyx_r;
}
-/* "pywrapfst.pyx":934
+/* "pywrapfst.pyx":991
* """
*
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_19_MutableSymbolTable__raw(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self) {
__pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_r;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_raw", 0);
- /* "pywrapfst.pyx":935
+ /* "pywrapfst.pyx":992
*
* 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, 935, __pyx_L1_error)
+ __PYX_ERR(0, 992, __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":934
+ /* "pywrapfst.pyx":991
* """
*
* cdef const_SymbolTable_ptr _raw(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":941
+/* "pywrapfst.pyx":998
* # 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":942
+ /* "pywrapfst.pyx":999
* # 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":941
+ /* "pywrapfst.pyx":998
* # 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":946
+/* "pywrapfst.pyx":1003
* # 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 *: # <<<<<<<<<<<<<<
__pyx_t_9pywrapfst_SymbolTable_ptr __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_mutable_raw_ptr_or_raise", 0);
- /* "pywrapfst.pyx":947
+ /* "pywrapfst.pyx":1004
* # 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, 947, __pyx_L1_error)
+ __PYX_ERR(0, 1004, __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":948
+ /* "pywrapfst.pyx":1005
* 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":949
+ /* "pywrapfst.pyx":1006
* 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, 949, __pyx_L1_error)
+ __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__SymbolTable *)__pyx_v_self)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 949, __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)
- /* "pywrapfst.pyx":948
+ /* "pywrapfst.pyx":1005
* cdef SymbolTable_ptr _mutable_raw_ptr_or_raise(self) except *:
* cdef SymbolTable_ptr mutable_raw = self._mutable_raw()
* if mutable_raw == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":950
+ /* "pywrapfst.pyx":1007
* if mutable_raw == NULL:
* self._raise_nonexistent()
* return mutable_raw # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_mutable_raw;
goto __pyx_L0;
- /* "pywrapfst.pyx":946
+ /* "pywrapfst.pyx":1003
* # 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":952
+/* "pywrapfst.pyx":1009
* return mutable_raw
*
* cpdef int64 add_symbol(self, symbol, int64 key=fst.kNoSymbol) except *: # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int64 __pyx_f_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args) {
- int64 __pyx_v_key = __pyx_k__3;
+ int64 __pyx_v_key = __pyx_k__6;
+ __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_v__mutable_raw;
std::string __pyx_v__symbol;
- __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_v_mutable_raw;
int64 __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
int64 __pyx_t_8;
- std::string __pyx_t_9;
- fst::SymbolTable *__pyx_t_10;
+ fst::SymbolTable *__pyx_t_9;
+ std::string __pyx_t_10;
int __pyx_t_11;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add_symbol", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
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, 952, __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, 1009, __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, 952, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __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, 952, __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, 1009, __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, 952, __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, 1009, __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, 952, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1009, __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, 952, __pyx_L1_error)
+ __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_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, 952, __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, 1009, __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":969
+ /* "pywrapfst.pyx":1026
* The integer key of the new symbol.
* """
- * cdef string _symbol = tostring(symbol) # <<<<<<<<<<<<<<
- * cdef SymbolTable_ptr mutable_raw = self._mutable_raw_ptr_or_raise()
- * if key != fst.kNoSymbol:
- */
- __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_symbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L1_error)
- __pyx_v__symbol = __pyx_t_9;
-
- /* "pywrapfst.pyx":970
- * """
+ * cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise() # <<<<<<<<<<<<<<
* cdef string _symbol = tostring(symbol)
- * cdef SymbolTable_ptr mutable_raw = self._mutable_raw_ptr_or_raise() # <<<<<<<<<<<<<<
* if key != fst.kNoSymbol:
- * return mutable_raw.AddSymbol(_symbol, key)
*/
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, 970, __pyx_L1_error)
+ __PYX_ERR(0, 1026, __pyx_L1_error)
}
- __pyx_t_10 = ((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, 970, __pyx_L1_error)
- __pyx_v_mutable_raw = __pyx_t_10;
+ __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_v__mutable_raw = __pyx_t_9;
- /* "pywrapfst.pyx":971
+ /* "pywrapfst.pyx":1027
+ * """
+ * 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_v__symbol = __pyx_t_10;
+
+ /* "pywrapfst.pyx":1028
+ * cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
* cdef string _symbol = tostring(symbol)
- * cdef SymbolTable_ptr mutable_raw = self._mutable_raw_ptr_or_raise()
* if key != fst.kNoSymbol: # <<<<<<<<<<<<<<
- * return mutable_raw.AddSymbol(_symbol, key)
+ * return _mutable_raw.AddSymbol(_symbol, key)
* else:
*/
__pyx_t_11 = ((__pyx_v_key != fst::kNoSymbol) != 0);
if (__pyx_t_11) {
- /* "pywrapfst.pyx":972
- * cdef SymbolTable_ptr mutable_raw = self._mutable_raw_ptr_or_raise()
+ /* "pywrapfst.pyx":1029
+ * cdef string _symbol = tostring(symbol)
* if key != fst.kNoSymbol:
- * return mutable_raw.AddSymbol(_symbol, key) # <<<<<<<<<<<<<<
+ * return _mutable_raw.AddSymbol(_symbol, key) # <<<<<<<<<<<<<<
* else:
- * return mutable_raw.AddSymbol(_symbol)
+ * return _mutable_raw.AddSymbol(_symbol)
*/
- __pyx_r = __pyx_v_mutable_raw->AddSymbol(__pyx_v__symbol, __pyx_v_key);
+ __pyx_r = __pyx_v__mutable_raw->AddSymbol(__pyx_v__symbol, __pyx_v_key);
goto __pyx_L0;
- /* "pywrapfst.pyx":971
+ /* "pywrapfst.pyx":1028
+ * cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
* cdef string _symbol = tostring(symbol)
- * cdef SymbolTable_ptr mutable_raw = self._mutable_raw_ptr_or_raise()
* if key != fst.kNoSymbol: # <<<<<<<<<<<<<<
- * return mutable_raw.AddSymbol(_symbol, key)
+ * return _mutable_raw.AddSymbol(_symbol, key)
* else:
*/
}
- /* "pywrapfst.pyx":974
- * return mutable_raw.AddSymbol(_symbol, key)
+ /* "pywrapfst.pyx":1031
+ * return _mutable_raw.AddSymbol(_symbol, key)
* else:
- * return mutable_raw.AddSymbol(_symbol) # <<<<<<<<<<<<<<
+ * return _mutable_raw.AddSymbol(_symbol) # <<<<<<<<<<<<<<
*
- * cpdef void add_table(self, _SymbolTable syms) except *:
+ * cpdef void add_table(self, SymbolTableView symbols) except *:
*/
/*else*/ {
- __pyx_r = __pyx_v_mutable_raw->AddSymbol(__pyx_v__symbol);
+ __pyx_r = __pyx_v__mutable_raw->AddSymbol(__pyx_v__symbol);
goto __pyx_L0;
}
- /* "pywrapfst.pyx":952
+ /* "pywrapfst.pyx":1009
* return mutable_raw
*
* cpdef int64 add_symbol(self, symbol, int64 key=fst.kNoSymbol) except *: # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_symbol = 0;
int64 __pyx_v_key;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_symbol (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symbol") < 0)) __PYX_ERR(0, 952, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symbol") < 0)) __PYX_ERR(0, 1009, __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, 952, __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, 1009, __pyx_L3_error)
} else {
- __pyx_v_key = __pyx_k__3;
+ __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, 952, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add_symbol", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1009, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._MutableSymbolTable.add_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int64 __pyx_t_1;
struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add_symbol", 0);
__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, 952, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 952, __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, 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_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":976
- * return mutable_raw.AddSymbol(_symbol)
+/* "pywrapfst.pyx":1033
+ * return _mutable_raw.AddSymbol(_symbol)
*
- * cpdef void add_table(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
+ * cpdef void add_table(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
* """
- * add_table(self, syms)
+ * add_table(self, symbols)
*/
-static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
-static void __pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms, int __pyx_skip_dispatch) {
+static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols); /*proto*/
+static void __pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols, int __pyx_skip_dispatch) {
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_4 = NULL;
fst::SymbolTable *__pyx_t_5;
fst::SymbolTable const *__pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add_table", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 976, __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, 1033, __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_DECREF_SET(__pyx_t_3, function);
}
}
- __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_syms)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_syms));
+ __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, 976, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __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":988
- * syms: A SymbolTable to be merged with the current table.
+ /* "pywrapfst.pyx":1045
+ * symbols: A SymbolTable to be merged with the current table.
* """
- * self._mutable_raw_ptr_or_raise().AddTable(deref(syms._raw_ptr_or_raise())) # <<<<<<<<<<<<<<
+ * self._mutable_raw_ptr_or_raise().AddTable( # <<<<<<<<<<<<<<
+ * deref(symbols._raw_ptr_or_raise()))
*
- * cpdef void set_name(self, new_name) except *:
*/
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, 988, __pyx_L1_error)
+ __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, 988, __pyx_L1_error)
- if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
+ __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)
+
+ /* "pywrapfst.pyx":1046
+ * """
+ * self._mutable_raw_ptr_or_raise().AddTable(
+ * deref(symbols._raw_ptr_or_raise())) # <<<<<<<<<<<<<<
+ *
+ * cpdef void set_name(self, new_name) except *:
+ */
+ 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, 988, __pyx_L1_error)
+ __PYX_ERR(0, 1046, __pyx_L1_error)
}
- __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_syms->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 988, __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)
+
+ /* "pywrapfst.pyx":1045
+ * symbols: A SymbolTable to be merged with the current table.
+ * """
+ * self._mutable_raw_ptr_or_raise().AddTable( # <<<<<<<<<<<<<<
+ * deref(symbols._raw_ptr_or_raise()))
+ *
+ */
__pyx_t_5->AddTable((*__pyx_t_6));
- /* "pywrapfst.pyx":976
- * return mutable_raw.AddSymbol(_symbol)
+ /* "pywrapfst.pyx":1033
+ * return _mutable_raw.AddSymbol(_symbol)
*
- * cpdef void add_table(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
+ * cpdef void add_table(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
* """
- * add_table(self, syms)
+ * add_table(self, symbols)
*/
/* function exit code */
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
-static char __pyx_doc_9pywrapfst_19_MutableSymbolTable_2add_table[] = "\n add_table(self, syms)\n\n Adds another SymbolTable to this table.\n\n This method merges another symbol table into the current table. All key\n values will be offset by the current available key.\n\n Args:\n syms: A SymbolTable to be merged with the current table.\n ";
-static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
+static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols); /*proto*/
+static char __pyx_doc_9pywrapfst_19_MutableSymbolTable_2add_table[] = "\n add_table(self, symbols)\n\n Adds another SymbolTable to this table.\n\n This method merges another symbol table into the current table. All key\n values will be offset by the current available key.\n\n Args:\n symbols: A SymbolTable to be merged with the current table.\n ";
+static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_table (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 976, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_19_MutableSymbolTable_2add_table(((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1033, __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 */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_2add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_2add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
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("add_table", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(__pyx_v_self, __pyx_v_syms, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":990
- * self._mutable_raw_ptr_or_raise().AddTable(deref(syms._raw_ptr_or_raise()))
+/* "pywrapfst.pyx":1048
+ * deref(symbols._raw_ptr_or_raise()))
*
* cpdef void set_name(self, new_name) except *: # <<<<<<<<<<<<<<
* self._mutable_raw_ptr_or_raise().SetName(tostring(new_name))
PyObject *__pyx_t_4 = NULL;
fst::SymbolTable *__pyx_t_5;
std::string __pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_name", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 990, __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, 1048, __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, 990, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __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":991
+ /* "pywrapfst.pyx":1049
*
* 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, 991, __pyx_L1_error)
+ __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, 991, __pyx_L1_error)
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_new_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 991, __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->SetName(__pyx_t_6);
- /* "pywrapfst.pyx":990
- * self._mutable_raw_ptr_or_raise().AddTable(deref(syms._raw_ptr_or_raise()))
+ /* "pywrapfst.pyx":1048
+ * deref(symbols._raw_ptr_or_raise()))
*
* cpdef void set_name(self, new_name) except *: # <<<<<<<<<<<<<<
* self._mutable_raw_ptr_or_raise().SetName(tostring(new_name))
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("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, 990, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __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, 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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1001
+/* "pywrapfst.pyx":1059
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<Fst SymbolTableView {!r} at 0x{:x}>".format(self.name(), id(self))
+ * return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>"
*
*/
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- std::string __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
+ std::string __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1002
+ /* "pywrapfst.pyx":1060
*
* def __repr__(self):
- * return "<Fst SymbolTableView {!r} at 0x{:x}>".format(self.name(), id(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_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Fst_SymbolTableView_r_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u_Fst_SymbolTableView);
+ __pyx_t_2 += 21;
+ __Pyx_GIVEREF(__pyx_kp_u_Fst_SymbolTableView);
+ 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, 1002, __pyx_L1_error)
+ __PYX_ERR(0, 1060, __pyx_L1_error)
}
- __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1002, __pyx_L1_error)
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1002, __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_GOTREF(__pyx_t_5);
- __pyx_t_6 = NULL;
- __pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- __pyx_t_7 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1002, __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_4);
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
+ __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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __Pyx_INCREF(__pyx_kp_u_at_0x);
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__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_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":1001
+ /* "pywrapfst.pyx":1059
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<Fst SymbolTableView {!r} at 0x{:x}>".format(self.name(), id(self))
+ * return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>"
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("pywrapfst._MutableFstSymbolTableView.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1004
- * return "<Fst SymbolTableView {!r} at 0x{:x}>".format(self.name(), id(self))
+/* "pywrapfst.pyx":1062
+ * return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>"
*
* cdef SymbolTable_ptr _mutable_raw(self): # <<<<<<<<<<<<<<
* return (self._mfst.get().MutableInputSymbols() if self._input_side else
__pyx_t_9pywrapfst_SymbolTable_ptr __pyx_r;
__Pyx_RefNannyDeclarations
fst::SymbolTable *__pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_mutable_raw", 0);
- /* "pywrapfst.pyx":1005
+ /* "pywrapfst.pyx":1063
*
* 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, 1005, __pyx_L1_error)
+ __PYX_ERR(0, 1063, __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, 1005, __pyx_L1_error)
+ __PYX_ERR(0, 1063, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->MutableInputSymbols();
} else {
- /* "pywrapfst.pyx":1006
+ /* "pywrapfst.pyx":1064
* 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, 1006, __pyx_L1_error)
+ __PYX_ERR(0, 1064, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->MutableOutputSymbols();
}
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "pywrapfst.pyx":1004
- * return "<Fst SymbolTableView {!r} at 0x{:x}>".format(self.name(), id(self))
+ /* "pywrapfst.pyx":1062
+ * return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>"
*
* cdef SymbolTable_ptr _mutable_raw(self): # <<<<<<<<<<<<<<
* return (self._mfst.get().MutableInputSymbols() if self._input_side else
return __pyx_r;
}
-/* "pywrapfst.pyx":1026
+/* "pywrapfst.pyx":1084
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))
+ * return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"
*
*/
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- std::string __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
+ std::string __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1027
+ /* "pywrapfst.pyx":1085
*
* def __repr__(self):
- * return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self)) # <<<<<<<<<<<<<<
+ * return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>" # <<<<<<<<<<<<<<
*
* def __init__(self, name="<unspecified>"):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_SymbolTable_r_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1027, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1085, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u_SymbolTable);
+ __pyx_t_2 += 13;
+ __Pyx_GIVEREF(__pyx_kp_u_SymbolTable);
+ 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, 1027, __pyx_L1_error)
+ __PYX_ERR(0, 1085, __pyx_L1_error)
}
- __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1027, __pyx_L1_error)
- __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1027, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1027, __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_GOTREF(__pyx_t_5);
- __pyx_t_6 = NULL;
- __pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- __pyx_t_7 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1027, __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_4);
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
+ __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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __Pyx_INCREF(__pyx_kp_u_at_0x);
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__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_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":1026
+ /* "pywrapfst.pyx":1084
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))
+ * return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("pywrapfst.SymbolTable.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1029
- * return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))
+/* "pywrapfst.pyx":1087
+ * return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"
*
* def __init__(self, name="<unspecified>"): # <<<<<<<<<<<<<<
* self._smart_table.reset(new fst.SymbolTable(tostring(name)))
static int __pyx_pw_9pywrapfst_11SymbolTable_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_11SymbolTable_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1029, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1087, __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, 1029, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1087, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.SymbolTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_r;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":1030
+ /* "pywrapfst.pyx":1088
*
* 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, 1030, __pyx_L1_error)
+ __PYX_ERR(0, 1088, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1030, __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_v_self->_smart_table.reset(new fst::SymbolTable(__pyx_t_1));
- /* "pywrapfst.pyx":1029
- * return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))
+ /* "pywrapfst.pyx":1087
+ * return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"
*
* def __init__(self, name="<unspecified>"): # <<<<<<<<<<<<<<
* self._smart_table.reset(new fst.SymbolTable(tostring(name)))
return __pyx_r;
}
-/* "pywrapfst.pyx":1032
+/* "pywrapfst.pyx":1090
* self._smart_table.reset(new fst.SymbolTable(tostring(name)))
*
* cdef SymbolTable_ptr _mutable_raw(self): # <<<<<<<<<<<<<<
static __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_11SymbolTable__mutable_raw(struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self) {
__pyx_t_9pywrapfst_SymbolTable_ptr __pyx_r;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_mutable_raw", 0);
- /* "pywrapfst.pyx":1033
+ /* "pywrapfst.pyx":1091
*
* 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, 1033, __pyx_L1_error)
+ __PYX_ERR(0, 1091, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_smart_table.get();
goto __pyx_L0;
- /* "pywrapfst.pyx":1032
+ /* "pywrapfst.pyx":1090
* self._smart_table.reset(new fst.SymbolTable(tostring(name)))
*
* cdef SymbolTable_ptr _mutable_raw(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1036
+/* "pywrapfst.pyx":1094
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
}
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_4read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source) {
- std::unique_ptr<fst::SymbolTable> __pyx_v_syms;
+ std::unique_ptr<fst::SymbolTable> __pyx_v__symbols;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read", 0);
- /* "pywrapfst.pyx":1051
+ /* "pywrapfst.pyx":1109
* """
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.SymbolTable.Read(tostring(source))) # <<<<<<<<<<<<<<
- * if syms.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source))
+ * 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_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1051, __pyx_L1_error)
- __pyx_v_syms.reset(fst::SymbolTable::Read(__pyx_t_1));
+ __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1109, __pyx_L1_error)
+ __pyx_v__symbols.reset(fst::SymbolTable::Read(__pyx_t_1));
- /* "pywrapfst.pyx":1052
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.SymbolTable.Read(tostring(source)))
- * if syms.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_SymbolTable(move(syms))
+ /* "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}")
+ * return _init_SymbolTable(move(_symbols))
*/
- __pyx_t_2 = ((__pyx_v_syms.get() == NULL) != 0);
+ __pyx_t_2 = ((__pyx_v__symbols.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1053
- * syms.reset(fst.SymbolTable.Read(tostring(source)))
- * if syms.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source)) # <<<<<<<<<<<<<<
- * return _init_SymbolTable(move(syms))
+ /* "pywrapfst.pyx":1111
+ * _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, 1053, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1053, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1053, __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, 1111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
+ __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_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
+ __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_6);
+ __Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __pyx_L1_error)
+ __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)
__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, 1053, __pyx_L1_error)
+ __PYX_ERR(0, 1111, __pyx_L1_error)
- /* "pywrapfst.pyx":1052
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.SymbolTable.Read(tostring(source)))
- * if syms.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_SymbolTable(move(syms))
+ /* "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}")
+ * return _init_SymbolTable(move(_symbols))
*/
}
- /* "pywrapfst.pyx":1054
- * if syms.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_SymbolTable(move(syms)) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1112
+ * 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_syms))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1054, __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, 1112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1036
+ /* "pywrapfst.pyx":1094
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst.SymbolTable.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1057
+/* "pywrapfst.pyx":1115
*
* @classmethod
* def read_text(cls, source, bool allow_negative_labels=False): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_7read_text(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_source = 0;
bool __pyx_v_allow_negative_labels;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_text (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_text") < 0)) __PYX_ERR(0, 1057, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_text") < 0)) __PYX_ERR(0, 1115, __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, 1057, __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, 1115, __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, 1057, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_text", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1115, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.SymbolTable.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
}
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_6read_text(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, bool __pyx_v_allow_negative_labels) {
- std::unique_ptr<fst::SymbolTableTextOptions> __pyx_v_opts;
- std::unique_ptr<fst::SymbolTable> __pyx_v_syms;
+ std::unique_ptr<fst::SymbolTableTextOptions> __pyx_v__opts;
+ std::unique_ptr<fst::SymbolTable> __pyx_v__symbols;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "pywrapfst.pyx":1074
+ /* "pywrapfst.pyx":1132
* """
- * cdef unique_ptr[fst.SymbolTableTextOptions] opts
- * opts.reset(new fst.SymbolTableTextOptions(allow_negative_labels)) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.SymbolTable.ReadText(tostring(source), deref(opts)))
- */
- __pyx_v_opts.reset(new fst::SymbolTableTextOptions(__pyx_v_allow_negative_labels));
-
- /* "pywrapfst.pyx":1076
- * opts.reset(new fst.SymbolTableTextOptions(allow_negative_labels))
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.SymbolTable.ReadText(tostring(source), deref(opts))) # <<<<<<<<<<<<<<
- * if syms.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source))
+ * cdef unique_ptr[fst.SymbolTableTextOptions] _opts
+ * _opts.reset(new fst.SymbolTableTextOptions(allow_negative_labels)) # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.SymbolTable] _symbols
+ * _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source),
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1076, __pyx_L1_error)
- __pyx_v_syms.reset(fst::SymbolTable::ReadText(__pyx_t_1, (*__pyx_v_opts)));
+ __pyx_v__opts.reset(new fst::SymbolTableTextOptions(__pyx_v_allow_negative_labels));
- /* "pywrapfst.pyx":1077
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.SymbolTable.ReadText(tostring(source), deref(opts)))
- * if syms.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_SymbolTable(move(syms))
- */
- __pyx_t_2 = ((__pyx_v_syms.get() == NULL) != 0);
+ /* "pywrapfst.pyx":1134
+ * _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)
+
+ /* "pywrapfst.pyx":1135
+ * cdef unique_ptr[fst.SymbolTable] _symbols
+ * _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source),
+ * deref(_opts))) # <<<<<<<<<<<<<<
+ * if _symbols.get() == NULL:
+ * raise FstIOError(f"Read failed: {source!r}")
+ */
+ __pyx_v__symbols.reset(fst::SymbolTable::ReadText(__pyx_t_1, (*__pyx_v__opts)));
+
+ /* "pywrapfst.pyx":1136
+ * _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source),
+ * deref(_opts)))
+ * if _symbols.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Read failed: {source!r}")
+ * return _init_SymbolTable(move(_symbols))
+ */
+ __pyx_t_2 = ((__pyx_v__symbols.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1078
- * syms.reset(fst.SymbolTable.ReadText(tostring(source), deref(opts)))
- * if syms.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source)) # <<<<<<<<<<<<<<
- * return _init_SymbolTable(move(syms))
+ /* "pywrapfst.pyx":1137
+ * 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, 1078, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1078, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1078, __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, 1137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
+ __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_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
+ __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_6);
+ __Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1078, __pyx_L1_error)
+ __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)
__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, 1078, __pyx_L1_error)
+ __PYX_ERR(0, 1137, __pyx_L1_error)
- /* "pywrapfst.pyx":1077
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.SymbolTable.ReadText(tostring(source), deref(opts)))
- * if syms.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_SymbolTable(move(syms))
+ /* "pywrapfst.pyx":1136
+ * _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source),
+ * deref(_opts)))
+ * if _symbols.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Read failed: {source!r}")
+ * return _init_SymbolTable(move(_symbols))
*/
}
- /* "pywrapfst.pyx":1079
- * if syms.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_SymbolTable(move(syms)) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1138
+ * 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_syms))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1079, __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, 1138, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1057
+ /* "pywrapfst.pyx":1115
*
* @classmethod
* def read_text(cls, source, bool allow_negative_labels=False): # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst.SymbolTable.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1082
+/* "pywrapfst.pyx":1141
*
* @classmethod
* def read_fst(cls, source, bool input_table): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_9read_fst(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_source = 0;
bool __pyx_v_input_table;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_fst (wrapper)", 0);
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, 1082, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, 1); __PYX_ERR(0, 1141, __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, 1082, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_fst") < 0)) __PYX_ERR(0, 1141, __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, 1082, __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, 1141, __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, 1082, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1141, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.SymbolTable.read_fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
}
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_8read_fst(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, bool __pyx_v_input_table) {
- std::unique_ptr<fst::SymbolTable> __pyx_v_syms;
+ std::unique_ptr<fst::SymbolTable> __pyx_v__symbols;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_fst", 0);
- /* "pywrapfst.pyx":1103
+ /* "pywrapfst.pyx":1162
* """
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.FstReadSymbols(tostring(source), input_table)) # <<<<<<<<<<<<<<
- * if syms.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source))
+ * 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_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1103, __pyx_L1_error)
- __pyx_v_syms.reset(fst::FstReadSymbols(__pyx_t_1, __pyx_v_input_table));
+ __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1162, __pyx_L1_error)
+ __pyx_v__symbols.reset(fst::FstReadSymbols(__pyx_t_1, __pyx_v_input_table));
- /* "pywrapfst.pyx":1104
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.FstReadSymbols(tostring(source), input_table))
- * if syms.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_SymbolTable(move(syms))
+ /* "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}")
+ * return _init_SymbolTable(move(_symbols))
*/
- __pyx_t_2 = ((__pyx_v_syms.get() == NULL) != 0);
+ __pyx_t_2 = ((__pyx_v__symbols.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1105
- * syms.reset(fst.FstReadSymbols(tostring(source), input_table))
- * if syms.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source)) # <<<<<<<<<<<<<<
- * return _init_SymbolTable(move(syms))
+ /* "pywrapfst.pyx":1164
+ * _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, 1105, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1105, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1105, __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, 1164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
+ __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_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
+ __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_6);
+ __Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1105, __pyx_L1_error)
+ __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)
__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, 1105, __pyx_L1_error)
+ __PYX_ERR(0, 1164, __pyx_L1_error)
- /* "pywrapfst.pyx":1104
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.FstReadSymbols(tostring(source), input_table))
- * if syms.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_SymbolTable(move(syms))
+ /* "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}")
+ * return _init_SymbolTable(move(_symbols))
*/
}
- /* "pywrapfst.pyx":1106
- * if syms.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_SymbolTable(move(syms)) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1165
+ * 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_syms))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1106, __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, 1165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1082
+ /* "pywrapfst.pyx":1141
*
* @classmethod
* def read_fst(cls, source, bool input_table): # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst.SymbolTable.read_fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1109
+/* "pywrapfst.pyx":1168
*
*
* cdef _EncodeMapperSymbolTableView _init_EncodeMapperSymbolTableView( # <<<<<<<<<<<<<<
* shared_ptr[fst.EncodeMapperClass] mapper, bool input_side):
- * cdef _EncodeMapperSymbolTableView result = (
+ * cdef _EncodeMapperSymbolTableView _symbols = (
*/
static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_9pywrapfst__init_EncodeMapperSymbolTableView(std::shared_ptr<fst::script::EncodeMapperClass> __pyx_v_mapper, bool __pyx_v_input_side) {
- struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v__symbols = 0;
struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__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("_init_EncodeMapperSymbolTableView", 0);
- /* "pywrapfst.pyx":1112
+ /* "pywrapfst.pyx":1171
* shared_ptr[fst.EncodeMapperClass] mapper, bool input_side):
- * cdef _EncodeMapperSymbolTableView result = (
+ * cdef _EncodeMapperSymbolTableView _symbols = (
* _EncodeMapperSymbolTableView.__new__(_EncodeMapperSymbolTableView)) # <<<<<<<<<<<<<<
- * result._mapper = move(mapper)
- * result._input_side = input_side
+ * _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, 1112, __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, 1171, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
+ __pyx_v__symbols = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1113
- * cdef _EncodeMapperSymbolTableView result = (
+ /* "pywrapfst.pyx":1172
+ * cdef _EncodeMapperSymbolTableView _symbols = (
* _EncodeMapperSymbolTableView.__new__(_EncodeMapperSymbolTableView))
- * result._mapper = move(mapper) # <<<<<<<<<<<<<<
- * result._input_side = input_side
- * return result
+ * _symbols._mapper = move(mapper) # <<<<<<<<<<<<<<
+ * _symbols._input_side = input_side
+ * return _symbols
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1113, __pyx_L1_error)
+ __PYX_ERR(0, 1172, __pyx_L1_error)
}
- __pyx_v_result->_mapper = fst::move<std::shared_ptr<fst::script::EncodeMapperClass> >(__pyx_v_mapper);
+ __pyx_v__symbols->_mapper = fst::move<std::shared_ptr<fst::script::EncodeMapperClass> >(__pyx_v_mapper);
- /* "pywrapfst.pyx":1114
+ /* "pywrapfst.pyx":1173
* _EncodeMapperSymbolTableView.__new__(_EncodeMapperSymbolTableView))
- * result._mapper = move(mapper)
- * result._input_side = input_side # <<<<<<<<<<<<<<
- * return result
+ * _symbols._mapper = move(mapper)
+ * _symbols._input_side = input_side # <<<<<<<<<<<<<<
+ * return _symbols
*
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
- __PYX_ERR(0, 1114, __pyx_L1_error)
+ __PYX_ERR(0, 1173, __pyx_L1_error)
}
- __pyx_v_result->_input_side = __pyx_v_input_side;
+ __pyx_v__symbols->_input_side = __pyx_v_input_side;
- /* "pywrapfst.pyx":1115
- * result._mapper = move(mapper)
- * result._input_side = input_side
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1174
+ * _symbols._mapper = move(mapper)
+ * _symbols._input_side = input_side
+ * return _symbols # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
+ __Pyx_INCREF(((PyObject *)__pyx_v__symbols));
+ __pyx_r = __pyx_v__symbols;
goto __pyx_L0;
- /* "pywrapfst.pyx":1109
+ /* "pywrapfst.pyx":1168
*
*
* cdef _EncodeMapperSymbolTableView _init_EncodeMapperSymbolTableView( # <<<<<<<<<<<<<<
* shared_ptr[fst.EncodeMapperClass] mapper, bool input_side):
- * cdef _EncodeMapperSymbolTableView result = (
+ * cdef _EncodeMapperSymbolTableView _symbols = (
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst._init_EncodeMapperSymbolTableView", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__symbols);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":1118
+/* "pywrapfst.pyx":1177
*
*
* cdef _FstSymbolTableView _init_FstSymbolTableView(shared_ptr[fst.FstClass] ifst, # <<<<<<<<<<<<<<
* bool input_side):
- * cdef _FstSymbolTableView result = (
+ * cdef _FstSymbolTableView _symbols = (
*/
static struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_f_9pywrapfst__init_FstSymbolTableView(std::shared_ptr<fst::script::FstClass> __pyx_v_ifst, bool __pyx_v_input_side) {
- struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_v__symbols = 0;
struct __pyx_obj_9pywrapfst__FstSymbolTableView *__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("_init_FstSymbolTableView", 0);
- /* "pywrapfst.pyx":1121
+ /* "pywrapfst.pyx":1180
* bool input_side):
- * cdef _FstSymbolTableView result = (
+ * cdef _FstSymbolTableView _symbols = (
* _FstSymbolTableView.__new__(_FstSymbolTableView)) # <<<<<<<<<<<<<<
- * result._fst = move(ifst)
- * result._input_side = input_side
+ * _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, 1121, __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, 1180, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
+ __pyx_v__symbols = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1122
- * cdef _FstSymbolTableView result = (
+ /* "pywrapfst.pyx":1181
+ * cdef _FstSymbolTableView _symbols = (
* _FstSymbolTableView.__new__(_FstSymbolTableView))
- * result._fst = move(ifst) # <<<<<<<<<<<<<<
- * result._input_side = input_side
- * return result
+ * _symbols._fst = move(ifst) # <<<<<<<<<<<<<<
+ * _symbols._input_side = input_side
+ * return _symbols
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1122, __pyx_L1_error)
+ __PYX_ERR(0, 1181, __pyx_L1_error)
}
- __pyx_v_result->_fst = fst::move<std::shared_ptr<fst::script::FstClass> >(__pyx_v_ifst);
+ __pyx_v__symbols->_fst = fst::move<std::shared_ptr<fst::script::FstClass> >(__pyx_v_ifst);
- /* "pywrapfst.pyx":1123
+ /* "pywrapfst.pyx":1182
* _FstSymbolTableView.__new__(_FstSymbolTableView))
- * result._fst = move(ifst)
- * result._input_side = input_side # <<<<<<<<<<<<<<
- * return result
+ * _symbols._fst = move(ifst)
+ * _symbols._input_side = input_side # <<<<<<<<<<<<<<
+ * return _symbols
*
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
- __PYX_ERR(0, 1123, __pyx_L1_error)
+ __PYX_ERR(0, 1182, __pyx_L1_error)
}
- __pyx_v_result->_input_side = __pyx_v_input_side;
+ __pyx_v__symbols->_input_side = __pyx_v_input_side;
- /* "pywrapfst.pyx":1124
- * result._fst = move(ifst)
- * result._input_side = input_side
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1183
+ * _symbols._fst = move(ifst)
+ * _symbols._input_side = input_side
+ * return _symbols # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
+ __Pyx_INCREF(((PyObject *)__pyx_v__symbols));
+ __pyx_r = __pyx_v__symbols;
goto __pyx_L0;
- /* "pywrapfst.pyx":1118
+ /* "pywrapfst.pyx":1177
*
*
* cdef _FstSymbolTableView _init_FstSymbolTableView(shared_ptr[fst.FstClass] ifst, # <<<<<<<<<<<<<<
* bool input_side):
- * cdef _FstSymbolTableView result = (
+ * cdef _FstSymbolTableView _symbols = (
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst._init_FstSymbolTableView", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__symbols);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":1127
+/* "pywrapfst.pyx":1186
*
*
* cdef _MutableFstSymbolTableView _init_MutableFstSymbolTableView( # <<<<<<<<<<<<<<
*/
static struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_f_9pywrapfst__init_MutableFstSymbolTableView(std::shared_ptr<fst::script::MutableFstClass> __pyx_v_ifst, bool __pyx_v_input_side) {
- struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_v_result = 0;
+ struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_v__symbols = 0;
struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__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("_init_MutableFstSymbolTableView", 0);
- /* "pywrapfst.pyx":1131
+ /* "pywrapfst.pyx":1190
* bool input_side):
- * cdef _MutableFstSymbolTableView result = (
+ * cdef _MutableFstSymbolTableView _symbols = (
* _MutableFstSymbolTableView.__new__(_MutableFstSymbolTableView)) # <<<<<<<<<<<<<<
- * result._mfst = move(ifst)
- * result._input_side = input_side
+ * _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, 1131, __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, 1190, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *)__pyx_t_1);
+ __pyx_v__symbols = ((struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1132
- * cdef _MutableFstSymbolTableView result = (
+ /* "pywrapfst.pyx":1191
+ * cdef _MutableFstSymbolTableView _symbols = (
* _MutableFstSymbolTableView.__new__(_MutableFstSymbolTableView))
- * result._mfst = move(ifst) # <<<<<<<<<<<<<<
- * result._input_side = input_side
- * return result
+ * _symbols._mfst = move(ifst) # <<<<<<<<<<<<<<
+ * _symbols._input_side = input_side
+ * return _symbols
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 1132, __pyx_L1_error)
+ __PYX_ERR(0, 1191, __pyx_L1_error)
}
- __pyx_v_result->_mfst = fst::move<std::shared_ptr<fst::script::MutableFstClass> >(__pyx_v_ifst);
+ __pyx_v__symbols->_mfst = fst::move<std::shared_ptr<fst::script::MutableFstClass> >(__pyx_v_ifst);
- /* "pywrapfst.pyx":1133
+ /* "pywrapfst.pyx":1192
* _MutableFstSymbolTableView.__new__(_MutableFstSymbolTableView))
- * result._mfst = move(ifst)
- * result._input_side = input_side # <<<<<<<<<<<<<<
- * return result
+ * _symbols._mfst = move(ifst)
+ * _symbols._input_side = input_side # <<<<<<<<<<<<<<
+ * return _symbols
*
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
- __PYX_ERR(0, 1133, __pyx_L1_error)
+ __PYX_ERR(0, 1192, __pyx_L1_error)
}
- __pyx_v_result->_input_side = __pyx_v_input_side;
+ __pyx_v__symbols->_input_side = __pyx_v_input_side;
- /* "pywrapfst.pyx":1134
- * result._mfst = move(ifst)
- * result._input_side = input_side
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1193
+ * _symbols._mfst = move(ifst)
+ * _symbols._input_side = input_side
+ * return _symbols # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
+ __Pyx_INCREF(((PyObject *)__pyx_v__symbols));
+ __pyx_r = __pyx_v__symbols;
goto __pyx_L0;
- /* "pywrapfst.pyx":1127
+ /* "pywrapfst.pyx":1186
*
*
* cdef _MutableFstSymbolTableView _init_MutableFstSymbolTableView( # <<<<<<<<<<<<<<
__Pyx_AddTraceback("pywrapfst._init_MutableFstSymbolTableView", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__symbols);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":1137
+/* "pywrapfst.pyx":1196
*
*
- * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] table): # <<<<<<<<<<<<<<
- * cdef SymbolTable result = SymbolTable.__new__(SymbolTable)
- * result._smart_table = move(table)
+ * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols): # <<<<<<<<<<<<<<
+ * cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
+ * _symbols._smart_table = move(symbols)
*/
-static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__init_SymbolTable(std::unique_ptr<fst::SymbolTable> __pyx_v_table) {
- struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_result = 0;
+static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__init_SymbolTable(std::unique_ptr<fst::SymbolTable> __pyx_v_symbols) {
+ struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v__symbols = 0;
struct __pyx_obj_9pywrapfst_SymbolTable *__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("_init_SymbolTable", 0);
- /* "pywrapfst.pyx":1138
+ /* "pywrapfst.pyx":1197
*
- * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] table):
- * cdef SymbolTable result = SymbolTable.__new__(SymbolTable) # <<<<<<<<<<<<<<
- * result._smart_table = move(table)
- * return result
+ * 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, 1138, __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, 1197, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
+ __pyx_v__symbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1139
- * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] table):
- * cdef SymbolTable result = SymbolTable.__new__(SymbolTable)
- * result._smart_table = move(table) # <<<<<<<<<<<<<<
- * return result
+ /* "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
*
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_smart_table");
- __PYX_ERR(0, 1139, __pyx_L1_error)
+ __PYX_ERR(0, 1198, __pyx_L1_error)
}
- __pyx_v_result->_smart_table = fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v_table);
+ __pyx_v__symbols->_smart_table = fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v_symbols);
- /* "pywrapfst.pyx":1140
- * cdef SymbolTable result = SymbolTable.__new__(SymbolTable)
- * result._smart_table = move(table)
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1199
+ * cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
+ * _symbols._smart_table = move(symbols)
+ * return _symbols # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
+ __Pyx_INCREF(((PyObject *)__pyx_v__symbols));
+ __pyx_r = __pyx_v__symbols;
goto __pyx_L0;
- /* "pywrapfst.pyx":1137
+ /* "pywrapfst.pyx":1196
*
*
- * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] table): # <<<<<<<<<<<<<<
- * cdef SymbolTable result = SymbolTable.__new__(SymbolTable)
- * result._smart_table = move(table)
+ * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols): # <<<<<<<<<<<<<<
+ * cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
+ * _symbols._smart_table = move(symbols)
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst._init_SymbolTable", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v__symbols);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":1143
+/* "pywrapfst.pyx":1202
*
*
- * cpdef SymbolTable _read_SymbolTable_from_string(state): # <<<<<<<<<<<<<<
- * cdef stringstream sstrm
- * sstrm << tostring(state)
+ * cpdef SymbolTable _read_SymbolTable_from_string(string state): # <<<<<<<<<<<<<<
+ * cdef stringstream _sstrm
+ * _sstrm << state
*/
-static PyObject *__pyx_pw_9pywrapfst_9_read_SymbolTable_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/
-static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__read_SymbolTable_from_string(PyObject *__pyx_v_state, CYTHON_UNUSED int __pyx_skip_dispatch) {
- std::stringstream __pyx_v_sstrm;
- std::unique_ptr<fst::SymbolTable> __pyx_v_syms;
+static PyObject *__pyx_pw_9pywrapfst_9_read_SymbolTable_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state); /*proto*/
+static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__read_SymbolTable_from_string(std::string __pyx_v_state, CYTHON_UNUSED int __pyx_skip_dispatch) {
+ std::stringstream __pyx_v__sstrm;
+ std::unique_ptr<fst::SymbolTable> __pyx_v__symbols;
struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- std::string __pyx_t_1;
- int __pyx_t_2;
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_read_SymbolTable_from_string", 0);
- /* "pywrapfst.pyx":1145
- * cpdef SymbolTable _read_SymbolTable_from_string(state):
- * cdef stringstream sstrm
- * sstrm << tostring(state) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.SymbolTable.ReadStream(sstrm, b"<pywrapfst>"))
- */
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1145, __pyx_L1_error)
- (void)((__pyx_v_sstrm << __pyx_t_1));
-
- /* "pywrapfst.pyx":1147
- * sstrm << tostring(state)
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.SymbolTable.ReadStream(sstrm, b"<pywrapfst>")) # <<<<<<<<<<<<<<
- * if syms.get() == NULL:
- * raise FstIOError("Read failed")
- */
- __pyx_v_syms.reset(fst::SymbolTable::Read(__pyx_v_sstrm, __pyx_k_pywrapfst));
-
- /* "pywrapfst.pyx":1148
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.SymbolTable.ReadStream(sstrm, b"<pywrapfst>"))
- * if syms.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed")
- * return _init_SymbolTable(move(syms))
- */
- __pyx_t_2 = ((__pyx_v_syms.get() == NULL) != 0);
- if (unlikely(__pyx_t_2)) {
+ /* "pywrapfst.pyx":1204
+ * cpdef SymbolTable _read_SymbolTable_from_string(string state):
+ * cdef stringstream _sstrm
+ * _sstrm << state # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.SymbolTable] _symbols
+ * _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
+ */
+ (void)((__pyx_v__sstrm << __pyx_v_state));
- /* "pywrapfst.pyx":1149
- * syms.reset(fst.SymbolTable.ReadStream(sstrm, b"<pywrapfst>"))
- * if syms.get() == NULL:
- * raise FstIOError("Read failed") # <<<<<<<<<<<<<<
- * return _init_SymbolTable(move(syms))
+ /* "pywrapfst.pyx":1206
+ * _sstrm << state
+ * cdef unique_ptr[fst.SymbolTable] _symbols
+ * _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>")) # <<<<<<<<<<<<<<
+ * if _symbols.get() == NULL:
+ * raise FstIOError("Read from string failed")
+ */
+ __pyx_v__symbols.reset(fst::SymbolTable::Read(__pyx_v__sstrm, __pyx_k_pywrapfst));
+
+ /* "pywrapfst.pyx":1207
+ * cdef unique_ptr[fst.SymbolTable] _symbols
+ * _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
+ * if _symbols.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstIOError("Read from string failed")
+ * return _init_SymbolTable(move(_symbols))
+ */
+ __pyx_t_1 = ((__pyx_v__symbols.get() == NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "pywrapfst.pyx":1208
+ * _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_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
}
}
- __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_Read_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Read_failed);
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1149, __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_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)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 1149, __pyx_L1_error)
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __PYX_ERR(0, 1208, __pyx_L1_error)
- /* "pywrapfst.pyx":1148
- * cdef unique_ptr[fst.SymbolTable] syms
- * syms.reset(fst.SymbolTable.ReadStream(sstrm, b"<pywrapfst>"))
- * if syms.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed")
- * return _init_SymbolTable(move(syms))
+ /* "pywrapfst.pyx":1207
+ * cdef unique_ptr[fst.SymbolTable] _symbols
+ * _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
+ * if _symbols.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstIOError("Read from string failed")
+ * return _init_SymbolTable(move(_symbols))
*/
}
- /* "pywrapfst.pyx":1150
- * if syms.get() == NULL:
- * raise FstIOError("Read failed")
- * return _init_SymbolTable(move(syms)) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1209
+ * if _symbols.get() == NULL:
+ * raise FstIOError("Read from string failed")
+ * return _init_SymbolTable(move(_symbols)) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v_syms))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1150, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_3);
- __pyx_t_3 = 0;
+ __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_GOTREF(__pyx_t_2);
+ __pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_2);
+ __pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1143
+ /* "pywrapfst.pyx":1202
*
*
- * cpdef SymbolTable _read_SymbolTable_from_string(state): # <<<<<<<<<<<<<<
- * cdef stringstream sstrm
- * sstrm << tostring(state)
+ * cpdef SymbolTable _read_SymbolTable_from_string(string state): # <<<<<<<<<<<<<<
+ * cdef stringstream _sstrm
+ * _sstrm << state
*/
/* function exit code */
__pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("pywrapfst._read_SymbolTable_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_9_read_SymbolTable_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/
-static PyObject *__pyx_pw_9pywrapfst_9_read_SymbolTable_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state) {
+static PyObject *__pyx_pw_9pywrapfst_9_read_SymbolTable_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_9_read_SymbolTable_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state) {
+ std::string __pyx_v_state;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_read_SymbolTable_from_string (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_8_read_SymbolTable_from_string(__pyx_self, ((PyObject *)__pyx_v_state));
+ 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)
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("pywrapfst._read_SymbolTable_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_9pywrapfst_8_read_SymbolTable_from_string(__pyx_self, ((std::string)__pyx_v_state));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_8_read_SymbolTable_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state) {
+static PyObject *__pyx_pf_9pywrapfst_8_read_SymbolTable_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state) {
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("_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, 1143, __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, 1202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1156
+/* "pywrapfst.pyx":1215
*
*
- * cpdef SymbolTable compact_symbol_table(_SymbolTable syms): # <<<<<<<<<<<<<<
+ * cpdef SymbolTable compact_symbol_table(SymbolTableView symbols): # <<<<<<<<<<<<<<
* """
- * compact_symbol_table(syms)
+ * compact_symbol_table(symbols)
*/
-static PyObject *__pyx_pw_9pywrapfst_11compact_symbol_table(PyObject *__pyx_self, PyObject *__pyx_v_syms); /*proto*/
-static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_compact_symbol_table(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms, CYTHON_UNUSED int __pyx_skip_dispatch) {
+static PyObject *__pyx_pw_9pywrapfst_11compact_symbol_table(PyObject *__pyx_self, PyObject *__pyx_v_symbols); /*proto*/
+static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_compact_symbol_table(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols, CYTHON_UNUSED int __pyx_skip_dispatch) {
struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
fst::SymbolTable const *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("compact_symbol_table", 0);
- /* "pywrapfst.pyx":1168
+ /* "pywrapfst.pyx":1227
* A new compacted SymbolTable.
* """
* return _init_SymbolTable(WrapUnique(fst.CompactSymbolTable( # <<<<<<<<<<<<<<
- * deref(syms._raw_ptr_or_raise()))))
+ * deref(symbols._raw_ptr_or_raise()))))
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "pywrapfst.pyx":1169
+ /* "pywrapfst.pyx":1228
* """
* return _init_SymbolTable(WrapUnique(fst.CompactSymbolTable(
- * deref(syms._raw_ptr_or_raise())))) # <<<<<<<<<<<<<<
+ * deref(symbols._raw_ptr_or_raise())))) # <<<<<<<<<<<<<<
*
*
*/
- if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
+ 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, 1169, __pyx_L1_error)
+ __PYX_ERR(0, 1228, __pyx_L1_error)
}
- __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_syms->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1169, __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)
- /* "pywrapfst.pyx":1168
+ /* "pywrapfst.pyx":1227
* A new compacted SymbolTable.
* """
* return _init_SymbolTable(WrapUnique(fst.CompactSymbolTable( # <<<<<<<<<<<<<<
- * deref(syms._raw_ptr_or_raise()))))
+ * 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, 1168, __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, 1227, __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":1156
+ /* "pywrapfst.pyx":1215
*
*
- * cpdef SymbolTable compact_symbol_table(_SymbolTable syms): # <<<<<<<<<<<<<<
+ * cpdef SymbolTable compact_symbol_table(SymbolTableView symbols): # <<<<<<<<<<<<<<
* """
- * compact_symbol_table(syms)
+ * compact_symbol_table(symbols)
*/
/* function exit code */
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_11compact_symbol_table(PyObject *__pyx_self, PyObject *__pyx_v_syms); /*proto*/
-static char __pyx_doc_9pywrapfst_10compact_symbol_table[] = "\n compact_symbol_table(syms)\n\n Constructively relabels a SymbolTable to make it a contiguous mapping.\n\n Args:\n syms: Input SymbolTable.\n\n Returns:\n A new compacted SymbolTable.\n ";
-static PyObject *__pyx_pw_9pywrapfst_11compact_symbol_table(PyObject *__pyx_self, PyObject *__pyx_v_syms) {
+static PyObject *__pyx_pw_9pywrapfst_11compact_symbol_table(PyObject *__pyx_self, PyObject *__pyx_v_symbols); /*proto*/
+static char __pyx_doc_9pywrapfst_10compact_symbol_table[] = "\n compact_symbol_table(symbols)\n\n Constructively relabels a SymbolTable to make it a contiguous mapping.\n\n Args:\n symbols: Input SymbolTable.\n\n Returns:\n A new compacted SymbolTable.\n ";
+static PyObject *__pyx_pw_9pywrapfst_11compact_symbol_table(PyObject *__pyx_self, PyObject *__pyx_v_symbols) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("compact_symbol_table (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1156, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_10compact_symbol_table(__pyx_self, ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1215, __pyx_L1_error)
+ __pyx_r = __pyx_pf_9pywrapfst_10compact_symbol_table(__pyx_self, ((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_symbols));
/* function exit code */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_10compact_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+static PyObject *__pyx_pf_9pywrapfst_10compact_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
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("compact_symbol_table", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_compact_symbol_table(__pyx_v_syms, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __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, 1215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1172
+/* "pywrapfst.pyx":1231
*
*
- * cpdef SymbolTable merge_symbol_table(_SymbolTable lhs, _SymbolTable rhs): # <<<<<<<<<<<<<<
+ * cpdef SymbolTable merge_symbol_table(SymbolTableView lhs, # <<<<<<<<<<<<<<
+ * SymbolTableView rhs):
* """
- * merge_symbol_table(lhs, rhs)
*/
static PyObject *__pyx_pw_9pywrapfst_13merge_symbol_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_merge_symbol_table(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_lhs, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_rhs, CYTHON_UNUSED int __pyx_skip_dispatch) {
+static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_merge_symbol_table(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_rhs, CYTHON_UNUSED int __pyx_skip_dispatch) {
struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
fst::SymbolTable const *__pyx_t_1;
fst::SymbolTable const *__pyx_t_2;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("merge_symbol_table", 0);
- /* "pywrapfst.pyx":1194
+ /* "pywrapfst.pyx":1254
* A new merged SymbolTable.
* """
* return _init_SymbolTable(WrapUnique(fst.MergeSymbolTable( # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "pywrapfst.pyx":1195
+ /* "pywrapfst.pyx":1255
* """
* 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, 1195, __pyx_L1_error)
+ __PYX_ERR(0, 1255, __pyx_L1_error)
}
- __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_lhs->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_lhs); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1195, __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)
- /* "pywrapfst.pyx":1196
+ /* "pywrapfst.pyx":1256
* 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, 1196, __pyx_L1_error)
+ __PYX_ERR(0, 1256, __pyx_L1_error)
}
- __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_rhs->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_rhs); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1196, __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)
- /* "pywrapfst.pyx":1194
+ /* "pywrapfst.pyx":1254
* 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, 1194, __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, 1254, __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":1172
+ /* "pywrapfst.pyx":1231
*
*
- * cpdef SymbolTable merge_symbol_table(_SymbolTable lhs, _SymbolTable rhs): # <<<<<<<<<<<<<<
+ * cpdef SymbolTable merge_symbol_table(SymbolTableView lhs, # <<<<<<<<<<<<<<
+ * SymbolTableView rhs):
* """
- * merge_symbol_table(lhs, rhs)
*/
/* function exit code */
static PyObject *__pyx_pw_9pywrapfst_13merge_symbol_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_12merge_symbol_table[] = "\n merge_symbol_table(lhs, rhs)\n\n Merges all symbols from the left table into the right.\n\n This function creates a new SymbolTable which is the merger of the two input\n symbol Tables. Symbols in the right-hand table that conflict with those in the\n left-hand table will be assigned values from the left-hand table. Thus the\n returned table will never modify symbol assignments from the left-hand side,\n but may do so on the right.\n\n If the left-hand table is associated with an FST, it may be necessary to\n relabel it using the output table.\n\n Args:\n lhs: Left-hand side SymbolTable.\n rhs: Left-hand side SymbolTable.\n\n Returns:\n A new merged SymbolTable.\n ";
static PyObject *__pyx_pw_9pywrapfst_13merge_symbol_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_lhs = 0;
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_rhs = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_lhs = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_rhs = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("merge_symbol_table (wrapper)", 0);
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, 1172, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, 1); __PYX_ERR(0, 1231, __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, 1172, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "merge_symbol_table") < 0)) __PYX_ERR(0, 1231, __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_lhs = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[0]);
- __pyx_v_rhs = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[1]);
+ __pyx_v_lhs = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
+ __pyx_v_rhs = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[1]);
}
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, 1172, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1231, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.merge_symbol_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_9pywrapfst__SymbolTable, 1, "lhs", 0))) __PYX_ERR(0, 1172, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst__SymbolTable, 1, "rhs", 0))) __PYX_ERR(0, 1172, __pyx_L1_error)
+ 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)
__pyx_r = __pyx_pf_9pywrapfst_12merge_symbol_table(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
/* function exit code */
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12merge_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_lhs, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_rhs) {
+static PyObject *__pyx_pf_9pywrapfst_12merge_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_rhs) {
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("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, 1172, __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, 1231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1210
+/* "pywrapfst.pyx":1270
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<_SymbolTableIterator at 0x{:x}>".format(id(self))
+ * return f"<_SymbolTableIterator at 0x{id(self):x}>"
*
*/
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1211
+ /* "pywrapfst.pyx":1271
*
* def __repr__(self):
- * return "<_SymbolTableIterator at 0x{:x}>".format(id(self)) # <<<<<<<<<<<<<<
+ * return f"<_SymbolTableIterator at 0x{id(self):x}>" # <<<<<<<<<<<<<<
*
- * def __init__(self, _SymbolTable syms):
+ * def __init__(self, SymbolTableView symbols):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_SymbolTableIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- }
- }
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1271, __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;
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u_SymbolTableIterator_at_0x);
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__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_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":1210
+ /* "pywrapfst.pyx":1270
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<_SymbolTableIterator at 0x{:x}>".format(id(self))
+ * return f"<_SymbolTableIterator at 0x{id(self):x}>"
*
*/
/* 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_AddTraceback("pywrapfst._SymbolTableIterator.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1213
- * return "<_SymbolTableIterator at 0x{:x}>".format(id(self))
+/* "pywrapfst.pyx":1273
+ * return f"<_SymbolTableIterator at 0x{id(self):x}>"
*
- * def __init__(self, _SymbolTable syms): # <<<<<<<<<<<<<<
- * self._table = syms
- * self._siter.reset(new fst.SymbolTableIterator(
+ * def __init__(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
+ * self._table = symbols
+ * self._siter.reset(
*/
/* Python wrapper */
static int __pyx_pw_9pywrapfst_20_SymbolTableIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_20_SymbolTableIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_syms,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_symbols,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
- if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_syms)) != 0)) kw_args--;
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_symbols)) != 0)) kw_args--;
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, 1213, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1273, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
- __pyx_v_syms = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[0]);
+ __pyx_v_symbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1213, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1273, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst._SymbolTableIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1213, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_20_SymbolTableIterator_2__init__(((struct __pyx_obj_9pywrapfst__SymbolTableIterator *)__pyx_v_self), __pyx_v_syms);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1273, __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 */
goto __pyx_L0;
return __pyx_r;
}
-static int __pyx_pf_9pywrapfst_20_SymbolTableIterator_2__init__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+static int __pyx_pf_9pywrapfst_20_SymbolTableIterator_2__init__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
int __pyx_r;
__Pyx_RefNannyDeclarations
fst::SymbolTable const *__pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":1214
+ /* "pywrapfst.pyx":1274
*
- * def __init__(self, _SymbolTable syms):
- * self._table = syms # <<<<<<<<<<<<<<
- * self._siter.reset(new fst.SymbolTableIterator(
- * self._table._raw_ptr_or_raise().begin()))
+ * def __init__(self, SymbolTableView symbols):
+ * 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, 1214, __pyx_L1_error)
+ __PYX_ERR(0, 1274, __pyx_L1_error)
}
- __Pyx_INCREF(((PyObject *)__pyx_v_syms));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_syms));
+ __Pyx_INCREF(((PyObject *)__pyx_v_symbols));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_symbols));
__Pyx_GOTREF(__pyx_v_self->_table);
__Pyx_DECREF(((PyObject *)__pyx_v_self->_table));
- __pyx_v_self->_table = __pyx_v_syms;
+ __pyx_v_self->_table = __pyx_v_symbols;
- /* "pywrapfst.pyx":1215
- * def __init__(self, _SymbolTable syms):
- * self._table = syms
- * self._siter.reset(new fst.SymbolTableIterator( # <<<<<<<<<<<<<<
- * self._table._raw_ptr_or_raise().begin()))
+ /* "pywrapfst.pyx":1275
+ * def __init__(self, SymbolTableView symbols):
+ * 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'", "_siter");
- __PYX_ERR(0, 1215, __pyx_L1_error)
+ __PYX_ERR(0, 1275, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1216
- * self._table = syms
- * self._siter.reset(new fst.SymbolTableIterator(
- * self._table._raw_ptr_or_raise().begin())) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1276
+ * self._table = symbols
+ * self._siter.reset(
+ * new fst.SymbolTableIterator(self._table._raw_ptr_or_raise().begin())) # <<<<<<<<<<<<<<
*
* # This just registers this class as a possible iterator.
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
- __PYX_ERR(0, 1216, __pyx_L1_error)
+ __PYX_ERR(0, 1276, __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, 1216, __pyx_L1_error)
+ __PYX_ERR(0, 1276, __pyx_L1_error)
}
- __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->_table->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self->_table); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1216, __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)
- /* "pywrapfst.pyx":1215
- * def __init__(self, _SymbolTable syms):
- * self._table = syms
- * self._siter.reset(new fst.SymbolTableIterator( # <<<<<<<<<<<<<<
- * self._table._raw_ptr_or_raise().begin()))
+ /* "pywrapfst.pyx":1275
+ * def __init__(self, SymbolTableView symbols):
+ * self._table = symbols
+ * self._siter.reset( # <<<<<<<<<<<<<<
+ * new fst.SymbolTableIterator(self._table._raw_ptr_or_raise().begin()))
*
*/
__pyx_v_self->_siter.reset(new fst::SymbolTable::iterator(__pyx_t_1->begin()));
- /* "pywrapfst.pyx":1213
- * return "<_SymbolTableIterator at 0x{:x}>".format(id(self))
+ /* "pywrapfst.pyx":1273
+ * return f"<_SymbolTableIterator at 0x{id(self):x}>"
*
- * def __init__(self, _SymbolTable syms): # <<<<<<<<<<<<<<
- * self._table = syms
- * self._siter.reset(new fst.SymbolTableIterator(
+ * def __init__(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
+ * self._table = symbols
+ * self._siter.reset(
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":1219
+/* "pywrapfst.pyx":1279
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":1220
+ /* "pywrapfst.pyx":1280
* # 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":1219
+ /* "pywrapfst.pyx":1279
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1223
+/* "pywrapfst.pyx":1283
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
}
static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator_6__next__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self) {
- int64 __pyx_v_label;
- std::string __pyx_v_symbol;
+ int64 __pyx_v__label;
+ std::string __pyx_v__symbol;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
fst::SymbolTable const *__pyx_t_1;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "pywrapfst.pyx":1224
+ /* "pywrapfst.pyx":1284
* # 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): # <<<<<<<<<<<<<<
* raise StopIteration
- * cdef int64 label = self._siter.get().Pair().Label()
+ * 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'", "_table");
- __PYX_ERR(0, 1224, __pyx_L1_error)
+ __PYX_ERR(0, 1284, __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, 1224, __pyx_L1_error)
+ __PYX_ERR(0, 1284, __pyx_L1_error)
}
- __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->_table->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self->_table); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1224, __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)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 1224, __pyx_L1_error)
+ __PYX_ERR(0, 1284, __pyx_L1_error)
}
__pyx_t_2 = ((__pyx_t_1->end() == (*__pyx_v_self->_siter)) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1225
+ /* "pywrapfst.pyx":1285
* def __next__(self):
* if self._table._raw_ptr_or_raise().end() == deref(self._siter):
* raise StopIteration # <<<<<<<<<<<<<<
- * cdef int64 label = self._siter.get().Pair().Label()
- * cdef string symbol = self._siter.get().Pair().Symbol()
+ * cdef int64 _label = self._siter.get().Pair().Label()
+ * cdef string _symbol = self._siter.get().Pair().Symbol()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 1225, __pyx_L1_error)
+ __PYX_ERR(0, 1285, __pyx_L1_error)
- /* "pywrapfst.pyx":1224
+ /* "pywrapfst.pyx":1284
* # 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): # <<<<<<<<<<<<<<
* raise StopIteration
- * cdef int64 label = self._siter.get().Pair().Label()
+ * cdef int64 _label = self._siter.get().Pair().Label()
*/
}
- /* "pywrapfst.pyx":1226
+ /* "pywrapfst.pyx":1286
* if self._table._raw_ptr_or_raise().end() == deref(self._siter):
* raise StopIteration
- * cdef int64 label = self._siter.get().Pair().Label() # <<<<<<<<<<<<<<
- * cdef string symbol = self._siter.get().Pair().Symbol()
+ * 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, 1226, __pyx_L1_error)
+ __PYX_ERR(0, 1286, __pyx_L1_error)
}
- __pyx_v_label = __pyx_v_self->_siter.get()->operator*().Label();
+ __pyx_v__label = __pyx_v_self->_siter.get()->operator*().Label();
- /* "pywrapfst.pyx":1227
+ /* "pywrapfst.pyx":1287
* raise StopIteration
- * cdef int64 label = self._siter.get().Pair().Label()
- * cdef string symbol = self._siter.get().Pair().Symbol() # <<<<<<<<<<<<<<
+ * cdef int64 _label = self._siter.get().Pair().Label()
+ * cdef string _symbol = self._siter.get().Pair().Symbol() # <<<<<<<<<<<<<<
* inc(deref(self._siter))
- * return (label, symbol)
+ * return (_label, _symbol)
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 1227, __pyx_L1_error)
+ __PYX_ERR(0, 1287, __pyx_L1_error)
}
- __pyx_v_symbol = __pyx_v_self->_siter.get()->operator*().Symbol();
+ __pyx_v__symbol = __pyx_v_self->_siter.get()->operator*().Symbol();
- /* "pywrapfst.pyx":1228
- * cdef int64 label = self._siter.get().Pair().Label()
- * cdef string symbol = self._siter.get().Pair().Symbol()
+ /* "pywrapfst.pyx":1288
+ * cdef int64 _label = self._siter.get().Pair().Label()
+ * cdef string _symbol = self._siter.get().Pair().Symbol()
* inc(deref(self._siter)) # <<<<<<<<<<<<<<
- * return (label, symbol)
+ * return (_label, _symbol)
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
- __PYX_ERR(0, 1228, __pyx_L1_error)
+ __PYX_ERR(0, 1288, __pyx_L1_error)
}
(void)((++(*__pyx_v_self->_siter)));
- /* "pywrapfst.pyx":1229
- * cdef string symbol = self._siter.get().Pair().Symbol()
+ /* "pywrapfst.pyx":1289
+ * cdef string _symbol = self._siter.get().Pair().Symbol()
* inc(deref(self._siter))
- * return (label, symbol) # <<<<<<<<<<<<<<
+ * 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, 1229, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v__label); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1289, __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, 1229, __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, 1289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1229, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1289, __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":1223
+ /* "pywrapfst.pyx":1283
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
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("__reduce_cython__", 0);
/* "(tree fragment)":2
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._siter cannot be converted to a Python object for pickling")
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
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("__setstate_cython__", 0);
/* "(tree fragment)":4
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._siter cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1258
+/* "pywrapfst.pyx":1318
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<EncodeMapper at 0x{:x}>".format(id(self))
+ * return f"<EncodeMapper at 0x{id(self):x}>"
*
*/
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1259
+ /* "pywrapfst.pyx":1319
*
* def __repr__(self):
- * return "<EncodeMapper at 0x{:x}>".format(id(self)) # <<<<<<<<<<<<<<
+ * return f"<EncodeMapper at 0x{id(self):x}>" # <<<<<<<<<<<<<<
*
* def __init__(self,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_EncodeMapper_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1259, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- }
- }
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __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;
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u_EncodeMapper_at_0x);
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__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_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":1258
+ /* "pywrapfst.pyx":1318
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<EncodeMapper at 0x{:x}>".format(id(self))
+ * return f"<EncodeMapper at 0x{id(self):x}>"
*
*/
/* 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_AddTraceback("pywrapfst.EncodeMapper.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1261
- * return "<EncodeMapper at 0x{:x}>".format(id(self))
+/* "pywrapfst.pyx":1321
+ * return f"<EncodeMapper at 0x{id(self):x}>"
*
* def __init__(self, # <<<<<<<<<<<<<<
- * arc_type=b"standard",
+ * arc_type="standard",
* bool encode_labels=False,
*/
PyObject *__pyx_v_arc_type = 0;
bool __pyx_v_encode_labels;
bool __pyx_v_encode_weights;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arc_type,&__pyx_n_s_encode_labels,&__pyx_n_s_encode_weights,0};
PyObject* values[3] = {0,0,0};
- values[0] = ((PyObject *)__pyx_n_b_standard);
+ values[0] = ((PyObject *)__pyx_n_u_standard);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1261, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1321, __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, 1263, __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, 1323, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1263
+ /* "pywrapfst.pyx":1323
* def __init__(self,
- * arc_type=b"standard",
+ * arc_type="standard",
* bool encode_labels=False, # <<<<<<<<<<<<<<
* bool encode_weights=False):
- * cdef uint8 flags = fst.GetEncodeFlags(encode_labels, encode_weights)
+ * cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
*/
__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, 1264, __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, 1324, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1264
- * arc_type=b"standard",
+ /* "pywrapfst.pyx":1324
+ * arc_type="standard",
* bool encode_labels=False,
* bool encode_weights=False): # <<<<<<<<<<<<<<
- * cdef uint8 flags = fst.GetEncodeFlags(encode_labels, encode_weights)
- * self._mapper.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
+ * cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
+ * self._mapper.reset(
*/
__pyx_v_encode_weights = ((bool)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1261, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1321, __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":1261
- * return "<EncodeMapper at 0x{:x}>".format(id(self))
+ /* "pywrapfst.pyx":1321
+ * return f"<EncodeMapper at 0x{id(self):x}>"
*
* def __init__(self, # <<<<<<<<<<<<<<
- * arc_type=b"standard",
+ * arc_type="standard",
* bool encode_labels=False,
*/
}
static int __pyx_pf_9pywrapfst_12EncodeMapper_2__init__(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_arc_type, bool __pyx_v_encode_labels, bool __pyx_v_encode_weights) {
- uint8 __pyx_v_flags;
+ uint8 __pyx_v__flags;
int __pyx_r;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":1265
+ /* "pywrapfst.pyx":1325
* bool encode_labels=False,
* bool encode_weights=False):
- * cdef uint8 flags = fst.GetEncodeFlags(encode_labels, encode_weights) # <<<<<<<<<<<<<<
- * self._mapper.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
- * fst.ENCODE))
+ * cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights) # <<<<<<<<<<<<<<
+ * self._mapper.reset(
+ * new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
*/
- __pyx_v_flags = fst::script::GetEncodeFlags(__pyx_v_encode_labels, __pyx_v_encode_weights);
+ __pyx_v__flags = fst::script::GetEncodeFlags(__pyx_v_encode_labels, __pyx_v_encode_weights);
- /* "pywrapfst.pyx":1266
+ /* "pywrapfst.pyx":1326
* bool encode_weights=False):
- * cdef uint8 flags = fst.GetEncodeFlags(encode_labels, encode_weights)
- * self._mapper.reset(new fst.EncodeMapperClass(tostring(arc_type), flags, # <<<<<<<<<<<<<<
- * fst.ENCODE))
- * if not self._mapper:
+ * 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:
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1266, __pyx_L1_error)
+ __PYX_ERR(0, 1326, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1266, __pyx_L1_error)
- /* "pywrapfst.pyx":1267
- * cdef uint8 flags = fst.GetEncodeFlags(encode_labels, encode_weights)
- * self._mapper.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
- * fst.ENCODE)) # <<<<<<<<<<<<<<
- * if not self._mapper:
- * raise FstOpError("Unknown arc type: {!r}".format(arc_type))
+ /* "pywrapfst.pyx":1327
+ * 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)
+
+ /* "pywrapfst.pyx":1326
+ * bool encode_weights=False):
+ * 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:
*/
- __pyx_v_self->_mapper.reset(new fst::script::EncodeMapperClass(__pyx_t_1, __pyx_v_flags, fst::ENCODE));
+ __pyx_v_self->_mapper.reset(new fst::script::EncodeMapperClass(__pyx_t_1, __pyx_v__flags, fst::ENCODE));
- /* "pywrapfst.pyx":1268
- * self._mapper.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
- * fst.ENCODE))
- * if not self._mapper: # <<<<<<<<<<<<<<
- * raise FstOpError("Unknown arc type: {!r}".format(arc_type))
+ /* "pywrapfst.pyx":1328
+ * 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}")
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1268, __pyx_L1_error)
+ __PYX_ERR(0, 1328, __pyx_L1_error)
}
- __pyx_t_2 = ((!__pyx_v_self->_mapper) != 0);
+ __pyx_t_2 = ((__pyx_v_self->_mapper.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1269
- * fst.ENCODE))
- * if not self._mapper:
- * raise FstOpError("Unknown arc type: {!r}".format(arc_type)) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1329
+ * 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, 1269, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1329, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_arc_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_arc_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_arc_type);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1269, __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, 1329, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
+ __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_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
+ __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_6);
+ __Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1269, __pyx_L1_error)
+ __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)
__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, 1269, __pyx_L1_error)
+ __PYX_ERR(0, 1329, __pyx_L1_error)
- /* "pywrapfst.pyx":1268
- * self._mapper.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
- * fst.ENCODE))
- * if not self._mapper: # <<<<<<<<<<<<<<
- * raise FstOpError("Unknown arc type: {!r}".format(arc_type))
+ /* "pywrapfst.pyx":1328
+ * 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}")
*
*/
}
- /* "pywrapfst.pyx":1261
- * return "<EncodeMapper at 0x{:x}>".format(id(self))
+ /* "pywrapfst.pyx":1321
+ * return f"<EncodeMapper at 0x{id(self):x}>"
*
* def __init__(self, # <<<<<<<<<<<<<<
- * arc_type=b"standard",
+ * arc_type="standard",
* bool encode_labels=False,
*/
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst.EncodeMapper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1273
+/* "pywrapfst.pyx":1333
* # Python's equivalent to operator().
*
* def __call__(self, Arc arc): # <<<<<<<<<<<<<<
#endif
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
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, 1273, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 1333, __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, 1273, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1333, __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, 1273, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1333, __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 */
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("__call__", 0);
- /* "pywrapfst.pyx":1289
+ /* "pywrapfst.pyx":1349
* 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, 1289, __pyx_L1_error)
+ __PYX_ERR(0, 1349, __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, 1289, __pyx_L1_error)
+ __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, 1289, __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1273
+ /* "pywrapfst.pyx":1333
* # Python's equivalent to operator().
*
* def __call__(self, Arc arc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1293
+/* "pywrapfst.pyx":1353
* # Registers the class for pickling.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__reduce__", 0);
- /* "pywrapfst.pyx":1294
+ /* "pywrapfst.pyx":1354
*
* 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, 1294, __pyx_L1_error)
+ __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_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, 1294, __pyx_L1_error)
+ __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, 1294, __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_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1294, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __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, 1294, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __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":1293
+ /* "pywrapfst.pyx":1353
* # Registers the class for pickling.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1296
+/* "pywrapfst.pyx":1356
* return (_read_EncodeMapper_from_string, (self.write_to_string(),))
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arc_type", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1296, __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, 1356, __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, 1296, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1356, __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, 1296, __pyx_L1_error)
+ __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_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":1302
+ /* "pywrapfst.pyx":1362
* 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, 1302, __pyx_L1_error)
+ __PYX_ERR(0, 1362, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mapper.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1296
+ /* "pywrapfst.pyx":1356
* return (_read_EncodeMapper_from_string, (self.write_to_string(),))
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
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("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, 1296, __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, 1356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1304
+/* "pywrapfst.pyx":1364
* return self._mapper.get().ArcType()
*
* cpdef string weight_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("weight_type", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1304, __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, 1364, __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, 1304, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __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, 1304, __pyx_L1_error)
+ __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_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":1310
+ /* "pywrapfst.pyx":1370
* 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, 1310, __pyx_L1_error)
+ __PYX_ERR(0, 1370, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mapper.get()->WeightType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1304
+ /* "pywrapfst.pyx":1364
* return self._mapper.get().ArcType()
*
* cpdef string weight_type(self): # <<<<<<<<<<<<<<
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("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, 1304, __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, 1364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1312
+/* "pywrapfst.pyx":1372
* return self._mapper.get().WeightType()
*
* cpdef uint8 flags(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
uint8 __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("flags", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1312, __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, 1372, __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, 1312, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __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, 1312, __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, 1372, __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":1318
+ /* "pywrapfst.pyx":1378
* Returns the mapper's flags.
* """
* return self._mapper.get().Flags() # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1318, __pyx_L1_error)
+ __PYX_ERR(0, 1378, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mapper.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":1312
+ /* "pywrapfst.pyx":1372
* return self._mapper.get().WeightType()
*
* cpdef uint8 flags(self): # <<<<<<<<<<<<<<
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("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, 1312, __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, 1372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1320
+/* "pywrapfst.pyx":1380
* return self._mapper.get().Flags()
*
* cpdef uint64 properties(self, uint64 mask): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
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)) ;
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, 1320, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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, 1320, __pyx_L1_error)
+ __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;
__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, 1320, __pyx_L1_error)
+ 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, 1320, __pyx_L1_error)
+ __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;
#endif
}
- /* "pywrapfst.pyx":1334
+ /* "pywrapfst.pyx":1394
* A 64-bit bitmask representing the requested properties.
* """
* return self._mapper.get().Properties(mask) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1334, __pyx_L1_error)
+ __PYX_ERR(0, 1394, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mapper.get()->Properties(__pyx_v_mask);
goto __pyx_L0;
- /* "pywrapfst.pyx":1320
+ /* "pywrapfst.pyx":1380
* return self._mapper.get().Flags()
*
* cpdef uint64 properties(self, uint64 mask): # <<<<<<<<<<<<<<
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, 1320, __pyx_L3_error)
+ __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:;
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, 1320, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_f_9pywrapfst_12EncodeMapper_properties(__pyx_v_self, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1337
+/* "pywrapfst.pyx":1397
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
}
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_16read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source) {
- std::unique_ptr<fst::script::EncodeMapperClass> __pyx_v_mapper;
+ std::unique_ptr<fst::script::EncodeMapperClass> __pyx_v__mapper;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read", 0);
- /* "pywrapfst.pyx":1353
+ /* "pywrapfst.pyx":1413
* """
- * cdef unique_ptr[fst.EncodeMapperClass] mapper
- * mapper.reset(fst.EncodeMapperClass.Read(tostring(source))) # <<<<<<<<<<<<<<
- * if mapper.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source))
+ * 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_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1353, __pyx_L1_error)
- __pyx_v_mapper.reset(fst::script::EncodeMapperClass::Read(__pyx_t_1));
+ __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1413, __pyx_L1_error)
+ __pyx_v__mapper.reset(fst::script::EncodeMapperClass::Read(__pyx_t_1));
- /* "pywrapfst.pyx":1354
- * cdef unique_ptr[fst.EncodeMapperClass] mapper
- * mapper.reset(fst.EncodeMapperClass.Read(tostring(source)))
- * if mapper.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_EncodeMapper(mapper.release())
+ /* "pywrapfst.pyx":1414
+ * 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}")
+ * return _init_EncodeMapper(_mapper.release())
*/
- __pyx_t_2 = ((__pyx_v_mapper.get() == NULL) != 0);
+ __pyx_t_2 = ((__pyx_v__mapper.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":1355
- * mapper.reset(fst.EncodeMapperClass.Read(tostring(source)))
- * if mapper.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source)) # <<<<<<<<<<<<<<
- * return _init_EncodeMapper(mapper.release())
+ /* "pywrapfst.pyx":1415
+ * _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, 1355, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1355, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1355, __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, 1415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
+ __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_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
+ __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_6);
+ __Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1355, __pyx_L1_error)
+ __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)
__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, 1355, __pyx_L1_error)
+ __PYX_ERR(0, 1415, __pyx_L1_error)
- /* "pywrapfst.pyx":1354
- * cdef unique_ptr[fst.EncodeMapperClass] mapper
- * mapper.reset(fst.EncodeMapperClass.Read(tostring(source)))
- * if mapper.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_EncodeMapper(mapper.release())
+ /* "pywrapfst.pyx":1414
+ * 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}")
+ * return _init_EncodeMapper(_mapper.release())
*/
}
- /* "pywrapfst.pyx":1356
- * if mapper.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_EncodeMapper(mapper.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1416
+ * 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, 1356, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1337
+ /* "pywrapfst.pyx":1397
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst.EncodeMapper.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1359
+/* "pywrapfst.pyx":1419
*
* @staticmethod
* def read_from_string(state): # <<<<<<<<<<<<<<
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_19read_from_string = {"read_from_string", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_19read_from_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_18read_from_string};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_19read_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_state = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_from_string (wrapper)", 0);
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, 1359, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_from_string") < 0)) __PYX_ERR(0, 1419, __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, 1359, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("read_from_string", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1419, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.EncodeMapper.read_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_18read_from_string(PyObject *__pyx_v_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
+ std::string __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_from_string", 0);
- /* "pywrapfst.pyx":1374
+ /* "pywrapfst.pyx":1434
* FstIOError: Read failed.
* """
* return _read_EncodeMapper_from_string(state) # <<<<<<<<<<<<<<
* cpdef void write(self, source) except *:
*/
__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, 1374, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
+ __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_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1359
+ /* "pywrapfst.pyx":1419
*
* @staticmethod
* def read_from_string(state): # <<<<<<<<<<<<<<
/* function exit code */
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("pywrapfst.EncodeMapper.read_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1376
+/* "pywrapfst.pyx":1436
* return _read_EncodeMapper_from_string(state)
*
* cpdef void write(self, source) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
int __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1376, __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, 1436, __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, 1376, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __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":1389
+ /* "pywrapfst.pyx":1449
* FstIOError: Write failed.
* """
- * if not self._mapper.get().Write(tostring(source)): # <<<<<<<<<<<<<<
- * raise FstIOError("Write failed: {!r}".format(source))
+ * if not self._mapper.get().Write(path_tostring(source)): # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Write failed: {source!r}")
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1389, __pyx_L1_error)
+ __PYX_ERR(0, 1449, __pyx_L1_error)
}
- __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1389, __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_6 = ((!(__pyx_v_self->_mapper.get()->Write(__pyx_t_5) != 0)) != 0);
if (unlikely(__pyx_t_6)) {
- /* "pywrapfst.pyx":1390
+ /* "pywrapfst.pyx":1450
* """
- * if not self._mapper.get().Write(tostring(source)):
- * raise FstIOError("Write failed: {!r}".format(source)) # <<<<<<<<<<<<<<
+ * 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, 1390, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1450, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- }
- }
- __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_source);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1390, __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, 1450, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
+ __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_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error)
+ __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)
__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, 1390, __pyx_L1_error)
+ __PYX_ERR(0, 1450, __pyx_L1_error)
- /* "pywrapfst.pyx":1389
+ /* "pywrapfst.pyx":1449
* FstIOError: Write failed.
* """
- * if not self._mapper.get().Write(tostring(source)): # <<<<<<<<<<<<<<
- * raise FstIOError("Write failed: {!r}".format(source))
+ * if not self._mapper.get().Write(path_tostring(source)): # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Write failed: {source!r}")
*
*/
}
- /* "pywrapfst.pyx":1376
+ /* "pywrapfst.pyx":1436
* return _read_EncodeMapper_from_string(state)
*
* cpdef void write(self, source) except *: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst.EncodeMapper.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
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("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, 1376, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1392
- * raise FstIOError("Write failed: {!r}".format(source))
+/* "pywrapfst.pyx":1452
+ * raise FstIOError(f"Write failed: {source!r}")
*
* cpdef bytes write_to_string(self): # <<<<<<<<<<<<<<
* """
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_23write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_9pywrapfst_12EncodeMapper_write_to_string(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
- std::stringstream __pyx_v_sstrm;
+ std::stringstream __pyx_v__sstrm;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_to_string", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1392, __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, 1452, __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, 1392, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1452, __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, 1392, __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, 1452, __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":1405
+ /* "pywrapfst.pyx":1465
* """
- * cdef stringstream sstrm
- * if not self._mapper.get().WriteStream(sstrm, b"<pywrapfst>"): # <<<<<<<<<<<<<<
+ * cdef stringstream _sstrm
+ * if not self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>"): # <<<<<<<<<<<<<<
* raise FstIOError("Write to string failed")
- * return sstrm.str()
+ * return _sstrm.str()
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1405, __pyx_L1_error)
+ __PYX_ERR(0, 1465, __pyx_L1_error)
}
- __pyx_t_5 = ((!(__pyx_v_self->_mapper.get()->Write(__pyx_v_sstrm, __pyx_k_pywrapfst) != 0)) != 0);
+ __pyx_t_5 = ((!(__pyx_v_self->_mapper.get()->Write(__pyx_v__sstrm, __pyx_k_pywrapfst) != 0)) != 0);
if (unlikely(__pyx_t_5)) {
- /* "pywrapfst.pyx":1406
- * cdef stringstream sstrm
- * if not self._mapper.get().WriteStream(sstrm, b"<pywrapfst>"):
+ /* "pywrapfst.pyx":1466
+ * cdef stringstream _sstrm
+ * if not self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>"):
* raise FstIOError("Write to string failed") # <<<<<<<<<<<<<<
- * return sstrm.str()
+ * return _sstrm.str()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1406, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1466, __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, 1406, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1466, __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, 1406, __pyx_L1_error)
+ __PYX_ERR(0, 1466, __pyx_L1_error)
- /* "pywrapfst.pyx":1405
+ /* "pywrapfst.pyx":1465
* """
- * cdef stringstream sstrm
- * if not self._mapper.get().WriteStream(sstrm, b"<pywrapfst>"): # <<<<<<<<<<<<<<
+ * cdef stringstream _sstrm
+ * if not self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>"): # <<<<<<<<<<<<<<
* raise FstIOError("Write to string failed")
- * return sstrm.str()
+ * return _sstrm.str()
*/
}
- /* "pywrapfst.pyx":1407
- * if not self._mapper.get().WriteStream(sstrm, b"<pywrapfst>"):
+ /* "pywrapfst.pyx":1467
+ * if not self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>"):
* raise FstIOError("Write to string failed")
- * return sstrm.str() # <<<<<<<<<<<<<<
+ * 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, 1407, __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, 1467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1392
- * raise FstIOError("Write failed: {!r}".format(source))
+ /* "pywrapfst.pyx":1452
+ * raise FstIOError(f"Write failed: {source!r}")
*
* cpdef bytes write_to_string(self): # <<<<<<<<<<<<<<
* """
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("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, 1392, __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, 1452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1409
- * return sstrm.str()
+/* "pywrapfst.pyx":1469
+ * return _sstrm.str()
*
* cpdef _EncodeMapperSymbolTableView input_symbols(self): # <<<<<<<<<<<<<<
* """
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("input_symbols", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1409, __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, 1469, __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, 1409, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __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, 1409, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView))))) __PYX_ERR(0, 1469, __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":1415
+ /* "pywrapfst.pyx":1475
* 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, 1415, __pyx_L1_error)
+ __PYX_ERR(0, 1475, __pyx_L1_error)
}
__pyx_t_5 = ((__pyx_v_self->_mapper.get()->InputSymbols() == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1416
+ /* "pywrapfst.pyx":1476
* """
* 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":1415
+ /* "pywrapfst.pyx":1475
* Returns the mapper's input symbol table, or None if none is present.
* """
* if self._mapper.get().InputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1417
+ /* "pywrapfst.pyx":1477
* 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, 1417, __pyx_L1_error)
+ __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, 1417, __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_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1409
- * return sstrm.str()
+ /* "pywrapfst.pyx":1469
+ * return _sstrm.str()
*
* cpdef _EncodeMapperSymbolTableView input_symbols(self): # <<<<<<<<<<<<<<
* """
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("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, 1409, __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, 1469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1419
+/* "pywrapfst.pyx":1479
* return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
*
* cpdef _EncodeMapperSymbolTableView output_symbols(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("output_symbols", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1419, __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, 1479, __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, 1419, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1479, __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, 1419, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView))))) __PYX_ERR(0, 1479, __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":1425
+ /* "pywrapfst.pyx":1485
* 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, 1425, __pyx_L1_error)
+ __PYX_ERR(0, 1485, __pyx_L1_error)
}
__pyx_t_5 = ((__pyx_v_self->_mapper.get()->OutputSymbols() == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1426
+ /* "pywrapfst.pyx":1486
* """
* 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":1425
+ /* "pywrapfst.pyx":1485
* Returns the mapper's output symbol table, or None if none is present.
* """
* if self._mapper.get().OutputSymbols() == NULL: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1427
+ /* "pywrapfst.pyx":1487
* if self._mapper.get().OutputSymbols() == NULL:
* return
* return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False) # <<<<<<<<<<<<<<
*
- * cdef void _set_input_symbols(self, _SymbolTable syms) except *:
+ * cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
*/
__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, 1427, __pyx_L1_error)
+ __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, 1427, __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_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1419
+ /* "pywrapfst.pyx":1479
* return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
*
* cpdef _EncodeMapperSymbolTableView output_symbols(self): # <<<<<<<<<<<<<<
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("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, 1419, __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, 1479, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1429
+/* "pywrapfst.pyx":1489
* return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
*
- * cdef void _set_input_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
- * if syms is None:
+ * cdef void _set_input_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
+ * if symbols is None:
* self._mapper.get().SetInputSymbols(NULL)
*/
-static void __pyx_f_9pywrapfst_12EncodeMapper__set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+static void __pyx_f_9pywrapfst_12EncodeMapper__set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
fst::SymbolTable const *__pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_set_input_symbols", 0);
- /* "pywrapfst.pyx":1430
+ /* "pywrapfst.pyx":1490
*
- * cdef void _set_input_symbols(self, _SymbolTable syms) except *:
- * if syms is None: # <<<<<<<<<<<<<<
+ * cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
+ * if symbols is None: # <<<<<<<<<<<<<<
* self._mapper.get().SetInputSymbols(NULL)
* return
*/
- __pyx_t_1 = (((PyObject *)__pyx_v_syms) == Py_None);
+ __pyx_t_1 = (((PyObject *)__pyx_v_symbols) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":1431
- * cdef void _set_input_symbols(self, _SymbolTable syms) except *:
- * if syms is None:
+ /* "pywrapfst.pyx":1491
+ * cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
+ * if symbols is None:
* self._mapper.get().SetInputSymbols(NULL) # <<<<<<<<<<<<<<
* return
- * self._mapper.get().SetInputSymbols(syms._raw_ptr_or_raise())
+ * 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, 1431, __pyx_L1_error)
+ __PYX_ERR(0, 1491, __pyx_L1_error)
}
__pyx_v_self->_mapper.get()->SetInputSymbols(NULL);
- /* "pywrapfst.pyx":1432
- * if syms is None:
+ /* "pywrapfst.pyx":1492
+ * if symbols is None:
* self._mapper.get().SetInputSymbols(NULL)
* return # <<<<<<<<<<<<<<
- * self._mapper.get().SetInputSymbols(syms._raw_ptr_or_raise())
+ * self._mapper.get().SetInputSymbols(symbols._raw_ptr_or_raise())
*
*/
goto __pyx_L0;
- /* "pywrapfst.pyx":1430
+ /* "pywrapfst.pyx":1490
*
- * cdef void _set_input_symbols(self, _SymbolTable syms) except *:
- * if syms is None: # <<<<<<<<<<<<<<
+ * cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
+ * if symbols is None: # <<<<<<<<<<<<<<
* self._mapper.get().SetInputSymbols(NULL)
* return
*/
}
- /* "pywrapfst.pyx":1433
+ /* "pywrapfst.pyx":1493
* self._mapper.get().SetInputSymbols(NULL)
* return
- * self._mapper.get().SetInputSymbols(syms._raw_ptr_or_raise()) # <<<<<<<<<<<<<<
+ * self._mapper.get().SetInputSymbols(symbols._raw_ptr_or_raise()) # <<<<<<<<<<<<<<
*
- * def set_input_symbols(self, _SymbolTable syms):
+ * def set_input_symbols(self, SymbolTableView symbols):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1433, __pyx_L1_error)
+ __PYX_ERR(0, 1493, __pyx_L1_error)
}
- if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
+ 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, 1433, __pyx_L1_error)
+ __PYX_ERR(0, 1493, __pyx_L1_error)
}
- __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_syms->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1433, __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_v_self->_mapper.get()->SetInputSymbols(__pyx_t_3);
- /* "pywrapfst.pyx":1429
+ /* "pywrapfst.pyx":1489
* return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
*
- * cdef void _set_input_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
- * if syms is None:
+ * cdef void _set_input_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
+ * if symbols is None:
* self._mapper.get().SetInputSymbols(NULL)
*/
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1435
- * self._mapper.get().SetInputSymbols(syms._raw_ptr_or_raise())
+/* "pywrapfst.pyx":1495
+ * self._mapper.get().SetInputSymbols(symbols._raw_ptr_or_raise())
*
- * def set_input_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
+ * def set_input_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
* """
- * set_input_symbols(self, syms)
+ * set_input_symbols(self, symbols)
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_29set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
-static char __pyx_doc_9pywrapfst_12EncodeMapper_28set_input_symbols[] = "\n set_input_symbols(self, syms)\n\n Sets the mapper's input symbol table.\n\n Passing None as a value will delete the input symbol table.\n\n Args:\n syms: A SymbolTable.\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_29set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
+static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_29set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols); /*proto*/
+static char __pyx_doc_9pywrapfst_12EncodeMapper_28set_input_symbols[] = "\n set_input_symbols(self, symbols)\n\n Sets the mapper's input symbol table.\n\n Passing None as a value will delete the input symbol table.\n\n Args:\n symbols: A SymbolTable.\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_29set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_input_symbols (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1435, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_28set_input_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1495, __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 */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_28set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_28set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_input_symbols", 0);
- /* "pywrapfst.pyx":1449
+ /* "pywrapfst.pyx":1509
* self.
* """
- * self._set_input_symbols(syms) # <<<<<<<<<<<<<<
+ * self._set_input_symbols(symbols) # <<<<<<<<<<<<<<
* return self
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_input_symbols");
- __PYX_ERR(0, 1449, __pyx_L1_error)
+ __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_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1449, __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)
- /* "pywrapfst.pyx":1450
+ /* "pywrapfst.pyx":1510
* """
- * self._set_input_symbols(syms)
+ * self._set_input_symbols(symbols)
* return self # <<<<<<<<<<<<<<
*
- * cdef void _set_output_symbols(self, _SymbolTable syms) except *:
+ * cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1435
- * self._mapper.get().SetInputSymbols(syms._raw_ptr_or_raise())
+ /* "pywrapfst.pyx":1495
+ * self._mapper.get().SetInputSymbols(symbols._raw_ptr_or_raise())
*
- * def set_input_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
+ * def set_input_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
* """
- * set_input_symbols(self, syms)
+ * set_input_symbols(self, symbols)
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":1452
+/* "pywrapfst.pyx":1512
* return self
*
- * cdef void _set_output_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
- * if syms is None:
+ * cdef void _set_output_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
+ * if symbols is None:
* self._mapper.get().SetOutputSymbols(NULL)
*/
-static void __pyx_f_9pywrapfst_12EncodeMapper__set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+static void __pyx_f_9pywrapfst_12EncodeMapper__set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
fst::SymbolTable const *__pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_set_output_symbols", 0);
- /* "pywrapfst.pyx":1453
+ /* "pywrapfst.pyx":1513
*
- * cdef void _set_output_symbols(self, _SymbolTable syms) except *:
- * if syms is None: # <<<<<<<<<<<<<<
+ * cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
+ * if symbols is None: # <<<<<<<<<<<<<<
* self._mapper.get().SetOutputSymbols(NULL)
* return
*/
- __pyx_t_1 = (((PyObject *)__pyx_v_syms) == Py_None);
+ __pyx_t_1 = (((PyObject *)__pyx_v_symbols) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":1454
- * cdef void _set_output_symbols(self, _SymbolTable syms) except *:
- * if syms is None:
+ /* "pywrapfst.pyx":1514
+ * cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
+ * if symbols is None:
* self._mapper.get().SetOutputSymbols(NULL) # <<<<<<<<<<<<<<
* return
- * self._mapper.get().SetOutputSymbols(syms._raw_ptr_or_raise())
+ * 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, 1454, __pyx_L1_error)
+ __PYX_ERR(0, 1514, __pyx_L1_error)
}
__pyx_v_self->_mapper.get()->SetOutputSymbols(NULL);
- /* "pywrapfst.pyx":1455
- * if syms is None:
+ /* "pywrapfst.pyx":1515
+ * if symbols is None:
* self._mapper.get().SetOutputSymbols(NULL)
* return # <<<<<<<<<<<<<<
- * self._mapper.get().SetOutputSymbols(syms._raw_ptr_or_raise())
+ * self._mapper.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
*
*/
goto __pyx_L0;
- /* "pywrapfst.pyx":1453
+ /* "pywrapfst.pyx":1513
*
- * cdef void _set_output_symbols(self, _SymbolTable syms) except *:
- * if syms is None: # <<<<<<<<<<<<<<
+ * cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
+ * if symbols is None: # <<<<<<<<<<<<<<
* self._mapper.get().SetOutputSymbols(NULL)
* return
*/
}
- /* "pywrapfst.pyx":1456
+ /* "pywrapfst.pyx":1516
* self._mapper.get().SetOutputSymbols(NULL)
* return
- * self._mapper.get().SetOutputSymbols(syms._raw_ptr_or_raise()) # <<<<<<<<<<<<<<
+ * self._mapper.get().SetOutputSymbols(symbols._raw_ptr_or_raise()) # <<<<<<<<<<<<<<
*
- * def set_output_symbols(self, _SymbolTable syms):
+ * def set_output_symbols(self, SymbolTableView symbols):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
- __PYX_ERR(0, 1456, __pyx_L1_error)
+ __PYX_ERR(0, 1516, __pyx_L1_error)
}
- if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
+ 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, 1456, __pyx_L1_error)
+ __PYX_ERR(0, 1516, __pyx_L1_error)
}
- __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_syms->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1456, __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_v_self->_mapper.get()->SetOutputSymbols(__pyx_t_3);
- /* "pywrapfst.pyx":1452
+ /* "pywrapfst.pyx":1512
* return self
*
- * cdef void _set_output_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
- * if syms is None:
+ * cdef void _set_output_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
+ * if symbols is None:
* self._mapper.get().SetOutputSymbols(NULL)
*/
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":1458
- * self._mapper.get().SetOutputSymbols(syms._raw_ptr_or_raise())
+/* "pywrapfst.pyx":1518
+ * self._mapper.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
*
- * def set_output_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
+ * def set_output_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
* """
- * set_output_symbols(self, syms)
+ * set_output_symbols(self, symbols)
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_31set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
-static char __pyx_doc_9pywrapfst_12EncodeMapper_30set_output_symbols[] = "\n set_output_symbols(self, syms)\n\n Sets the mapper's output symbol table.\n\n Passing None as a value will delete the output symbol table.\n\n Args:\n syms: A SymbolTable.\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_31set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
+static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_31set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols); /*proto*/
+static char __pyx_doc_9pywrapfst_12EncodeMapper_30set_output_symbols[] = "\n set_output_symbols(self, symbols)\n\n Sets the mapper's output symbol table.\n\n Passing None as a value will delete the output symbol table.\n\n Args:\n symbols: A SymbolTable.\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_31set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_output_symbols (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1458, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_30set_output_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1518, __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 */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_30set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_30set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_output_symbols", 0);
- /* "pywrapfst.pyx":1472
+ /* "pywrapfst.pyx":1532
* self.
* """
- * self._set_output_symbols(syms) # <<<<<<<<<<<<<<
+ * self._set_output_symbols(symbols) # <<<<<<<<<<<<<<
* return self
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_output_symbols");
- __PYX_ERR(0, 1472, __pyx_L1_error)
+ __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_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1472, __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)
- /* "pywrapfst.pyx":1473
+ /* "pywrapfst.pyx":1533
* """
- * self._set_output_symbols(syms)
+ * self._set_output_symbols(symbols)
* return self # <<<<<<<<<<<<<<
*
*
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":1458
- * self._mapper.get().SetOutputSymbols(syms._raw_ptr_or_raise())
+ /* "pywrapfst.pyx":1518
+ * self._mapper.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
*
- * def set_output_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
+ * def set_output_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
* """
- * set_output_symbols(self, syms)
+ * set_output_symbols(self, symbols)
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":1476
+/* "pywrapfst.pyx":1536
*
*
* cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper): # <<<<<<<<<<<<<<
struct __pyx_obj_9pywrapfst_EncodeMapper *__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("_init_EncodeMapper", 0);
- /* "pywrapfst.pyx":1477
+ /* "pywrapfst.pyx":1537
*
* 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, 1477, __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, 1537, __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":1478
+ /* "pywrapfst.pyx":1538
* 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, 1478, __pyx_L1_error)
+ __PYX_ERR(0, 1538, __pyx_L1_error)
}
__pyx_v_result->_mapper.reset(__pyx_v_mapper);
- /* "pywrapfst.pyx":1479
+ /* "pywrapfst.pyx":1539
* cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)
* result._mapper.reset(mapper)
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1476
+ /* "pywrapfst.pyx":1536
*
*
* cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1482
+/* "pywrapfst.pyx":1542
*
*
- * cpdef EncodeMapper _read_EncodeMapper_from_string(state): # <<<<<<<<<<<<<<
- * cdef stringstream sstrm
- * sstrm << tostring(state)
+ * cpdef EncodeMapper _read_EncodeMapper_from_string(string state): # <<<<<<<<<<<<<<
+ * cdef stringstream _sstrm
+ * _sstrm << state
*/
-static PyObject *__pyx_pw_9pywrapfst_15_read_EncodeMapper_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/
-static struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_f_9pywrapfst__read_EncodeMapper_from_string(PyObject *__pyx_v_state, CYTHON_UNUSED int __pyx_skip_dispatch) {
- std::stringstream __pyx_v_sstrm;
- std::unique_ptr<fst::script::EncodeMapperClass> __pyx_v_mapper;
+static PyObject *__pyx_pw_9pywrapfst_15_read_EncodeMapper_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state); /*proto*/
+static struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_f_9pywrapfst__read_EncodeMapper_from_string(std::string __pyx_v_state, CYTHON_UNUSED int __pyx_skip_dispatch) {
+ std::stringstream __pyx_v__sstrm;
+ std::unique_ptr<fst::script::EncodeMapperClass> __pyx_v__mapper;
struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- std::string __pyx_t_1;
- int __pyx_t_2;
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_read_EncodeMapper_from_string", 0);
- /* "pywrapfst.pyx":1484
- * cpdef EncodeMapper _read_EncodeMapper_from_string(state):
- * cdef stringstream sstrm
- * sstrm << tostring(state) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.EncodeMapperClass] mapper
- * mapper.reset(fst.EncodeMapperClass.ReadStream(sstrm, b"<pywrapfst>"))
+ /* "pywrapfst.pyx":1544
+ * cpdef EncodeMapper _read_EncodeMapper_from_string(string state):
+ * cdef stringstream _sstrm
+ * _sstrm << state # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.EncodeMapperClass] _mapper
+ * _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>"))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1484, __pyx_L1_error)
- (void)((__pyx_v_sstrm << __pyx_t_1));
+ (void)((__pyx_v__sstrm << __pyx_v_state));
- /* "pywrapfst.pyx":1486
- * sstrm << tostring(state)
- * cdef unique_ptr[fst.EncodeMapperClass] mapper
- * mapper.reset(fst.EncodeMapperClass.ReadStream(sstrm, b"<pywrapfst>")) # <<<<<<<<<<<<<<
- * if mapper.get() == NULL:
- * raise FstIOError("Read failed")
+ /* "pywrapfst.pyx":1546
+ * _sstrm << state
+ * cdef unique_ptr[fst.EncodeMapperClass] _mapper
+ * _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>")) # <<<<<<<<<<<<<<
+ * if _mapper.get() == NULL:
+ * raise FstIOError("Read from string failed")
*/
- __pyx_v_mapper.reset(fst::script::EncodeMapperClass::Read(__pyx_v_sstrm, __pyx_k_pywrapfst));
+ __pyx_v__mapper.reset(fst::script::EncodeMapperClass::Read(__pyx_v__sstrm, __pyx_k_pywrapfst));
- /* "pywrapfst.pyx":1487
- * cdef unique_ptr[fst.EncodeMapperClass] mapper
- * mapper.reset(fst.EncodeMapperClass.ReadStream(sstrm, b"<pywrapfst>"))
- * if mapper.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed")
- * return _init_EncodeMapper(mapper.release())
+ /* "pywrapfst.pyx":1547
+ * cdef unique_ptr[fst.EncodeMapperClass] _mapper
+ * _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>"))
+ * if _mapper.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstIOError("Read from string failed")
+ * return _init_EncodeMapper(_mapper.release())
*/
- __pyx_t_2 = ((__pyx_v_mapper.get() == NULL) != 0);
- if (unlikely(__pyx_t_2)) {
+ __pyx_t_1 = ((__pyx_v__mapper.get() == NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":1488
- * mapper.reset(fst.EncodeMapperClass.ReadStream(sstrm, b"<pywrapfst>"))
- * if mapper.get() == NULL:
- * raise FstIOError("Read failed") # <<<<<<<<<<<<<<
- * return _init_EncodeMapper(mapper.release())
+ /* "pywrapfst.pyx":1548
+ * _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_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1488, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
}
}
- __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_Read_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Read_failed);
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1488, __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_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)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 1488, __pyx_L1_error)
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __PYX_ERR(0, 1548, __pyx_L1_error)
- /* "pywrapfst.pyx":1487
- * cdef unique_ptr[fst.EncodeMapperClass] mapper
- * mapper.reset(fst.EncodeMapperClass.ReadStream(sstrm, b"<pywrapfst>"))
- * if mapper.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed")
- * return _init_EncodeMapper(mapper.release())
+ /* "pywrapfst.pyx":1547
+ * cdef unique_ptr[fst.EncodeMapperClass] _mapper
+ * _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>"))
+ * if _mapper.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstIOError("Read from string failed")
+ * return _init_EncodeMapper(_mapper.release())
*/
}
- /* "pywrapfst.pyx":1489
- * if mapper.get() == NULL:
- * raise FstIOError("Read failed")
- * return _init_EncodeMapper(mapper.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1549
+ * if _mapper.get() == NULL:
+ * raise FstIOError("Read from string failed")
+ * return _init_EncodeMapper(_mapper.release()) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapper(__pyx_v_mapper.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1489, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_t_3);
- __pyx_t_3 = 0;
+ __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_GOTREF(__pyx_t_2);
+ __pyx_r = ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_t_2);
+ __pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1482
+ /* "pywrapfst.pyx":1542
*
*
- * cpdef EncodeMapper _read_EncodeMapper_from_string(state): # <<<<<<<<<<<<<<
- * cdef stringstream sstrm
- * sstrm << tostring(state)
+ * cpdef EncodeMapper _read_EncodeMapper_from_string(string state): # <<<<<<<<<<<<<<
+ * cdef stringstream _sstrm
+ * _sstrm << state
*/
/* function exit code */
__pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("pywrapfst._read_EncodeMapper_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_15_read_EncodeMapper_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/
-static PyObject *__pyx_pw_9pywrapfst_15_read_EncodeMapper_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state) {
+static PyObject *__pyx_pw_9pywrapfst_15_read_EncodeMapper_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_15_read_EncodeMapper_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state) {
+ std::string __pyx_v_state;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_read_EncodeMapper_from_string (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_14_read_EncodeMapper_from_string(__pyx_self, ((PyObject *)__pyx_v_state));
+ 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)
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("pywrapfst._read_EncodeMapper_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_9pywrapfst_14_read_EncodeMapper_from_string(__pyx_self, ((std::string)__pyx_v_state));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_14_read_EncodeMapper_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state) {
+static PyObject *__pyx_pf_9pywrapfst_14_read_EncodeMapper_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state) {
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("_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, 1482, __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, 1542, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1515
+/* "pywrapfst.pyx":1575
*
* @staticmethod
* cdef string _local_render_svg(const string &dot): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_local_render_svg", 0);
- /* "pywrapfst.pyx":1516
+ /* "pywrapfst.pyx":1576
* @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, 1516, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1576, __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, 1516, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":1517
+ /* "pywrapfst.pyx":1577
* 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, 1517, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1577, __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, 1517, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1577, __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, 1517, __pyx_L1_error)
+ __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_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, 1517, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdin, __pyx_t_4) < 0) __PYX_ERR(0, 1577, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "pywrapfst.pyx":1518
+ /* "pywrapfst.pyx":1578
* 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, 1518, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1578, __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, 1518, __pyx_L1_error)
+ __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_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, 1517, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdout, __pyx_t_3) < 0) __PYX_ERR(0, 1577, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "pywrapfst.pyx":1516
+ /* "pywrapfst.pyx":1576
* @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__7, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1516, __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, 1576, __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":1519
+ /* "pywrapfst.pyx":1579
* 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, 1519, __pyx_L1_error)
+ __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_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, 1519, __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, 1579, __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, 1519, __pyx_L1_error)
+ __pyx_t_4 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1579, __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, 1519, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1579, __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, 1519, __pyx_L1_error)
+ __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, 1519, __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_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, 1519, __pyx_L1_error)
+ __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
goto __pyx_L0;
- /* "pywrapfst.pyx":1515
+ /* "pywrapfst.pyx":1575
*
* @staticmethod
* cdef string _local_render_svg(const string &dot): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1521
+/* "pywrapfst.pyx":1581
* return proc.communicate(dot.encode("utf8"))[0]
*
* def _repr_svg_(self): # <<<<<<<<<<<<<<
}
static PyObject *__pyx_pf_9pywrapfst_3Fst__repr_svg_(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
- std::stringstream __pyx_v_sstrm;
+ std::stringstream __pyx_v__sstrm;
bool __pyx_v_acceptor;
PyObject *__pyx_v_e = NULL;
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_17 = NULL;
PyObject *__pyx_t_18 = NULL;
PyObject *__pyx_t_19 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_repr_svg_", 0);
- /* "pywrapfst.pyx":1529
+ /* "pywrapfst.pyx":1589
* """
- * cdef stringstream sstrm
+ * cdef stringstream _sstrm
* cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) == # <<<<<<<<<<<<<<
* fst.kAcceptor)
- * fst.Draw(deref(self._fst), self._fst.get().InputSymbols(),
+ * 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, 1529, __pyx_L1_error)
+ __PYX_ERR(0, 1589, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1530
- * cdef stringstream sstrm
+ /* "pywrapfst.pyx":1590
+ * cdef stringstream _sstrm
* cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==
* fst.kAcceptor) # <<<<<<<<<<<<<<
- * fst.Draw(deref(self._fst), self._fst.get().InputSymbols(),
- * self._fst.get().OutputSymbols(), NULL, acceptor, b"", 8.5, 11,
+ * fst.Draw(deref(self._fst),
+ * self._fst.get().InputSymbols(),
*/
__pyx_v_acceptor = (__pyx_v_self->_fst.get()->Properties(fst::kAcceptor, 1) == fst::kAcceptor);
- /* "pywrapfst.pyx":1531
+ /* "pywrapfst.pyx":1591
* cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==
* fst.kAcceptor)
- * fst.Draw(deref(self._fst), self._fst.get().InputSymbols(), # <<<<<<<<<<<<<<
- * self._fst.get().OutputSymbols(), NULL, acceptor, b"", 8.5, 11,
- * True, False, 0.4, 0.25, 14, 5, b"g", False, sstrm,
+ * 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, 1531, __pyx_L1_error)
+ __PYX_ERR(0, 1591, __pyx_L1_error)
}
+
+ /* "pywrapfst.pyx":1592
+ * fst.kAcceptor)
+ * fst.Draw(deref(self._fst),
+ * self._fst.get().InputSymbols(), # <<<<<<<<<<<<<<
+ * self._fst.get().OutputSymbols(),
+ * NULL,
+ */
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1531, __pyx_L1_error)
+ __PYX_ERR(0, 1592, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1532
- * fst.kAcceptor)
- * fst.Draw(deref(self._fst), self._fst.get().InputSymbols(),
- * self._fst.get().OutputSymbols(), NULL, acceptor, b"", 8.5, 11, # <<<<<<<<<<<<<<
- * True, False, 0.4, 0.25, 14, 5, b"g", False, sstrm,
- * b"<pywrapfst>")
+ /* "pywrapfst.pyx":1593
+ * fst.Draw(deref(self._fst),
+ * self._fst.get().InputSymbols(),
+ * self._fst.get().OutputSymbols(), # <<<<<<<<<<<<<<
+ * NULL,
+ * acceptor,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1532, __pyx_L1_error)
+ __PYX_ERR(0, 1593, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1531
+ /* "pywrapfst.pyx":1591
* cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==
* fst.kAcceptor)
- * fst.Draw(deref(self._fst), self._fst.get().InputSymbols(), # <<<<<<<<<<<<<<
- * self._fst.get().OutputSymbols(), NULL, acceptor, b"", 8.5, 11,
- * True, False, 0.4, 0.25, 14, 5, b"g", False, sstrm,
+ * fst.Draw(deref(self._fst), # <<<<<<<<<<<<<<
+ * self._fst.get().InputSymbols(),
+ * self._fst.get().OutputSymbols(),
*/
- 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__8, 8.5, 11.0, 1, 0, 0.4, 0.25, 14, 5, __pyx_k_g, 0, __pyx_v_sstrm, __pyx_k_pywrapfst);
+ 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":1535
- * True, False, 0.4, 0.25, 14, 5, b"g", False, sstrm,
+ /* "pywrapfst.pyx":1609
+ * _sstrm,
* b"<pywrapfst>")
* try: # <<<<<<<<<<<<<<
- * return Fst._local_render_svg(sstrm.str())
+ * return Fst._local_render_svg(_sstrm.str())
* except Exception as e:
*/
{
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
- /* "pywrapfst.pyx":1536
+ /* "pywrapfst.pyx":1610
* b"<pywrapfst>")
* try:
- * return Fst._local_render_svg(sstrm.str()) # <<<<<<<<<<<<<<
+ * return Fst._local_render_svg(_sstrm.str()) # <<<<<<<<<<<<<<
* except Exception as e:
* 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, 1536, __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, 1610, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L7_try_return;
- /* "pywrapfst.pyx":1535
- * True, False, 0.4, 0.25, 14, 5, b"g", False, sstrm,
+ /* "pywrapfst.pyx":1609
+ * _sstrm,
* b"<pywrapfst>")
* try: # <<<<<<<<<<<<<<
- * return Fst._local_render_svg(sstrm.str())
+ * return Fst._local_render_svg(_sstrm.str())
* except Exception as e:
*/
}
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "pywrapfst.pyx":1537
+ /* "pywrapfst.pyx":1611
* try:
- * return Fst._local_render_svg(sstrm.str())
+ * return Fst._local_render_svg(_sstrm.str())
* except Exception as e: # <<<<<<<<<<<<<<
* logging.error("Dot rendering failed: %s", 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, 1537, __pyx_L5_except_error)
+ if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1611, __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":1538
- * return Fst._local_render_svg(sstrm.str())
+ /* "pywrapfst.pyx":1612
+ * 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, 1538, __pyx_L14_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_logging); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1612, __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, 1538, __pyx_L14_error)
+ __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_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, 1538, __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, 1612, __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, 1538, __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, 1612, __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, 1538, __pyx_L14_error)
+ __pyx_t_11 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1612, __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, 1538, __pyx_L14_error)
+ __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_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- /* "pywrapfst.pyx":1537
+ /* "pywrapfst.pyx":1611
* try:
- * return Fst._local_render_svg(sstrm.str())
+ * return Fst._local_render_svg(_sstrm.str())
* except Exception as e: # <<<<<<<<<<<<<<
* logging.error("Dot rendering failed: %s", e)
*
__Pyx_XGOTREF(__pyx_t_19);
__pyx_t_5 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
{
- __Pyx_DECREF(__pyx_v_e);
+ __Pyx_XDECREF(__pyx_v_e);
__pyx_v_e = NULL;
}
if (PY_MAJOR_VERSION >= 3) {
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
- /* "pywrapfst.pyx":1535
- * True, False, 0.4, 0.25, 14, 5, b"g", False, sstrm,
+ /* "pywrapfst.pyx":1609
+ * _sstrm,
* b"<pywrapfst>")
* try: # <<<<<<<<<<<<<<
- * return Fst._local_render_svg(sstrm.str())
+ * return Fst._local_render_svg(_sstrm.str())
* except Exception as e:
*/
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
}
- /* "pywrapfst.pyx":1521
+ /* "pywrapfst.pyx":1581
* return proc.communicate(dot.encode("utf8"))[0]
*
* def _repr_svg_(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1540
+/* "pywrapfst.pyx":1614
* logging.error("Dot rendering failed: %s", e)
*
* def __init__(self): # <<<<<<<<<<<<<<
- * raise FstDeletedConstructorError(
- * "Cannot construct {}".format(self.__class__.__name__))
+ * raise NotImplementedError(f"Cannot construct {self._class__.__name__}")
+ *
*/
/* Python wrapper */
__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_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":1541
+ /* "pywrapfst.pyx":1615
*
* def __init__(self):
- * raise FstDeletedConstructorError( # <<<<<<<<<<<<<<
- * "Cannot construct {}".format(self.__class__.__name__))
- *
- */
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
-
- /* "pywrapfst.pyx":1542
- * def __init__(self):
- * raise FstDeletedConstructorError(
- * "Cannot construct {}".format(self.__class__.__name__)) # <<<<<<<<<<<<<<
+ * raise NotImplementedError(f"Cannot construct {self._class__.__name__}") # <<<<<<<<<<<<<<
*
* # Registers the class for pickling; must be repeated in any subclass which
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1542, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1542, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1542, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(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_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, 1542, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- }
- }
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1541, __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, 1615, __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_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_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_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_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, 1541, __pyx_L1_error)
+ __PYX_ERR(0, 1615, __pyx_L1_error)
- /* "pywrapfst.pyx":1540
+ /* "pywrapfst.pyx":1614
* logging.error("Dot rendering failed: %s", e)
*
* def __init__(self): # <<<<<<<<<<<<<<
- * raise FstDeletedConstructorError(
- * "Cannot construct {}".format(self.__class__.__name__))
+ * raise NotImplementedError(f"Cannot construct {self._class__.__name__}")
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("pywrapfst.Fst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":1547
+/* "pywrapfst.pyx":1620
* # can't be derived by _init_XFst.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__reduce__", 0);
- /* "pywrapfst.pyx":1548
+ /* "pywrapfst.pyx":1621
*
* 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, 1548, __pyx_L1_error)
+ __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_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, 1548, __pyx_L1_error)
+ __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, 1548, __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_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1621, __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, 1548, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1621, __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":1547
+ /* "pywrapfst.pyx":1620
* # can't be derived by _init_XFst.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1550
+/* "pywrapfst.pyx":1623
* return (_read_Fst_from_string, (self.write_to_string(),))
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self))
+ * return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
*
*/
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- int __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":1551
+ /* "pywrapfst.pyx":1624
*
* def __repr__(self):
- * return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self)) # <<<<<<<<<<<<<<
+ * return f"<{self.fst_type()} Fst at 0x{id(self):x}>" # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Fst_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1551, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u__2);
+ __pyx_t_2 += 1;
+ __Pyx_GIVEREF(__pyx_kp_u__2);
+ 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, 1551, __pyx_L1_error)
+ __PYX_ERR(0, 1624, __pyx_L1_error)
}
- __pyx_t_3 = __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_3)) __PYX_ERR(0, 1551, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1551, __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_GOTREF(__pyx_t_4);
- __pyx_t_5 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && likely(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_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1551, __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, 0+__pyx_t_6, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
+ __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_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __Pyx_INCREF(__pyx_kp_u_Fst_at_0x);
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__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_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":1550
+ /* "pywrapfst.pyx":1623
* return (_read_Fst_from_string, (self.write_to_string(),))
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self))
+ * return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
*
*/
/* 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_7);
__Pyx_AddTraceback("pywrapfst.Fst.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1553
- * return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self))
+/* "pywrapfst.pyx":1626
+ * return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
*
* def __str__(self): # <<<<<<<<<<<<<<
* return self.print()
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "pywrapfst.pyx":1554
+ /* "pywrapfst.pyx":1627
*
* 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, 1554, __pyx_L1_error)
+ __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, 1554, __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, 1554, __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_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1553
- * return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self))
+ /* "pywrapfst.pyx":1626
+ * return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
*
* def __str__(self): # <<<<<<<<<<<<<<
* return self.print()
return __pyx_r;
}
-/* "pywrapfst.pyx":1556
+/* "pywrapfst.pyx":1629
* return self.print()
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arc_type", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1556, __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, 1629, __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, 1556, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1629, __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, 1556, __pyx_L1_error)
+ __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_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":1562
+ /* "pywrapfst.pyx":1635
* 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, 1562, __pyx_L1_error)
+ __PYX_ERR(0, 1635, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1556
+ /* "pywrapfst.pyx":1629
* return self.print()
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
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("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, 1556, __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, 1629, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1564
+/* "pywrapfst.pyx":1637
* return self._fst.get().ArcType()
*
* cpdef ArcIterator arcs(self, int64 state): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arcs", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1564, __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, 1637, __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, 1564, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1637, __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, 1564, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1637, __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, 1564, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_ArcIterator))))) __PYX_ERR(0, 1637, __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":1576
+ /* "pywrapfst.pyx":1649
* 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, 1576, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1576, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1649, __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, 1576, __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, 1649, __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":1564
+ /* "pywrapfst.pyx":1637
* return self._fst.get().ArcType()
*
* cpdef ArcIterator arcs(self, int64 state): # <<<<<<<<<<<<<<
static char __pyx_doc_9pywrapfst_3Fst_12arcs[] = "\n arcs(self, state)\n\n Returns an iterator over arcs leaving the specified state.\n\n Args:\n state: The source state ID.\n\n Returns:\n An ArcIterator.\n ";
static PyObject *__pyx_pw_9pywrapfst_3Fst_13arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
int64 __pyx_v_state;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__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, 1564, __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, 1637, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
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("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, 1564, __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, 1637, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1578
+/* "pywrapfst.pyx":1651
* return ArcIterator(self, state)
*
* cpdef Fst copy(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1578, __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, 1651, __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, 1578, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1651, __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, 1578, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 1651, __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":1584
+ /* "pywrapfst.pyx":1657
* 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, 1584, __pyx_L1_error)
+ __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, 1584, __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_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1578
+ /* "pywrapfst.pyx":1651
* return ArcIterator(self, state)
*
* cpdef Fst copy(self): # <<<<<<<<<<<<<<
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("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, 1578, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1586
+/* "pywrapfst.pyx":1659
* return _init_XFst(new fst.FstClass(deref(self._fst)))
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
* source,
- * _SymbolTable isymbols=None,
+ * SymbolTableView isymbols=None,
*/
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":1588
+ /* "pywrapfst.pyx":1661
* cpdef void draw(self,
* source,
- * _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable osymbols=None,
- * _SymbolTable ssymbols=None,
+ * SymbolTableView isymbols=None, # <<<<<<<<<<<<<<
+ * SymbolTableView osymbols=None,
+ * SymbolTableView ssymbols=None,
*/
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1589
+ /* "pywrapfst.pyx":1662
* source,
- * _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable ssymbols=None,
+ * SymbolTableView isymbols=None,
+ * SymbolTableView osymbols=None, # <<<<<<<<<<<<<<
+ * SymbolTableView ssymbols=None,
* bool acceptor=False,
*/
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1590
- * _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None,
- * _SymbolTable ssymbols=None, # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1663
+ * SymbolTableView isymbols=None,
+ * SymbolTableView osymbols=None,
+ * SymbolTableView ssymbols=None, # <<<<<<<<<<<<<<
* bool acceptor=False,
- * title=b"",
+ * title="",
*/
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1591
- * _SymbolTable osymbols=None,
- * _SymbolTable ssymbols=None,
+ /* "pywrapfst.pyx":1664
+ * SymbolTableView osymbols=None,
+ * SymbolTableView ssymbols=None,
* bool acceptor=False, # <<<<<<<<<<<<<<
- * title=b"",
+ * title="",
* double width=8.5,
*/
bool __pyx_v_acceptor = ((bool)0);
- PyObject *__pyx_v_title = ((PyObject *)__pyx_kp_b__8);
+ PyObject *__pyx_v_title = ((PyObject *)__pyx_kp_u__11);
double __pyx_v_width = ((double)8.5);
double __pyx_v_height = ((double)11.0);
- /* "pywrapfst.pyx":1595
+ /* "pywrapfst.pyx":1668
* double width=8.5,
* double height=11,
* bool portrait=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_portrait = ((bool)0);
- /* "pywrapfst.pyx":1596
+ /* "pywrapfst.pyx":1669
* double height=11,
* bool portrait=False,
* bool vertical=False, # <<<<<<<<<<<<<<
double __pyx_v_nodesep = ((double)0.25);
int32 __pyx_v_fontsize = ((int32)14);
int32 __pyx_v_precision = ((int32)5);
- PyObject *__pyx_v_float_format = ((PyObject *)__pyx_n_b_g);
+ PyObject *__pyx_v_float_format = ((PyObject *)__pyx_n_u_g);
- /* "pywrapfst.pyx":1602
+ /* "pywrapfst.pyx":1675
* int32 precision=5,
- * float_format=b"g",
+ * float_format="g",
* bool show_weight_one=False) except *: # <<<<<<<<<<<<<<
* """
* draw(self, source, isymbols=None, osymbols=None, ssymbols=None,
*/
bool __pyx_v_show_weight_one = ((bool)0);
- std::string __pyx_v_source_string;
- std::unique_ptr<std::ostream> __pyx_v_fstrm;
+ std::string __pyx_v__source;
+ std::unique_ptr<std::ostream> __pyx_v__fstrm;
fst::SymbolTable const *__pyx_v__isymbols;
fst::SymbolTable const *__pyx_v__osymbols;
fst::SymbolTable const *__pyx_v__ssymbols;
int __pyx_t_19;
fst::SymbolTable const *__pyx_t_20;
std::string __pyx_t_21;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("draw", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":1586
+ /* "pywrapfst.pyx":1659
* return _init_XFst(new fst.FstClass(deref(self._fst)))
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
* source,
- * _SymbolTable isymbols=None,
+ * SymbolTableView isymbols=None,
*/
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1586, __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, 1659, __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, 1586, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1659, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1586, __pyx_L1_error)
+ __pyx_t_4 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1659, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1586, __pyx_L1_error)
+ __pyx_t_5 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1659, __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, 1586, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_portrait); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1659, __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, 1586, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_vertical); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1659, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyFloat_FromDouble(__pyx_v_ranksep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1586, __pyx_L1_error)
+ __pyx_t_8 = PyFloat_FromDouble(__pyx_v_ranksep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1659, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = PyFloat_FromDouble(__pyx_v_nodesep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1586, __pyx_L1_error)
+ __pyx_t_9 = PyFloat_FromDouble(__pyx_v_nodesep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1659, __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, 1586, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_fontsize); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1659, __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, 1586, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyInt_From_int32_t(__pyx_v_precision); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1659, __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, 1586, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1659, __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, 1586, __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, 1659, __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, 1586, __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, 1659, __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, 1586, __pyx_L1_error)
+ __pyx_t_16 = PyTuple_New(16+__pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1659, __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, 1586, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
}
#endif
}
- /* "pywrapfst.pyx":1634
+ /* "pywrapfst.pyx":1707
* show_weight_one: Should weights equivalent to semiring One be printed?
* """
- * cdef string source_string = tostring(source) # <<<<<<<<<<<<<<
- * cdef unique_ptr[ostream] fstrm
- * fstrm.reset(new ofstream(source_string))
+ * cdef string _source = path_tostring(source) # <<<<<<<<<<<<<<
+ * cdef unique_ptr[ostream] _fstrm
+ * _fstrm.reset(new ofstream(_source))
*/
- __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1634, __pyx_L1_error)
- __pyx_v_source_string = __pyx_t_17;
+ __pyx_t_17 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1707, __pyx_L1_error)
+ __pyx_v__source = __pyx_t_17;
- /* "pywrapfst.pyx":1636
- * cdef string source_string = tostring(source)
- * cdef unique_ptr[ostream] fstrm
- * fstrm.reset(new ofstream(source_string)) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1709
+ * cdef string _source = path_tostring(source)
+ * cdef unique_ptr[ostream] _fstrm
+ * _fstrm.reset(new ofstream(_source)) # <<<<<<<<<<<<<<
* cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
* if isymbols is not None:
*/
- __pyx_v_fstrm.reset(new std::ofstream(__pyx_v_source_string));
+ __pyx_v__fstrm.reset(new std::ofstream(__pyx_v__source));
- /* "pywrapfst.pyx":1637
- * cdef unique_ptr[ostream] fstrm
- * fstrm.reset(new ofstream(source_string))
+ /* "pywrapfst.pyx":1710
+ * cdef unique_ptr[ostream] _fstrm
+ * _fstrm.reset(new ofstream(_source))
* 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_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1637, __pyx_L1_error)
+ __PYX_ERR(0, 1710, __pyx_L1_error)
}
__pyx_v__isymbols = __pyx_v_self->_fst.get()->InputSymbols();
- /* "pywrapfst.pyx":1638
- * fstrm.reset(new ofstream(source_string))
+ /* "pywrapfst.pyx":1711
+ * _fstrm.reset(new ofstream(_source))
* cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
* if isymbols is not None: # <<<<<<<<<<<<<<
* _isymbols = isymbols._raw_ptr_or_raise()
__pyx_t_19 = (__pyx_t_18 != 0);
if (__pyx_t_19) {
- /* "pywrapfst.pyx":1639
+ /* "pywrapfst.pyx":1712
* 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, 1639, __pyx_L1_error)
+ __PYX_ERR(0, 1712, __pyx_L1_error)
}
- __pyx_t_20 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1639, __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_v__isymbols = __pyx_t_20;
- /* "pywrapfst.pyx":1638
- * fstrm.reset(new ofstream(source_string))
+ /* "pywrapfst.pyx":1711
+ * _fstrm.reset(new ofstream(_source))
* cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
* if isymbols is not None: # <<<<<<<<<<<<<<
* _isymbols = isymbols._raw_ptr_or_raise()
*/
}
- /* "pywrapfst.pyx":1640
+ /* "pywrapfst.pyx":1713
* 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, 1640, __pyx_L1_error)
+ __PYX_ERR(0, 1713, __pyx_L1_error)
}
__pyx_v__osymbols = __pyx_v_self->_fst.get()->OutputSymbols();
- /* "pywrapfst.pyx":1641
+ /* "pywrapfst.pyx":1714
* _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":1642
+ /* "pywrapfst.pyx":1715
* 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, 1642, __pyx_L1_error)
+ __PYX_ERR(0, 1715, __pyx_L1_error)
}
- __pyx_t_20 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1642, __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_v__osymbols = __pyx_t_20;
- /* "pywrapfst.pyx":1641
+ /* "pywrapfst.pyx":1714
* _isymbols = isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
* if osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1643
+ /* "pywrapfst.pyx":1716
* if osymbols is not None:
* _osymbols = osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_ssymbols = NULL # <<<<<<<<<<<<<<
*/
__pyx_v__ssymbols = NULL;
- /* "pywrapfst.pyx":1644
+ /* "pywrapfst.pyx":1717
* _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":1645
+ /* "pywrapfst.pyx":1718
* cdef const fst.SymbolTable *_ssymbols = NULL
* if ssymbols is not None:
* _ssymbols = ssymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
* fst.Draw(deref(self._fst),
- * _isymbols,
+ * _isymbols,
*/
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, 1645, __pyx_L1_error)
+ __PYX_ERR(0, 1718, __pyx_L1_error)
}
- __pyx_t_20 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_ssymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_ssymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1645, __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_v__ssymbols = __pyx_t_20;
- /* "pywrapfst.pyx":1644
+ /* "pywrapfst.pyx":1717
* _osymbols = osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1646
+ /* "pywrapfst.pyx":1719
* if ssymbols is not None:
* _ssymbols = ssymbols._raw_ptr_or_raise()
* fst.Draw(deref(self._fst), # <<<<<<<<<<<<<<
- * _isymbols,
- * _osymbols,
+ * _isymbols,
+ * _osymbols,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1646, __pyx_L1_error)
+ __PYX_ERR(0, 1719, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1651
- * _ssymbols,
- * acceptor,
- * tostring(title), # <<<<<<<<<<<<<<
- * width,
- * height,
+ /* "pywrapfst.pyx":1724
+ * _ssymbols,
+ * acceptor,
+ * tostring(title), # <<<<<<<<<<<<<<
+ * width,
+ * height,
*/
- __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_title); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1651, __pyx_L1_error)
+ __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_title); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1724, __pyx_L1_error)
- /* "pywrapfst.pyx":1660
- * fontsize,
- * precision,
- * tostring(float_format), # <<<<<<<<<<<<<<
- * show_weight_one,
- * deref(fstrm),
+ /* "pywrapfst.pyx":1733
+ * 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, 1660, __pyx_L1_error)
+ __pyx_t_21 = __pyx_f_9pywrapfst_tostring(__pyx_v_float_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1733, __pyx_L1_error)
- /* "pywrapfst.pyx":1646
+ /* "pywrapfst.pyx":1719
* if ssymbols is not None:
* _ssymbols = ssymbols._raw_ptr_or_raise()
* fst.Draw(deref(self._fst), # <<<<<<<<<<<<<<
- * _isymbols,
- * _osymbols,
+ * _isymbols,
+ * _osymbols,
*/
- 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_string);
+ 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":1586
+ /* "pywrapfst.pyx":1659
* return _init_XFst(new fst.FstClass(deref(self._fst)))
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
* source,
- * _SymbolTable isymbols=None,
+ * SymbolTableView isymbols=None,
*/
/* function exit code */
static char __pyx_doc_9pywrapfst_3Fst_16draw[] = "\n draw(self, source, isymbols=None, osymbols=None, ssymbols=None,\n acceptor=False, title=\"\", width=8.5, height=11, portrait=False,\n vertical=False, ranksep=0.4, nodesep=0.25, fontsize=14,\n precision=5, float_format=\"g\", show_weight_one=False):\n\n Writes out the FST in Graphviz text format.\n\n This method writes out the FST in the dot graph description language. The\n graph can be rendered using the `dot` executable provided by Graphviz.\n\n Args:\n source: The string location of the output dot/Graphviz file.\n isymbols: An optional symbol table used to label input symbols.\n osymbols: An optional symbol table used to label output symbols.\n ssymbols: An optional symbol table used to label states.\n acceptor: Should the figure be rendered in acceptor format if possible?\n title: An optional string indicating the figure title.\n width: The figure width, in inches.\n height: The figure height, in inches.\n portrait: Should the figure be rendered in portrait rather than\n landscape?\n vertical: Should the figure be rendered bottom-to-top rather than\n left-to-right?\n ranksep: The minimum separation separation between ranks, in inches.\n nodesep: The minimum separation between nodes, in inches.\n fontsize: Font size, in points.\n precision: Numeric precision for floats, in number of chars.\n float_format: One of: 'e', 'f' or 'g'.\n show_weight_one: Should weights equivalent to semiring One be printed?\n ";
static PyObject *__pyx_pw_9pywrapfst_3Fst_17draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_source = 0;
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = 0;
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = 0;
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = 0;
bool __pyx_v_acceptor;
PyObject *__pyx_v_title = 0;
double __pyx_v_width;
int32 __pyx_v_precision;
PyObject *__pyx_v_float_format = 0;
bool __pyx_v_show_weight_one;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("draw (wrapper)", 0);
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":1588
+ /* "pywrapfst.pyx":1661
* cpdef void draw(self,
* source,
- * _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable osymbols=None,
- * _SymbolTable ssymbols=None,
+ * SymbolTableView isymbols=None, # <<<<<<<<<<<<<<
+ * SymbolTableView osymbols=None,
+ * SymbolTableView ssymbols=None,
*/
- values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+ values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1589
+ /* "pywrapfst.pyx":1662
* source,
- * _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable ssymbols=None,
+ * SymbolTableView isymbols=None,
+ * SymbolTableView osymbols=None, # <<<<<<<<<<<<<<
+ * SymbolTableView ssymbols=None,
* bool acceptor=False,
*/
- values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+ values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1590
- * _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None,
- * _SymbolTable ssymbols=None, # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1663
+ * SymbolTableView isymbols=None,
+ * SymbolTableView osymbols=None,
+ * SymbolTableView ssymbols=None, # <<<<<<<<<<<<<<
* bool acceptor=False,
- * title=b"",
+ * title="",
*/
- values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- values[5] = ((PyObject *)__pyx_kp_b__8);
- values[14] = ((PyObject *)__pyx_n_b_g);
+ values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
+ values[5] = ((PyObject *)__pyx_kp_u__11);
+ values[14] = ((PyObject *)__pyx_n_u_g);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 1586, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 1659, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
}
__pyx_v_source = values[0];
- __pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[1]);
- __pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[2]);
- __pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[3]);
+ __pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[1]);
+ __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, 1591, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1664, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1591
- * _SymbolTable osymbols=None,
- * _SymbolTable ssymbols=None,
+ /* "pywrapfst.pyx":1664
+ * SymbolTableView osymbols=None,
+ * SymbolTableView ssymbols=None,
* bool acceptor=False, # <<<<<<<<<<<<<<
- * title=b"",
+ * title="",
* double width=8.5,
*/
__pyx_v_acceptor = ((bool)0);
}
__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, 1593, __pyx_L3_error)
+ __pyx_v_width = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_width == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1666, __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, 1594, __pyx_L3_error)
+ __pyx_v_height = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_height == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1667, __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, 1595, __pyx_L3_error)
+ __pyx_v_portrait = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_portrait == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1668, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1595
+ /* "pywrapfst.pyx":1668
* 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, 1596, __pyx_L3_error)
+ __pyx_v_vertical = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_vertical == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1669, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1596
+ /* "pywrapfst.pyx":1669
* 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, 1597, __pyx_L3_error)
+ __pyx_v_ranksep = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_ranksep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1670, __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, 1598, __pyx_L3_error)
+ __pyx_v_nodesep = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_nodesep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1671, __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, 1599, __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, 1672, __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, 1600, __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, 1673, __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, 1602, __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, 1675, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1602
+ /* "pywrapfst.pyx":1675
* int32 precision=5,
- * float_format=b"g",
+ * float_format="g",
* bool show_weight_one=False) except *: # <<<<<<<<<<<<<<
* """
* draw(self, source, isymbols=None, osymbols=None, ssymbols=None,
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1586, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1659, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Fst.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1588, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1589, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1590, __pyx_L1_error)
+ 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)
__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":1586
+ /* "pywrapfst.pyx":1659
* return _init_XFst(new fst.FstClass(deref(self._fst)))
*
* cpdef void draw(self, # <<<<<<<<<<<<<<
* source,
- * _SymbolTable isymbols=None,
+ * SymbolTableView isymbols=None,
*/
/* function exit code */
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_3Fst_16draw(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, PyObject *__pyx_v_title, double __pyx_v_width, double __pyx_v_height, bool __pyx_v_portrait, bool __pyx_v_vertical, double __pyx_v_ranksep, double __pyx_v_nodesep, int32 __pyx_v_fontsize, int32 __pyx_v_precision, PyObject *__pyx_v_float_format, bool __pyx_v_show_weight_one) {
+static PyObject *__pyx_pf_9pywrapfst_3Fst_16draw(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, 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, PyObject *__pyx_v_title, double __pyx_v_width, double __pyx_v_height, bool __pyx_v_portrait, bool __pyx_v_vertical, double __pyx_v_ranksep, double __pyx_v_nodesep, int32 __pyx_v_fontsize, int32 __pyx_v_precision, PyObject *__pyx_v_float_format, bool __pyx_v_show_weight_one) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_3Fst_draw __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("draw", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1.__pyx_n = 15;
__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, 1586, __pyx_L1_error)
- __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __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, 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_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1665
- * source_string)
+/* "pywrapfst.pyx":1738
+ * _source)
*
* cpdef Weight final(self, int64 state): # <<<<<<<<<<<<<<
* """
static PyObject *__pyx_pw_9pywrapfst_3Fst_19final(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_3Fst_final(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_weight = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("final", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1665, __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, 1738, __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, 1665, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1738, __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, 1665, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1738, __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, 1665, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 1738, __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":1680
+ /* "pywrapfst.pyx":1753
* 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():
+ * 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, 1680, __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, 1753, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":1681
+ /* "pywrapfst.pyx":1754
* """
- * cdef Weight weight = Weight.__new__(Weight)
- * weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state))) # <<<<<<<<<<<<<<
- * if not weight.member():
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state))) # <<<<<<<<<<<<<<
+ * if not _weight.member():
* raise FstIndexError("State index out of range")
*/
- if (unlikely(((PyObject *)__pyx_v_weight) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 1681, __pyx_L1_error)
+ __PYX_ERR(0, 1754, __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, 1681, __pyx_L1_error)
+ __PYX_ERR(0, 1754, __pyx_L1_error)
}
- __pyx_v_weight->_weight.reset(new fst::script::WeightClass(__pyx_v_self->_fst.get()->Final(__pyx_v_state)));
+ __pyx_v__weight->_weight.reset(new fst::script::WeightClass(__pyx_v_self->_fst.get()->Final(__pyx_v_state)));
- /* "pywrapfst.pyx":1682
- * cdef Weight weight = Weight.__new__(Weight)
- * weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
- * if not weight.member(): # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1755
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
+ * if not _weight.member(): # <<<<<<<<<<<<<<
* raise FstIndexError("State index out of range")
- * return weight
+ * return _weight
*/
- if (unlikely(((PyObject *)__pyx_v_weight) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "member");
- __PYX_ERR(0, 1682, __pyx_L1_error)
+ __PYX_ERR(0, 1755, __pyx_L1_error)
}
- __pyx_t_6 = ((!(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_weight->__pyx_vtab)->member(__pyx_v_weight, 0) != 0)) != 0);
+ __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":1683
- * weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
- * if not weight.member():
+ /* "pywrapfst.pyx":1756
+ * _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
+ * if not _weight.member():
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
- * return weight
+ * return _weight
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1683, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1756, __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, 1683, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1756, __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, 1683, __pyx_L1_error)
+ __PYX_ERR(0, 1756, __pyx_L1_error)
- /* "pywrapfst.pyx":1682
- * cdef Weight weight = Weight.__new__(Weight)
- * weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
- * if not weight.member(): # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":1755
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
+ * if not _weight.member(): # <<<<<<<<<<<<<<
* raise FstIndexError("State index out of range")
- * return weight
+ * return _weight
*/
}
- /* "pywrapfst.pyx":1684
- * if not weight.member():
+ /* "pywrapfst.pyx":1757
+ * if not _weight.member():
* raise FstIndexError("State index out of range")
- * return weight # <<<<<<<<<<<<<<
+ * return _weight # <<<<<<<<<<<<<<
*
* cpdef string fst_type(self):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_weight));
- __pyx_r = __pyx_v_weight;
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = __pyx_v__weight;
goto __pyx_L0;
- /* "pywrapfst.pyx":1665
- * source_string)
+ /* "pywrapfst.pyx":1738
+ * _source)
*
* cpdef Weight final(self, int64 state): # <<<<<<<<<<<<<<
* """
__Pyx_AddTraceback("pywrapfst.Fst.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_weight);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
static char __pyx_doc_9pywrapfst_3Fst_18final[] = "\n final(self, state)\n\n Returns the final weight of a state.\n\n Args:\n state: The integer index of a state.\n\n Returns:\n The final Weight of that state.\n\n Raises:\n FstIndexError: State index out of range.\n ";
static PyObject *__pyx_pw_9pywrapfst_3Fst_19final(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
int64 __pyx_v_state;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__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, 1665, __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, 1738, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
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("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, 1665, __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, 1738, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1686
- * return weight
+/* "pywrapfst.pyx":1759
+ * return _weight
*
* cpdef string fst_type(self): # <<<<<<<<<<<<<<
* """
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fst_type", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1686, __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, 1759, __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, 1686, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __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, 1686, __pyx_L1_error)
+ __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_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":1692
+ /* "pywrapfst.pyx":1765
* 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, 1692, __pyx_L1_error)
+ __PYX_ERR(0, 1765, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->FstType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1686
- * return weight
+ /* "pywrapfst.pyx":1759
+ * return _weight
*
* cpdef string fst_type(self): # <<<<<<<<<<<<<<
* """
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("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, 1686, __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, 1759, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1694
+/* "pywrapfst.pyx":1767
* return self._fst.get().FstType()
*
* cpdef _FstSymbolTableView input_symbols(self): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_3Fst_23input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_f_9pywrapfst_3Fst_input_symbols(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
- fst::SymbolTable const *__pyx_v_syms;
struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("input_symbols", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1694, __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, 1767, __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, 1694, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1767, __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, 1694, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__FstSymbolTableView))))) __PYX_ERR(0, 1767, __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":1700
+ /* "pywrapfst.pyx":1773
* Returns the FST's input symbol table, or None if none is present.
* """
- * cdef const fst.SymbolTable *syms = self._fst.get().InputSymbols() # <<<<<<<<<<<<<<
- * if syms == NULL:
+ * if self._fst.get().InputSymbols() == NULL: # <<<<<<<<<<<<<<
* return
+ * return _init_FstSymbolTableView(self._fst, input_side=True)
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1700, __pyx_L1_error)
+ __PYX_ERR(0, 1773, __pyx_L1_error)
}
- __pyx_v_syms = __pyx_v_self->_fst.get()->InputSymbols();
-
- /* "pywrapfst.pyx":1701
- * """
- * cdef const fst.SymbolTable *syms = self._fst.get().InputSymbols()
- * if syms == NULL: # <<<<<<<<<<<<<<
- * return
- * return _init_FstSymbolTableView(self._fst, input_side=True)
- */
- __pyx_t_5 = ((__pyx_v_syms == NULL) != 0);
+ __pyx_t_5 = ((__pyx_v_self->_fst.get()->InputSymbols() == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1702
- * cdef const fst.SymbolTable *syms = self._fst.get().InputSymbols()
- * if syms == NULL:
+ /* "pywrapfst.pyx":1774
+ * """
+ * if self._fst.get().InputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
* return _init_FstSymbolTableView(self._fst, input_side=True)
*
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1701
+ /* "pywrapfst.pyx":1773
+ * Returns the FST's input symbol table, or None if none is present.
* """
- * cdef const fst.SymbolTable *syms = self._fst.get().InputSymbols()
- * if syms == NULL: # <<<<<<<<<<<<<<
+ * if self._fst.get().InputSymbols() == NULL: # <<<<<<<<<<<<<<
* return
* return _init_FstSymbolTableView(self._fst, input_side=True)
*/
}
- /* "pywrapfst.pyx":1703
- * if syms == NULL:
+ /* "pywrapfst.pyx":1775
+ * 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, 1703, __pyx_L1_error)
+ __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, 1703, __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_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1694
+ /* "pywrapfst.pyx":1767
* return self._fst.get().FstType()
*
* cpdef _FstSymbolTableView input_symbols(self): # <<<<<<<<<<<<<<
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("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, 1694, __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, 1767, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1705
+/* "pywrapfst.pyx":1777
* return _init_FstSymbolTableView(self._fst, input_side=True)
*
* cpdef size_t num_arcs(self, int64 state) except *: # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_3Fst_25num_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static size_t __pyx_f_9pywrapfst_3Fst_num_arcs(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch) {
- size_t __pyx_v_result;
+ size_t __pyx_v__result;
size_t __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_5 = NULL;
size_t __pyx_t_6;
int __pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("num_arcs", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1705, __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, 1777, __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, 1705, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1777, __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, 1705, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1777, __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, 1705, __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, 1777, __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":1720
+ /* "pywrapfst.pyx":1792
* FstIndexError: State index out of range.
* """
- * cdef size_t result = self._fst.get().NumArcs(state) # <<<<<<<<<<<<<<
- * if result == SIZE_MAX:
+ * cdef size_t _result = self._fst.get().NumArcs(state) # <<<<<<<<<<<<<<
+ * if _result == SIZE_MAX:
* raise FstIndexError("State index out of range")
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1720, __pyx_L1_error)
+ __PYX_ERR(0, 1792, __pyx_L1_error)
}
- __pyx_v_result = __pyx_v_self->_fst.get()->NumArcs(__pyx_v_state);
+ __pyx_v__result = __pyx_v_self->_fst.get()->NumArcs(__pyx_v_state);
- /* "pywrapfst.pyx":1721
+ /* "pywrapfst.pyx":1793
* """
- * cdef size_t result = self._fst.get().NumArcs(state)
- * if result == SIZE_MAX: # <<<<<<<<<<<<<<
+ * cdef size_t _result = self._fst.get().NumArcs(state)
+ * if _result == SIZE_MAX: # <<<<<<<<<<<<<<
* raise FstIndexError("State index out of range")
- * return result
+ * return _result
*/
- __pyx_t_7 = ((__pyx_v_result == SIZE_MAX) != 0);
+ __pyx_t_7 = ((__pyx_v__result == SIZE_MAX) != 0);
if (unlikely(__pyx_t_7)) {
- /* "pywrapfst.pyx":1722
- * cdef size_t result = self._fst.get().NumArcs(state)
- * if result == SIZE_MAX:
+ /* "pywrapfst.pyx":1794
+ * cdef size_t _result = self._fst.get().NumArcs(state)
+ * if _result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
- * return result
+ * return _result
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1722, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __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, 1722, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1794, __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, 1722, __pyx_L1_error)
+ __PYX_ERR(0, 1794, __pyx_L1_error)
- /* "pywrapfst.pyx":1721
+ /* "pywrapfst.pyx":1793
* """
- * cdef size_t result = self._fst.get().NumArcs(state)
- * if result == SIZE_MAX: # <<<<<<<<<<<<<<
+ * cdef size_t _result = self._fst.get().NumArcs(state)
+ * if _result == SIZE_MAX: # <<<<<<<<<<<<<<
* raise FstIndexError("State index out of range")
- * return result
+ * return _result
*/
}
- /* "pywrapfst.pyx":1723
- * if result == SIZE_MAX:
+ /* "pywrapfst.pyx":1795
+ * if _result == SIZE_MAX:
* raise FstIndexError("State index out of range")
- * return result # <<<<<<<<<<<<<<
+ * return _result # <<<<<<<<<<<<<<
*
* cpdef size_t num_input_epsilons(self, int64 state) except *:
*/
- __pyx_r = __pyx_v_result;
+ __pyx_r = __pyx_v__result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1705
+ /* "pywrapfst.pyx":1777
* return _init_FstSymbolTableView(self._fst, input_side=True)
*
* cpdef size_t num_arcs(self, int64 state) except *: # <<<<<<<<<<<<<<
static char __pyx_doc_9pywrapfst_3Fst_24num_arcs[] = "\n num_arcs(self, state)\n\n Returns the number of arcs leaving a state.\n\n Args:\n state: The integer index of a state.\n\n Returns:\n The number of arcs leaving that state.\n\n Raises:\n FstIndexError: State index out of range.\n ";
static PyObject *__pyx_pw_9pywrapfst_3Fst_25num_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
int64 __pyx_v_state;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__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, 1705, __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, 1777, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
size_t __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ 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, 1705, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __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, 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_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1725
- * return result
+/* "pywrapfst.pyx":1797
+ * return _result
*
* cpdef size_t num_input_epsilons(self, int64 state) except *: # <<<<<<<<<<<<<<
* """
static PyObject *__pyx_pw_9pywrapfst_3Fst_27num_input_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static size_t __pyx_f_9pywrapfst_3Fst_num_input_epsilons(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch) {
- size_t __pyx_v_result;
+ size_t __pyx_v__result;
size_t __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_5 = NULL;
size_t __pyx_t_6;
int __pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("num_input_epsilons", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1725, __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, 1797, __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, 1725, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1797, __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, 1725, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1797, __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, 1725, __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, 1797, __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":1740
+ /* "pywrapfst.pyx":1812
* FstIndexError: State index out of range.
* """
- * cdef size_t result = self._fst.get().NumInputEpsilons(state) # <<<<<<<<<<<<<<
- * if result == SIZE_MAX:
+ * cdef size_t _result = self._fst.get().NumInputEpsilons(state) # <<<<<<<<<<<<<<
+ * if _result == SIZE_MAX:
* raise FstIndexError("State index out of range")
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1740, __pyx_L1_error)
+ __PYX_ERR(0, 1812, __pyx_L1_error)
}
- __pyx_v_result = __pyx_v_self->_fst.get()->NumInputEpsilons(__pyx_v_state);
+ __pyx_v__result = __pyx_v_self->_fst.get()->NumInputEpsilons(__pyx_v_state);
- /* "pywrapfst.pyx":1741
+ /* "pywrapfst.pyx":1813
* """
- * cdef size_t result = self._fst.get().NumInputEpsilons(state)
- * if result == SIZE_MAX: # <<<<<<<<<<<<<<
+ * cdef size_t _result = self._fst.get().NumInputEpsilons(state)
+ * if _result == SIZE_MAX: # <<<<<<<<<<<<<<
* raise FstIndexError("State index out of range")
- * return result
+ * return _result
*/
- __pyx_t_7 = ((__pyx_v_result == SIZE_MAX) != 0);
+ __pyx_t_7 = ((__pyx_v__result == SIZE_MAX) != 0);
if (unlikely(__pyx_t_7)) {
- /* "pywrapfst.pyx":1742
- * cdef size_t result = self._fst.get().NumInputEpsilons(state)
- * if result == SIZE_MAX:
+ /* "pywrapfst.pyx":1814
+ * cdef size_t _result = self._fst.get().NumInputEpsilons(state)
+ * if _result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
- * return result
+ * return _result
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1742, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1814, __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, 1742, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1814, __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, 1742, __pyx_L1_error)
+ __PYX_ERR(0, 1814, __pyx_L1_error)
- /* "pywrapfst.pyx":1741
+ /* "pywrapfst.pyx":1813
* """
- * cdef size_t result = self._fst.get().NumInputEpsilons(state)
- * if result == SIZE_MAX: # <<<<<<<<<<<<<<
+ * cdef size_t _result = self._fst.get().NumInputEpsilons(state)
+ * if _result == SIZE_MAX: # <<<<<<<<<<<<<<
* raise FstIndexError("State index out of range")
- * return result
+ * return _result
*/
}
- /* "pywrapfst.pyx":1743
- * if result == SIZE_MAX:
+ /* "pywrapfst.pyx":1815
+ * if _result == SIZE_MAX:
* raise FstIndexError("State index out of range")
- * return result # <<<<<<<<<<<<<<
+ * return _result # <<<<<<<<<<<<<<
*
* cpdef size_t num_output_epsilons(self, int64 state) except *:
*/
- __pyx_r = __pyx_v_result;
+ __pyx_r = __pyx_v__result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1725
- * return result
+ /* "pywrapfst.pyx":1797
+ * return _result
*
* cpdef size_t num_input_epsilons(self, int64 state) except *: # <<<<<<<<<<<<<<
* """
static char __pyx_doc_9pywrapfst_3Fst_26num_input_epsilons[] = "\n num_input_epsilons(self, state)\n\n Returns the number of arcs with epsilon input labels leaving a state.\n\n Args:\n state: The integer index of a state.\n\n Returns:\n The number of epsilon-input-labeled arcs leaving that state.\n\n Raises:\n FstIndexError: State index out of range.\n ";
static PyObject *__pyx_pw_9pywrapfst_3Fst_27num_input_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
int64 __pyx_v_state;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__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, 1725, __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, 1797, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
size_t __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ 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, 1725, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1725, __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, 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_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1745
- * return result
+/* "pywrapfst.pyx":1817
+ * return _result
*
* cpdef size_t num_output_epsilons(self, int64 state) except *: # <<<<<<<<<<<<<<
* """
static PyObject *__pyx_pw_9pywrapfst_3Fst_29num_output_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*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) {
- size_t __pyx_v_result;
+ size_t __pyx_v__result;
size_t __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_5 = NULL;
size_t __pyx_t_6;
int __pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("num_output_epsilons", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1745, __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, 1817, __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, 1745, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1817, __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, 1745, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1817, __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, 1745, __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, 1817, __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":1760
+ /* "pywrapfst.pyx":1832
* FstIndexError: State index out of range.
* """
- * cdef size_t result = self._fst.get().NumOutputEpsilons(state) # <<<<<<<<<<<<<<
- * if result == SIZE_MAX:
+ * cdef size_t _result = self._fst.get().NumOutputEpsilons(state) # <<<<<<<<<<<<<<
+ * if _result == SIZE_MAX:
* raise FstIndexError("State index out of range")
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1760, __pyx_L1_error)
+ __PYX_ERR(0, 1832, __pyx_L1_error)
}
- __pyx_v_result = __pyx_v_self->_fst.get()->NumOutputEpsilons(__pyx_v_state);
+ __pyx_v__result = __pyx_v_self->_fst.get()->NumOutputEpsilons(__pyx_v_state);
- /* "pywrapfst.pyx":1761
+ /* "pywrapfst.pyx":1833
* """
- * cdef size_t result = self._fst.get().NumOutputEpsilons(state)
- * if result == SIZE_MAX: # <<<<<<<<<<<<<<
+ * cdef size_t _result = self._fst.get().NumOutputEpsilons(state)
+ * if _result == SIZE_MAX: # <<<<<<<<<<<<<<
* raise FstIndexError("State index out of range")
- * return result
+ * return _result
*/
- __pyx_t_7 = ((__pyx_v_result == SIZE_MAX) != 0);
+ __pyx_t_7 = ((__pyx_v__result == SIZE_MAX) != 0);
if (unlikely(__pyx_t_7)) {
- /* "pywrapfst.pyx":1762
- * cdef size_t result = self._fst.get().NumOutputEpsilons(state)
- * if result == SIZE_MAX:
+ /* "pywrapfst.pyx":1834
+ * cdef size_t _result = self._fst.get().NumOutputEpsilons(state)
+ * if _result == SIZE_MAX:
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
- * return result
+ * return _result
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1762, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1834, __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, 1762, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1834, __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, 1762, __pyx_L1_error)
+ __PYX_ERR(0, 1834, __pyx_L1_error)
- /* "pywrapfst.pyx":1761
+ /* "pywrapfst.pyx":1833
* """
- * cdef size_t result = self._fst.get().NumOutputEpsilons(state)
- * if result == SIZE_MAX: # <<<<<<<<<<<<<<
+ * cdef size_t _result = self._fst.get().NumOutputEpsilons(state)
+ * if _result == SIZE_MAX: # <<<<<<<<<<<<<<
* raise FstIndexError("State index out of range")
- * return result
+ * return _result
*/
}
- /* "pywrapfst.pyx":1763
- * if result == SIZE_MAX:
+ /* "pywrapfst.pyx":1835
+ * if _result == SIZE_MAX:
* raise FstIndexError("State index out of range")
- * return result # <<<<<<<<<<<<<<
+ * return _result # <<<<<<<<<<<<<<
*
* cpdef _FstSymbolTableView output_symbols(self):
*/
- __pyx_r = __pyx_v_result;
+ __pyx_r = __pyx_v__result;
goto __pyx_L0;
- /* "pywrapfst.pyx":1745
- * return result
+ /* "pywrapfst.pyx":1817
+ * return _result
*
* cpdef size_t num_output_epsilons(self, int64 state) except *: # <<<<<<<<<<<<<<
* """
static char __pyx_doc_9pywrapfst_3Fst_28num_output_epsilons[] = "\n num_output_epsilons(self, state)\n\n Returns the number of arcs with epsilon output labels leaving a state.\n\n Args:\n state: The integer index of a state.\n\n Returns:\n The number of epsilon-output-labeled arcs leaving that state.\n\n Raises:\n FstIndexError: State index out of range.\n ";
static PyObject *__pyx_pw_9pywrapfst_3Fst_29num_output_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
int64 __pyx_v_state;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__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, 1745, __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, 1817, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_RefNannyDeclarations
size_t __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ 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, 1745, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1745, __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, 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_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1765
- * return result
+/* "pywrapfst.pyx":1837
+ * return _result
*
* cpdef _FstSymbolTableView output_symbols(self): # <<<<<<<<<<<<<<
* """
static PyObject *__pyx_pw_9pywrapfst_3Fst_31output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*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) {
- fst::SymbolTable const *__pyx_v_syms;
struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("output_symbols", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1765, __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, 1837, __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, 1765, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1837, __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, 1765, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__FstSymbolTableView))))) __PYX_ERR(0, 1837, __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":1771
+ /* "pywrapfst.pyx":1843
* Returns the FST's output symbol table, or None if none is present.
* """
- * cdef const fst.SymbolTable *syms = self._fst.get().OutputSymbols() # <<<<<<<<<<<<<<
- * if syms == NULL:
+ * if self._fst.get().OutputSymbols() == NULL: # <<<<<<<<<<<<<<
* return
+ * return _init_FstSymbolTableView(self._fst, input_side=False)
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1771, __pyx_L1_error)
+ __PYX_ERR(0, 1843, __pyx_L1_error)
}
- __pyx_v_syms = __pyx_v_self->_fst.get()->OutputSymbols();
-
- /* "pywrapfst.pyx":1772
- * """
- * cdef const fst.SymbolTable *syms = self._fst.get().OutputSymbols()
- * if syms == NULL: # <<<<<<<<<<<<<<
- * return
- * return _init_FstSymbolTableView(self._fst, input_side=False)
- */
- __pyx_t_5 = ((__pyx_v_syms == NULL) != 0);
+ __pyx_t_5 = ((__pyx_v_self->_fst.get()->OutputSymbols() == NULL) != 0);
if (__pyx_t_5) {
- /* "pywrapfst.pyx":1773
- * cdef const fst.SymbolTable *syms = self._fst.get().OutputSymbols()
- * if syms == NULL:
+ /* "pywrapfst.pyx":1844
+ * """
+ * if self._fst.get().OutputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
* return _init_FstSymbolTableView(self._fst, input_side=False)
*
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":1772
+ /* "pywrapfst.pyx":1843
+ * Returns the FST's output symbol table, or None if none is present.
* """
- * cdef const fst.SymbolTable *syms = self._fst.get().OutputSymbols()
- * if syms == NULL: # <<<<<<<<<<<<<<
+ * if self._fst.get().OutputSymbols() == NULL: # <<<<<<<<<<<<<<
* return
* return _init_FstSymbolTableView(self._fst, input_side=False)
*/
}
- /* "pywrapfst.pyx":1774
- * if syms == NULL:
+ /* "pywrapfst.pyx":1845
+ * if self._fst.get().OutputSymbols() == NULL:
* return
* return _init_FstSymbolTableView(self._fst, input_side=False) # <<<<<<<<<<<<<<
*
- * cpdef string print(self, _SymbolTable isymbols=None,
+ * cpdef string print(self, SymbolTableView isymbols=None,
*/
__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, 1774, __pyx_L1_error)
+ __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, 1774, __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_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1765
- * return result
+ /* "pywrapfst.pyx":1837
+ * return _result
*
* cpdef _FstSymbolTableView output_symbols(self): # <<<<<<<<<<<<<<
* """
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("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, 1765, __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, 1837, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1776
+/* "pywrapfst.pyx":1847
* return _init_FstSymbolTableView(self._fst, input_side=False)
*
- * cpdef string print(self, _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
+ * cpdef string print(self, SymbolTableView isymbols=None, # <<<<<<<<<<<<<<
+ * SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
* bool acceptor=False, bool show_weight_one=False,
*/
static PyObject *__pyx_pw_9pywrapfst_3Fst_33print(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*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) {
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1777
+ /* "pywrapfst.pyx":1848
*
- * cpdef string print(self, _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None, _SymbolTable ssymbols=None, # <<<<<<<<<<<<<<
+ * cpdef string print(self, SymbolTableView isymbols=None,
+ * SymbolTableView osymbols=None, SymbolTableView ssymbols=None, # <<<<<<<<<<<<<<
* bool acceptor=False, bool show_weight_one=False,
- * missing_sym=b"") except *:
+ * missing_sym="") except *:
*/
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+ 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":1778
- * cpdef string print(self, _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
+ /* "pywrapfst.pyx":1849
+ * cpdef string print(self, SymbolTableView isymbols=None,
+ * SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
* bool acceptor=False, bool show_weight_one=False, # <<<<<<<<<<<<<<
- * missing_sym=b"") except *:
+ * missing_sym="") except *:
* """
*/
bool __pyx_v_acceptor = ((bool)0);
bool __pyx_v_show_weight_one = ((bool)0);
- PyObject *__pyx_v_missing_sym = ((PyObject *)__pyx_kp_b__8);
+ PyObject *__pyx_v_missing_sym = ((PyObject *)__pyx_kp_u__11);
fst::SymbolTable const *__pyx_v__isymbols;
fst::SymbolTable const *__pyx_v__osymbols;
fst::SymbolTable const *__pyx_v__ssymbols;
- std::stringstream __pyx_v_sstrm;
+ std::stringstream __pyx_v__sstrm;
std::string __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_10;
int __pyx_t_11;
fst::SymbolTable const *__pyx_t_12;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("print", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":1776
+ /* "pywrapfst.pyx":1847
* return _init_FstSymbolTableView(self._fst, input_side=False)
*
- * cpdef string print(self, _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
+ * cpdef string print(self, SymbolTableView isymbols=None, # <<<<<<<<<<<<<<
+ * SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
* bool acceptor=False, bool show_weight_one=False,
*/
/* Check if called by wrapper */
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, 1776, __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, 1847, __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, 1776, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1847, __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, 1776, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1847, __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, 1776, __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, 1847, __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, 1776, __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, 1847, __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, 1776, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(6+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1847, __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, 1776, __pyx_L1_error)
+ __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_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, 1776, __pyx_L1_error)
+ __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_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":1802
+ /* "pywrapfst.pyx":1873
* """
* # 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, 1802, __pyx_L1_error)
+ __PYX_ERR(0, 1873, __pyx_L1_error)
}
__pyx_v__isymbols = __pyx_v_self->_fst.get()->InputSymbols();
- /* "pywrapfst.pyx":1803
+ /* "pywrapfst.pyx":1874
* # 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":1804
+ /* "pywrapfst.pyx":1875
* 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, 1804, __pyx_L1_error)
+ __PYX_ERR(0, 1875, __pyx_L1_error)
}
- __pyx_t_12 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1804, __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_v__isymbols = __pyx_t_12;
- /* "pywrapfst.pyx":1803
+ /* "pywrapfst.pyx":1874
* # Prints FST to stringstream, then returns resulting string.
* cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
* if isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1805
+ /* "pywrapfst.pyx":1876
* 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, 1805, __pyx_L1_error)
+ __PYX_ERR(0, 1876, __pyx_L1_error)
}
__pyx_v__osymbols = __pyx_v_self->_fst.get()->OutputSymbols();
- /* "pywrapfst.pyx":1806
+ /* "pywrapfst.pyx":1877
* _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":1807
+ /* "pywrapfst.pyx":1878
* 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, 1807, __pyx_L1_error)
+ __PYX_ERR(0, 1878, __pyx_L1_error)
}
- __pyx_t_12 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1807, __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_v__osymbols = __pyx_t_12;
- /* "pywrapfst.pyx":1806
+ /* "pywrapfst.pyx":1877
* _isymbols = isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
* if osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":1808
+ /* "pywrapfst.pyx":1879
* if osymbols is not None:
* _osymbols = osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_ssymbols = NULL # <<<<<<<<<<<<<<
*/
__pyx_v__ssymbols = NULL;
- /* "pywrapfst.pyx":1809
+ /* "pywrapfst.pyx":1880
* _osymbols = osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
* _ssymbols = ssymbols._raw_ptr_or_raise()
- * cdef stringstream sstrm
+ * cdef stringstream _sstrm
*/
__pyx_t_10 = (((PyObject *)__pyx_v_ssymbols) != Py_None);
__pyx_t_11 = (__pyx_t_10 != 0);
if (__pyx_t_11) {
- /* "pywrapfst.pyx":1810
+ /* "pywrapfst.pyx":1881
* cdef const fst.SymbolTable *_ssymbols = NULL
* if ssymbols is not None:
* _ssymbols = ssymbols._raw_ptr_or_raise() # <<<<<<<<<<<<<<
- * cdef stringstream sstrm
+ * cdef stringstream _sstrm
* fst.Print(deref(self._fst),
*/
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, 1810, __pyx_L1_error)
+ __PYX_ERR(0, 1881, __pyx_L1_error)
}
- __pyx_t_12 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_ssymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_ssymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1810, __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_v__ssymbols = __pyx_t_12;
- /* "pywrapfst.pyx":1809
+ /* "pywrapfst.pyx":1880
* _osymbols = osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
* _ssymbols = ssymbols._raw_ptr_or_raise()
- * cdef stringstream sstrm
+ * cdef stringstream _sstrm
*/
}
- /* "pywrapfst.pyx":1812
+ /* "pywrapfst.pyx":1883
* _ssymbols = ssymbols._raw_ptr_or_raise()
- * cdef stringstream sstrm
+ * cdef stringstream _sstrm
* fst.Print(deref(self._fst), # <<<<<<<<<<<<<<
- * sstrm,
+ * _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, 1812, __pyx_L1_error)
+ __PYX_ERR(0, 1883, __pyx_L1_error)
}
- /* "pywrapfst.pyx":1820
+ /* "pywrapfst.pyx":1891
* acceptor,
* show_weight_one,
* tostring(missing_sym)) # <<<<<<<<<<<<<<
- * return sstrm.str()
+ * return _sstrm.str()
*
*/
- __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_missing_sym); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1820, __pyx_L1_error)
+ __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_missing_sym); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1891, __pyx_L1_error)
- /* "pywrapfst.pyx":1812
+ /* "pywrapfst.pyx":1883
* _ssymbols = ssymbols._raw_ptr_or_raise()
- * cdef stringstream sstrm
+ * cdef stringstream _sstrm
* fst.Print(deref(self._fst), # <<<<<<<<<<<<<<
- * sstrm,
+ * _sstrm,
* b"<pywrapfst>",
*/
- 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);
+ 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":1821
+ /* "pywrapfst.pyx":1892
* show_weight_one,
* tostring(missing_sym))
- * return sstrm.str() # <<<<<<<<<<<<<<
+ * return _sstrm.str() # <<<<<<<<<<<<<<
*
* cpdef uint64 properties(self, uint64 mask, bool test):
*/
- __pyx_r = __pyx_v_sstrm.str();
+ __pyx_r = __pyx_v__sstrm.str();
goto __pyx_L0;
- /* "pywrapfst.pyx":1776
+ /* "pywrapfst.pyx":1847
* return _init_FstSymbolTableView(self._fst, input_side=False)
*
- * cpdef string print(self, _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
+ * cpdef string print(self, SymbolTableView isymbols=None, # <<<<<<<<<<<<<<
+ * SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
* bool acceptor=False, bool show_weight_one=False,
*/
static PyObject *__pyx_pw_9pywrapfst_3Fst_33print(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_3Fst_32print[] = "\n print(self, isymbols=None, osymbols=None, ssymbols=None, acceptor=False,\n show_weight_one=False, missing_sym=\"\")\n\n Produces a human-readable string representation of the FST.\n\n This method generates a human-readable string representation of the FST.\n The caller may optionally specify SymbolTables used to label input labels,\n output labels, or state labels, respectively.\n\n Args:\n isymbols: An optional symbol table used to label input symbols.\n osymbols: An optional symbol table used to label output symbols.\n ssymbols: An optional symbol table used to label states.\n acceptor: Should the FST be rendered in acceptor format if possible?\n show_weight_one: Should weights equivalent to semiring One be printed?\n missing_symbol: The string to be printed when symbol table lookup fails.\n\n Returns:\n A formatted string representing the machine.\n ";
static PyObject *__pyx_pw_9pywrapfst_3Fst_33print(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = 0;
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = 0;
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = 0;
bool __pyx_v_acceptor;
bool __pyx_v_show_weight_one;
PyObject *__pyx_v_missing_sym = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("print (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isymbols,&__pyx_n_s_osymbols,&__pyx_n_s_ssymbols,&__pyx_n_s_acceptor,&__pyx_n_s_show_weight_one,&__pyx_n_s_missing_sym,0};
PyObject* values[6] = {0,0,0,0,0,0};
- values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+ values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":1777
+ /* "pywrapfst.pyx":1848
*
- * cpdef string print(self, _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None, _SymbolTable ssymbols=None, # <<<<<<<<<<<<<<
+ * cpdef string print(self, SymbolTableView isymbols=None,
+ * SymbolTableView osymbols=None, SymbolTableView ssymbols=None, # <<<<<<<<<<<<<<
* bool acceptor=False, bool show_weight_one=False,
- * missing_sym=b"") except *:
+ * missing_sym="") except *:
*/
- values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- values[5] = ((PyObject *)__pyx_kp_b__8);
+ values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
+ values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
+ values[5] = ((PyObject *)__pyx_kp_u__11);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "print") < 0)) __PYX_ERR(0, 1776, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "print") < 0)) __PYX_ERR(0, 1847, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[0]);
- __pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[1]);
- __pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[2]);
+ __pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
+ __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, 1778, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1849, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":1778
- * cpdef string print(self, _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
+ /* "pywrapfst.pyx":1849
+ * cpdef string print(self, SymbolTableView isymbols=None,
+ * SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
* bool acceptor=False, bool show_weight_one=False, # <<<<<<<<<<<<<<
- * missing_sym=b"") except *:
+ * missing_sym="") except *:
* """
*/
__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, 1778, __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, 1849, __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, 1776, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("print", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1847, __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__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1776, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1777, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1777, __pyx_L1_error)
+ 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)
__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":1776
+ /* "pywrapfst.pyx":1847
* return _init_FstSymbolTableView(self._fst, input_side=False)
*
- * cpdef string print(self, _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
+ * cpdef string print(self, SymbolTableView isymbols=None, # <<<<<<<<<<<<<<
+ * SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
* bool acceptor=False, bool show_weight_one=False,
*/
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_3Fst_32print(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_show_weight_one, PyObject *__pyx_v_missing_sym) {
+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) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
struct __pyx_opt_args_9pywrapfst_3Fst_print __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("print", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 6;
__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, 1776, __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, 1776, __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, 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_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1823
- * return sstrm.str()
+/* "pywrapfst.pyx":1894
+ * return _sstrm.str()
*
* cpdef uint64 properties(self, uint64 mask, bool test): # <<<<<<<<<<<<<<
* """
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)) ;
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, 1823, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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, 1823, __pyx_L1_error)
+ __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, 1823, __pyx_L1_error)
+ __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;
#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, 1823, __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, 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;
#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, 1823, __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, 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;
} else
#endif
{
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1823, __pyx_L1_error)
+ __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;
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, 1823, __pyx_L1_error)
+ __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, 1823, __pyx_L1_error)
+ __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;
#endif
}
- /* "pywrapfst.pyx":1841
+ /* "pywrapfst.pyx":1912
* A 64-bit bitmask representing the requested properties.
* """
* return self._fst.get().Properties(mask, test) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1841, __pyx_L1_error)
+ __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":1823
- * return sstrm.str()
+ /* "pywrapfst.pyx":1894
+ * return _sstrm.str()
*
* cpdef uint64 properties(self, uint64 mask, bool test): # <<<<<<<<<<<<<<
* """
static PyObject *__pyx_pw_9pywrapfst_3Fst_35properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
uint64 __pyx_v_mask;
bool __pyx_v_test;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("properties (wrapper)", 0);
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, 1823, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, 1); __PYX_ERR(0, 1894, __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, 1823, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "properties") < 0)) __PYX_ERR(0, 1894, __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, 1823, __pyx_L3_error)
- __pyx_v_test = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_test == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1823, __pyx_L3_error)
+ __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)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1823, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1894, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Fst.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
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_3Fst_properties(__pyx_v_self, __pyx_v_mask, __pyx_v_test, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1823, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1844
+/* "pywrapfst.pyx":1915
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
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("read", 0);
- /* "pywrapfst.pyx":1859
+ /* "pywrapfst.pyx":1930
* 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, 1859, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1844
+ /* "pywrapfst.pyx":1915
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":1862
+/* "pywrapfst.pyx":1933
*
* @classmethod
* def read_from_string(cls, state): # <<<<<<<<<<<<<<
static PyObject *__pyx_pf_9pywrapfst_3Fst_38read_from_string(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
+ std::string __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_from_string", 0);
- /* "pywrapfst.pyx":1877
+ /* "pywrapfst.pyx":1948
* FstIOError: Read failed.
* """
* return _read_Fst_from_string(state) # <<<<<<<<<<<<<<
* cpdef int64 start(self):
*/
__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, 1877, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
+ __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_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1862
+ /* "pywrapfst.pyx":1933
*
* @classmethod
* def read_from_string(cls, state): # <<<<<<<<<<<<<<
/* function exit code */
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("pywrapfst.Fst.read_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":1879
+/* "pywrapfst.pyx":1950
* return _read_Fst_from_string(state)
*
* cpdef int64 start(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int64 __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("start", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1879, __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, 1950, __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, 1879, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1950, __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, 1879, __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, 1950, __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":1885
+ /* "pywrapfst.pyx":1956
* 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, 1885, __pyx_L1_error)
+ __PYX_ERR(0, 1956, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->Start();
goto __pyx_L0;
- /* "pywrapfst.pyx":1879
+ /* "pywrapfst.pyx":1950
* return _read_Fst_from_string(state)
*
* cpdef int64 start(self): # <<<<<<<<<<<<<<
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("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, 1879, __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, 1950, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1887
+/* "pywrapfst.pyx":1958
* return self._fst.get().Start()
*
* cpdef StateIterator states(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("states", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1887, __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, 1958, __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, 1887, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1958, __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, 1887, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_StateIterator))))) __PYX_ERR(0, 1958, __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":1896
+ /* "pywrapfst.pyx":1967
* A StateIterator object for the FST.
* """
* return StateIterator(self) # <<<<<<<<<<<<<<
*
- * # TODO(kbg): Deprecated; remove on next release.
+ * 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, 1896, __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, 1967, __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":1887
+ /* "pywrapfst.pyx":1958
* return self._fst.get().Start()
*
* cpdef StateIterator states(self): # <<<<<<<<<<<<<<
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("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, 1887, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1899
+/* "pywrapfst.pyx":1969
+ * return StateIterator(self)
*
- * # TODO(kbg): Deprecated; remove on next release.
- * cpdef string text(self, # <<<<<<<<<<<<<<
- * _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None,
- */
-
-static PyObject *__pyx_pw_9pywrapfst_3Fst_45text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static std::string __pyx_f_9pywrapfst_3Fst_text(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_text *__pyx_optional_args) {
-
- /* "pywrapfst.pyx":1900
- * # TODO(kbg): Deprecated; remove on next release.
- * cpdef string text(self,
- * _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable osymbols=None,
- * _SymbolTable ssymbols=None,
- */
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
-
- /* "pywrapfst.pyx":1901
- * cpdef string text(self,
- * _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable ssymbols=None,
- * bool acceptor=False,
- */
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
-
- /* "pywrapfst.pyx":1902
- * _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None,
- * _SymbolTable ssymbols=None, # <<<<<<<<<<<<<<
- * bool acceptor=False,
- * bool show_weight_one=False,
- */
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
-
- /* "pywrapfst.pyx":1903
- * _SymbolTable osymbols=None,
- * _SymbolTable ssymbols=None,
- * bool acceptor=False, # <<<<<<<<<<<<<<
- * bool show_weight_one=False,
- * missing_sym=b"") except *:
- */
- bool __pyx_v_acceptor = ((bool)0);
-
- /* "pywrapfst.pyx":1904
- * _SymbolTable ssymbols=None,
- * bool acceptor=False,
- * bool show_weight_one=False, # <<<<<<<<<<<<<<
- * missing_sym=b"") except *:
+ * cpdef bool verify(self): # <<<<<<<<<<<<<<
* """
+ * verify(self)
*/
- bool __pyx_v_show_weight_one = ((bool)0);
- PyObject *__pyx_v_missing_sym = ((PyObject *)__pyx_kp_b__8);
- std::string __pyx_r;
+
+static PyObject *__pyx_pw_9pywrapfst_3Fst_45verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static bool __pyx_f_9pywrapfst_3Fst_verify(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
+ bool __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;
- std::string __pyx_t_9;
- struct __pyx_opt_args_9pywrapfst_3Fst_print __pyx_t_10;
- __Pyx_RefNannySetupContext("text", 0);
- if (__pyx_optional_args) {
- if (__pyx_optional_args->__pyx_n > 0) {
- __pyx_v_isymbols = __pyx_optional_args->isymbols;
- if (__pyx_optional_args->__pyx_n > 1) {
- __pyx_v_osymbols = __pyx_optional_args->osymbols;
- if (__pyx_optional_args->__pyx_n > 2) {
- __pyx_v_ssymbols = __pyx_optional_args->ssymbols;
- if (__pyx_optional_args->__pyx_n > 3) {
- __pyx_v_acceptor = __pyx_optional_args->acceptor;
- if (__pyx_optional_args->__pyx_n > 4) {
- __pyx_v_show_weight_one = __pyx_optional_args->show_weight_one;
- if (__pyx_optional_args->__pyx_n > 5) {
- __pyx_v_missing_sym = __pyx_optional_args->missing_sym;
- }
- }
- }
- }
- }
- }
- }
-
- /* "pywrapfst.pyx":1899
- *
- * # TODO(kbg): Deprecated; remove on next release.
- * cpdef string text(self, # <<<<<<<<<<<<<<
- * _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None,
- */
+ bool __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("verify", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
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_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1899, __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, 1969, __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_45text)) {
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1899, __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, 1899, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
+ 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_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_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_7 = 1;
+ __Pyx_DECREF_SET(__pyx_t_3, function);
}
}
- #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, 1899, __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[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, 1899, __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(6+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1899, __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_INCREF(((PyObject *)__pyx_v_isymbols));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_isymbols));
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_isymbols));
- __Pyx_INCREF(((PyObject *)__pyx_v_osymbols));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_osymbols));
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, ((PyObject *)__pyx_v_osymbols));
- __Pyx_INCREF(((PyObject *)__pyx_v_ssymbols));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_ssymbols));
- PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, ((PyObject *)__pyx_v_ssymbols));
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_7, __pyx_t_4);
- __Pyx_INCREF(__pyx_v_missing_sym);
- __Pyx_GIVEREF(__pyx_v_missing_sym);
- 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, 1899, __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, 1899, __pyx_L1_error)
+ __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)
+ __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_9;
+ __pyx_r = __pyx_t_5;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#endif
}
- /* "pywrapfst.pyx":1927
- * A formatted string representing the machine.
- * """
- * warnings.warn("Use `print` instead", DeprecationWarning, stacklevel=2) # <<<<<<<<<<<<<<
- * return self.print(isymbols,
- * osymbols,
- */
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1927, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1927, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1927, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stacklevel, __pyx_int_2) < 0) __PYX_ERR(0, 1927, __pyx_L1_error)
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1927, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "pywrapfst.pyx":1928
+ /* "pywrapfst.pyx":1978
+ * True if the contents are sane, False otherwise.
* """
- * warnings.warn("Use `print` instead", DeprecationWarning, stacklevel=2)
- * return self.print(isymbols, # <<<<<<<<<<<<<<
- * osymbols,
- * ssymbols,
+ * return fst.Verify(deref(self._fst)) # <<<<<<<<<<<<<<
+ *
+ * cpdef string weight_type(self):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "print");
- __PYX_ERR(0, 1928, __pyx_L1_error)
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
+ __PYX_ERR(0, 1978, __pyx_L1_error)
}
-
- /* "pywrapfst.pyx":1933
- * acceptor,
- * show_weight_one,
- * missing_sym) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_10.__pyx_n = 6;
- __pyx_t_10.isymbols = __pyx_v_isymbols;
- __pyx_t_10.osymbols = __pyx_v_osymbols;
- __pyx_t_10.ssymbols = __pyx_v_ssymbols;
- __pyx_t_10.acceptor = __pyx_v_acceptor;
- __pyx_t_10.show_weight_one = __pyx_v_show_weight_one;
- __pyx_t_10.missing_sym = __pyx_v_missing_sym;
- __pyx_t_9 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_self->__pyx_vtab)->print(__pyx_v_self, 0, &__pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1928, __pyx_L1_error)
- __pyx_r = __pyx_t_9;
+ __pyx_r = fst::script::Verify((*__pyx_v_self->_fst));
goto __pyx_L0;
- /* "pywrapfst.pyx":1899
+ /* "pywrapfst.pyx":1969
+ * return StateIterator(self)
*
- * # TODO(kbg): Deprecated; remove on next release.
- * cpdef string text(self, # <<<<<<<<<<<<<<
- * _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None,
+ * cpdef bool verify(self): # <<<<<<<<<<<<<<
+ * """
+ * verify(self)
*/
/* function exit code */
__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_AddTraceback("pywrapfst.Fst.text", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_pretend_to_initialize(&__pyx_r);
+ __Pyx_WriteUnraisable("pywrapfst.Fst.verify", __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_45text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_3Fst_44text[] = "\n text(self, isymbols=None, osymbols=None, ssymbols=None, acceptor=False,\n show_weight_one=False, missing_sym=\"\")\n\n Produces a human-readable string representation of the FST.\n\n This method generates a human-readable string representation of the FST.\n The caller may optionally specify SymbolTables used to label input labels,\n output labels, or state labels, respectively.\n\n Args:\n isymbols: An optional symbol table used to label input symbols.\n osymbols: An optional symbol table used to label output symbols.\n ssymbols: An optional symbol table used to label states.\n acceptor: Should the FST be rendered in acceptor format if possible?\n show_weight_one: Should weights equivalent to semiring One be printed?\n missing_symbol: The string to be printed when symbol table lookup fails.\n\n Returns:\n A formatted string representing the machine.\n ";
-static PyObject *__pyx_pw_9pywrapfst_3Fst_45text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = 0;
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = 0;
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols = 0;
- bool __pyx_v_acceptor;
- bool __pyx_v_show_weight_one;
- PyObject *__pyx_v_missing_sym = 0;
+static PyObject *__pyx_pw_9pywrapfst_3Fst_45verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_3Fst_44verify[] = "\n verify(self)\n\n Verifies that an FST's contents are sane.\n\n Returns:\n True if the contents are sane, False otherwise.\n ";
+static PyObject *__pyx_pw_9pywrapfst_3Fst_45verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("text (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isymbols,&__pyx_n_s_osymbols,&__pyx_n_s_ssymbols,&__pyx_n_s_acceptor,&__pyx_n_s_show_weight_one,&__pyx_n_s_missing_sym,0};
- PyObject* values[6] = {0,0,0,0,0,0};
-
- /* "pywrapfst.pyx":1900
- * # TODO(kbg): Deprecated; remove on next release.
- * cpdef string text(self,
- * _SymbolTable isymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable osymbols=None,
- * _SymbolTable ssymbols=None,
- */
- values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
-
- /* "pywrapfst.pyx":1901
- * cpdef string text(self,
- * _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable ssymbols=None,
- * bool acceptor=False,
- */
- values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
-
- /* "pywrapfst.pyx":1902
- * _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None,
- * _SymbolTable ssymbols=None, # <<<<<<<<<<<<<<
- * bool acceptor=False,
- * bool show_weight_one=False,
- */
- values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- values[5] = ((PyObject *)__pyx_kp_b__8);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
- CYTHON_FALLTHROUGH;
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- CYTHON_FALLTHROUGH;
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- CYTHON_FALLTHROUGH;
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- CYTHON_FALLTHROUGH;
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isymbols);
- if (value) { values[0] = value; kw_args--; }
- }
- CYTHON_FALLTHROUGH;
- case 1:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_osymbols);
- if (value) { values[1] = value; kw_args--; }
- }
- CYTHON_FALLTHROUGH;
- case 2:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ssymbols);
- if (value) { values[2] = value; kw_args--; }
- }
- CYTHON_FALLTHROUGH;
- case 3:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_acceptor);
- if (value) { values[3] = value; kw_args--; }
- }
- CYTHON_FALLTHROUGH;
- case 4:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_show_weight_one);
- if (value) { values[4] = value; kw_args--; }
- }
- CYTHON_FALLTHROUGH;
- case 5:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_missing_sym);
- if (value) { values[5] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text") < 0)) __PYX_ERR(0, 1899, __pyx_L3_error)
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
- CYTHON_FALLTHROUGH;
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- CYTHON_FALLTHROUGH;
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- CYTHON_FALLTHROUGH;
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- CYTHON_FALLTHROUGH;
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[0]);
- __pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[1]);
- __pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[2]);
- if (values[3]) {
- __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1903, __pyx_L3_error)
- } else {
-
- /* "pywrapfst.pyx":1903
- * _SymbolTable osymbols=None,
- * _SymbolTable ssymbols=None,
- * bool acceptor=False, # <<<<<<<<<<<<<<
- * bool show_weight_one=False,
- * missing_sym=b"") except *:
- */
- __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, 1904, __pyx_L3_error)
- } else {
-
- /* "pywrapfst.pyx":1904
- * _SymbolTable ssymbols=None,
- * bool acceptor=False,
- * bool show_weight_one=False, # <<<<<<<<<<<<<<
- * missing_sym=b"") except *:
- * """
- */
- __pyx_v_show_weight_one = ((bool)0);
- }
- __pyx_v_missing_sym = values[5];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("text", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1899, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("pywrapfst.Fst.text", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1900, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1901, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1902, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_3Fst_44text(((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":1899
- *
- * # TODO(kbg): Deprecated; remove on next release.
- * cpdef string text(self, # <<<<<<<<<<<<<<
- * _SymbolTable isymbols=None,
- * _SymbolTable osymbols=None,
- */
+ __Pyx_RefNannySetupContext("verify (wrapper)", 0);
+ __pyx_r = __pyx_pf_9pywrapfst_3Fst_44verify(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));
/* function exit code */
- goto __pyx_L0;
- __pyx_L1_error:;
- __pyx_r = NULL;
- __pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_3Fst_44text(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_show_weight_one, PyObject *__pyx_v_missing_sym) {
+static PyObject *__pyx_pf_9pywrapfst_3Fst_44verify(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- std::string __pyx_t_1;
- struct __pyx_opt_args_9pywrapfst_3Fst_text __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("text", 0);
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("verify", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2.__pyx_n = 6;
- __pyx_t_2.isymbols = __pyx_v_isymbols;
- __pyx_t_2.osymbols = __pyx_v_osymbols;
- __pyx_t_2.ssymbols = __pyx_v_ssymbols;
- __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->text(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1899, __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, 1899, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
+ __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_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_3);
- __Pyx_AddTraceback("pywrapfst.Fst.text", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("pywrapfst.Fst.verify", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
return __pyx_r;
}
-/* "pywrapfst.pyx":1936
- *
+/* "pywrapfst.pyx":1980
+ * return fst.Verify(deref(self._fst))
*
- * cpdef bool verify(self): # <<<<<<<<<<<<<<
+ * cpdef string weight_type(self): # <<<<<<<<<<<<<<
* """
- * verify(self)
+ * weight_type(self)
*/
-static PyObject *__pyx_pw_9pywrapfst_3Fst_47verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static bool __pyx_f_9pywrapfst_3Fst_verify(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
- bool __pyx_r;
+static PyObject *__pyx_pw_9pywrapfst_3Fst_47weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static std::string __pyx_f_9pywrapfst_3Fst_weight_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
+ std::string __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
- bool __pyx_t_5;
- __Pyx_RefNannySetupContext("verify", 0);
+ std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("weight_type", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
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, 1936, __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, 1980, __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_47verify)) {
+ 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_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1936, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1980, __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, 1936, __pyx_L1_error)
+ __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_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":1945
- * True if the contents are sane, False otherwise.
- * """
- * return fst.Verify(deref(self._fst)) # <<<<<<<<<<<<<<
- *
- * cpdef string weight_type(self):
- */
- if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1945, __pyx_L1_error)
- }
- __pyx_r = fst::script::Verify((*__pyx_v_self->_fst));
- goto __pyx_L0;
-
- /* "pywrapfst.pyx":1936
- *
- *
- * cpdef bool verify(self): # <<<<<<<<<<<<<<
- * """
- * verify(self)
- */
-
- /* 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_WriteUnraisable("pywrapfst.Fst.verify", __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_47verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_3Fst_46verify[] = "\n verify(self)\n\n Verifies that an FST's contents are sane.\n\n Returns:\n True if the contents are sane, False otherwise.\n ";
-static PyObject *__pyx_pw_9pywrapfst_3Fst_47verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("verify (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_3Fst_46verify(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_9pywrapfst_3Fst_46verify(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __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, 1936, __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.Fst.verify", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "pywrapfst.pyx":1947
- * return fst.Verify(deref(self._fst))
- *
- * cpdef string weight_type(self): # <<<<<<<<<<<<<<
- * """
- * weight_type(self)
- */
-
-static PyObject *__pyx_pw_9pywrapfst_3Fst_49weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static std::string __pyx_f_9pywrapfst_3Fst_weight_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
- std::string __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- std::string __pyx_t_5;
- __Pyx_RefNannySetupContext("weight_type", 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_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1947, __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_49weight_type)) {
- __Pyx_INCREF(__pyx_t_1);
- __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- __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, 1947, __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, 1947, __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;
- 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":1956
+ /* "pywrapfst.pyx":1989
* 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, 1956, __pyx_L1_error)
+ __PYX_ERR(0, 1989, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_fst.get()->WeightType();
goto __pyx_L0;
- /* "pywrapfst.pyx":1947
+ /* "pywrapfst.pyx":1980
* return fst.Verify(deref(self._fst))
*
* cpdef string weight_type(self): # <<<<<<<<<<<<<<
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_3Fst_49weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_3Fst_48weight_type[] = "\n weight_type(self)\n\n Provides the FST's weight type.\n\n Returns:\n A string representing the weight type.\n ";
-static PyObject *__pyx_pw_9pywrapfst_3Fst_49weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_3Fst_47weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_3Fst_46weight_type[] = "\n weight_type(self)\n\n Provides the FST's weight type.\n\n Returns:\n A string representing the weight type.\n ";
+static PyObject *__pyx_pw_9pywrapfst_3Fst_47weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("weight_type (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_3Fst_48weight_type(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_3Fst_46weight_type(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_3Fst_48weight_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_3Fst_46weight_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
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("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, 1947, __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, 1980, __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":1991
* return self._fst.get().WeightType()
*
* cpdef void write(self, source) except *: # <<<<<<<<<<<<<<
* write(self, source)
*/
-static PyObject *__pyx_pw_9pywrapfst_3Fst_51write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_3Fst_49write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static void __pyx_f_9pywrapfst_3Fst_write(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch) {
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
int __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1958, __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, 1991, __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)) {
+ 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_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 1958, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __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":1972
+ /* "pywrapfst.pyx":2005
* FstIOError: Write failed.
* """
- * if not self._fst.get().Write(tostring(source)): # <<<<<<<<<<<<<<
- * raise FstIOError("Write failed: {!r}".format(source))
+ * if not self._fst.get().Write(path_tostring(source)): # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Write failed: {source!r}")
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1972, __pyx_L1_error)
+ __PYX_ERR(0, 2005, __pyx_L1_error)
}
- __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1972, __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_6 = ((!(__pyx_v_self->_fst.get()->Write(__pyx_t_5) != 0)) != 0);
if (unlikely(__pyx_t_6)) {
- /* "pywrapfst.pyx":1973
+ /* "pywrapfst.pyx":2006
* """
- * if not self._fst.get().Write(tostring(source)):
- * raise FstIOError("Write failed: {!r}".format(source)) # <<<<<<<<<<<<<<
+ * 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, 1973, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2006, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1973, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- }
- }
- __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_source);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1973, __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, 2006, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
+ __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_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1973, __pyx_L1_error)
+ __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)
__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, 1973, __pyx_L1_error)
+ __PYX_ERR(0, 2006, __pyx_L1_error)
- /* "pywrapfst.pyx":1972
+ /* "pywrapfst.pyx":2005
* FstIOError: Write failed.
* """
- * if not self._fst.get().Write(tostring(source)): # <<<<<<<<<<<<<<
- * raise FstIOError("Write failed: {!r}".format(source))
+ * if not self._fst.get().Write(path_tostring(source)): # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Write failed: {source!r}")
*
*/
}
- /* "pywrapfst.pyx":1958
+ /* "pywrapfst.pyx":1991
* return self._fst.get().WeightType()
*
* cpdef void write(self, source) except *: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst.Fst.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_3Fst_51write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
-static char __pyx_doc_9pywrapfst_3Fst_50write[] = "\n write(self, source)\n\n Serializes FST to a file.\n\n This method writes the FST to a file in a binary format.\n\n Args:\n source: The string location of the output file.\n\n Raises:\n FstIOError: Write failed.\n ";
-static PyObject *__pyx_pw_9pywrapfst_3Fst_51write(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
+static PyObject *__pyx_pw_9pywrapfst_3Fst_49write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
+static char __pyx_doc_9pywrapfst_3Fst_48write[] = "\n write(self, source)\n\n Serializes FST to a file.\n\n This method writes the FST to a file in a binary format.\n\n Args:\n source: The string location of the output file.\n\n Raises:\n FstIOError: Write failed.\n ";
+static PyObject *__pyx_pw_9pywrapfst_3Fst_49write(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_3Fst_50write(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), ((PyObject *)__pyx_v_source));
+ __pyx_r = __pyx_pf_9pywrapfst_3Fst_48write(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), ((PyObject *)__pyx_v_source));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_3Fst_50write(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source) {
+static PyObject *__pyx_pf_9pywrapfst_3Fst_48write(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source) {
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("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, 1958, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1958, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":1975
- * raise FstIOError("Write failed: {!r}".format(source))
+/* "pywrapfst.pyx":2008
+ * raise FstIOError(f"Write failed: {source!r}")
*
* cpdef bytes write_to_string(self): # <<<<<<<<<<<<<<
* """
* write_to_string(self)
*/
-static PyObject *__pyx_pw_9pywrapfst_3Fst_53write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_3Fst_51write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_9pywrapfst_3Fst_write_to_string(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
- std::stringstream __pyx_v_sstrm;
+ std::stringstream __pyx_v__sstrm;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_to_string", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 1975, __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, 2008, __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_53write_to_string)) {
+ 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_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
}
__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, 1975, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2008, __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, 1975, __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, 2008, __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":1988
+ /* "pywrapfst.pyx":2021
* """
- * cdef stringstream sstrm
- * if not self._fst.get().Write(sstrm, b"<pywrapfst>"): # <<<<<<<<<<<<<<
+ * cdef stringstream _sstrm
+ * if not self._fst.get().Write(_sstrm, b"<pywrapfst>"): # <<<<<<<<<<<<<<
* raise FstIOError("Write to string failed")
- * return sstrm.str()
+ * return _sstrm.str()
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 1988, __pyx_L1_error)
+ __PYX_ERR(0, 2021, __pyx_L1_error)
}
- __pyx_t_5 = ((!(__pyx_v_self->_fst.get()->Write(__pyx_v_sstrm, __pyx_k_pywrapfst) != 0)) != 0);
+ __pyx_t_5 = ((!(__pyx_v_self->_fst.get()->Write(__pyx_v__sstrm, __pyx_k_pywrapfst) != 0)) != 0);
if (unlikely(__pyx_t_5)) {
- /* "pywrapfst.pyx":1989
- * cdef stringstream sstrm
- * if not self._fst.get().Write(sstrm, b"<pywrapfst>"):
+ /* "pywrapfst.pyx":2022
+ * cdef stringstream _sstrm
+ * if not self._fst.get().Write(_sstrm, b"<pywrapfst>"):
* raise FstIOError("Write to string failed") # <<<<<<<<<<<<<<
- * return sstrm.str()
+ * return _sstrm.str()
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2022, __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, 1989, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2022, __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, 1989, __pyx_L1_error)
+ __PYX_ERR(0, 2022, __pyx_L1_error)
- /* "pywrapfst.pyx":1988
+ /* "pywrapfst.pyx":2021
* """
- * cdef stringstream sstrm
- * if not self._fst.get().Write(sstrm, b"<pywrapfst>"): # <<<<<<<<<<<<<<
+ * cdef stringstream _sstrm
+ * if not self._fst.get().Write(_sstrm, b"<pywrapfst>"): # <<<<<<<<<<<<<<
* raise FstIOError("Write to string failed")
- * return sstrm.str()
+ * return _sstrm.str()
*/
}
- /* "pywrapfst.pyx":1990
- * if not self._fst.get().Write(sstrm, b"<pywrapfst>"):
+ /* "pywrapfst.pyx":2023
+ * if not self._fst.get().Write(_sstrm, b"<pywrapfst>"):
* raise FstIOError("Write to string failed")
- * return sstrm.str() # <<<<<<<<<<<<<<
+ * 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, 1990, __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, 2023, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":1975
- * raise FstIOError("Write failed: {!r}".format(source))
+ /* "pywrapfst.pyx":2008
+ * raise FstIOError(f"Write failed: {source!r}")
*
* cpdef bytes write_to_string(self): # <<<<<<<<<<<<<<
* """
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_3Fst_53write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_9pywrapfst_3Fst_52write_to_string[] = "\n write_to_string(self)\n\n Serializes FST to a string.\n\n Returns:\n A bytestring.\n\n Raises:\n FstIOError: Write to string failed.\n ";
-static PyObject *__pyx_pw_9pywrapfst_3Fst_53write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_3Fst_51write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_9pywrapfst_3Fst_50write_to_string[] = "\n write_to_string(self)\n\n Serializes FST to a string.\n\n Returns:\n A bytestring.\n\n Raises:\n FstIOError: Write to string failed.\n ";
+static PyObject *__pyx_pw_9pywrapfst_3Fst_51write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_to_string (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_3Fst_52write_to_string(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_3Fst_50write_to_string(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_3Fst_52write_to_string(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_3Fst_50write_to_string(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
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("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, 1975, __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, 2008, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2003
+/* "pywrapfst.pyx":2036
* """
*
* cdef void _check_mutating_imethod(self) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_check_mutating_imethod", 0);
- /* "pywrapfst.pyx":2008
+ /* "pywrapfst.pyx":2041
* 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, 2008, __pyx_L1_error)
+ __PYX_ERR(0, 2041, __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":2009
+ /* "pywrapfst.pyx":2042
* """
* 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, 2009, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2042, __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, 2009, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2042, __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, 2009, __pyx_L1_error)
+ __PYX_ERR(0, 2042, __pyx_L1_error)
- /* "pywrapfst.pyx":2008
+ /* "pywrapfst.pyx":2041
* This function is not visible to Python users.
* """
* if self._fst.get().Properties(fst.kError, True) == fst.kError: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2003
+ /* "pywrapfst.pyx":2036
* """
*
* cdef void _check_mutating_imethod(self) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2010
+/* "pywrapfst.pyx":2043
* if self._fst.get().Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed")
* cdef void _add_arc(self, int64 state, Arc arc) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_add_arc", 0);
- /* "pywrapfst.pyx":2011
+ /* "pywrapfst.pyx":2044
* 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, 2011, __pyx_L1_error)
+ __PYX_ERR(0, 2044, __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":2012
+ /* "pywrapfst.pyx":2045
* 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, 2012, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2045, __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, 2012, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2045, __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, 2012, __pyx_L1_error)
+ __PYX_ERR(0, 2045, __pyx_L1_error)
- /* "pywrapfst.pyx":2011
+ /* "pywrapfst.pyx":2044
* raise FstOpError("Operation failed")
* cdef void _add_arc(self, int64 state, Arc arc) except *:
* if not self._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2013
+ /* "pywrapfst.pyx":2046
* 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, 2013, __pyx_L1_error)
+ __PYX_ERR(0, 2046, __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, 2013, __pyx_L1_error)
+ __PYX_ERR(0, 2046, __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":2014
+ /* "pywrapfst.pyx":2047
* 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, 2014, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); 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_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, 2014, __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, 2014, __pyx_L1_error)
+ __PYX_ERR(0, 2047, __pyx_L1_error)
- /* "pywrapfst.pyx":2013
+ /* "pywrapfst.pyx":2046
* 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":2010
+ /* "pywrapfst.pyx":2043
* 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":2016
+/* "pywrapfst.pyx":2049
* raise FstOpError("Incompatible or invalid weight type")
*
* def add_arc(self, int64 state, Arc arc): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_1add_arc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int64 __pyx_v_state;
struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_arc (wrapper)", 0);
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, 2016, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, 1); __PYX_ERR(0, 2049, __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, 2016, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_arc") < 0)) __PYX_ERR(0, 2049, __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, 2016, __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, 2049, __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, 2016, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2049, __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, 2016, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 2049, __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 */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_add_arc(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add_arc", 0);
- /* "pywrapfst.pyx":2033
+ /* "pywrapfst.pyx":2066
* 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, 2033, __pyx_L1_error)
+ __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, 2033, __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)
- /* "pywrapfst.pyx":2034
+ /* "pywrapfst.pyx":2067
* """
* self._add_arc(state, arc)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2016
+ /* "pywrapfst.pyx":2049
* raise FstOpError("Incompatible or invalid weight type")
*
* def add_arc(self, int64 state, Arc arc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2036
+/* "pywrapfst.pyx":2069
* return self
*
* cpdef int64 add_state(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int64 __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add_state", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 2036, __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, 2069, __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, 2036, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __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, 2036, __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, 2069, __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":2045
+ /* "pywrapfst.pyx":2078
* 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, 2045, __pyx_L1_error)
+ __PYX_ERR(0, 2078, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mfst.get()->AddState();
goto __pyx_L0;
- /* "pywrapfst.pyx":2036
+ /* "pywrapfst.pyx":2069
* return self
*
* cpdef int64 add_state(self): # <<<<<<<<<<<<<<
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("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, 2036, __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, 2069, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2047
+/* "pywrapfst.pyx":2080
* return self._mfst.get().AddState()
*
* cpdef void add_states(self, size_t n): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add_states", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 2047, __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, 2080, __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, 2047, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2080, __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, 2047, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2080, __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":2056
+ /* "pywrapfst.pyx":2089
* n: The number of states to add.
* """
* self._mfst.get().AddStates(n) # <<<<<<<<<<<<<<
*
- * cdef void _arcsort(self, sort_type=b"ilabel") except *:
+ * cdef void _arcsort(self, sort_type="ilabel") except *:
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2056, __pyx_L1_error)
+ __PYX_ERR(0, 2089, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->AddStates(__pyx_v_n);
- /* "pywrapfst.pyx":2047
+ /* "pywrapfst.pyx":2080
* return self._mfst.get().AddState()
*
* cpdef void add_states(self, size_t n): # <<<<<<<<<<<<<<
static char __pyx_doc_9pywrapfst_10MutableFst_4add_states[] = "\n add_states(self, n)\n\n Adds n new states to the FST.\n\n Args:\n n: The number of states to add.\n ";
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_5add_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
size_t __pyx_v_n;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_states (wrapper)", 0);
assert(__pyx_arg_n); {
- __pyx_v_n = __Pyx_PyInt_As_size_t(__pyx_arg_n); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2047, __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, 2080, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
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("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, 2047, __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, 2080, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2058
+/* "pywrapfst.pyx":2091
* self._mfst.get().AddStates(n)
*
- * cdef void _arcsort(self, sort_type=b"ilabel") except *: # <<<<<<<<<<<<<<
- * cdef fst.ArcSortType sort_type_enum
- * if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
+ * cdef void _arcsort(self, sort_type="ilabel") except *: # <<<<<<<<<<<<<<
+ * cdef fst.ArcSortType _sort_type
+ * if not fst.GetArcSortType(tostring(sort_type), addr(_sort_type)):
*/
static void __pyx_f_9pywrapfst_10MutableFst__arcsort(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__arcsort *__pyx_optional_args) {
- PyObject *__pyx_v_sort_type = ((PyObject *)__pyx_n_b_ilabel);
- enum fst::script::ArcSortType __pyx_v_sort_type_enum;
+ PyObject *__pyx_v_sort_type = ((PyObject *)__pyx_n_u_ilabel);
+ enum fst::script::ArcSortType __pyx_v__sort_type;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_arcsort", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":2060
- * cdef void _arcsort(self, sort_type=b"ilabel") except *:
- * cdef fst.ArcSortType sort_type_enum
- * if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown sort type {!r}".format(sort_type))
- * fst.ArcSort(self._mfst.get(), sort_type_enum)
+ /* "pywrapfst.pyx":2093
+ * 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, 2060, __pyx_L1_error)
- __pyx_t_2 = ((!(fst::script::GetArcSortType(__pyx_t_1, (&__pyx_v_sort_type_enum)) != 0)) != 0);
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_sort_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2093, __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":2061
- * cdef fst.ArcSortType sort_type_enum
- * if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
- * raise FstArgError("Unknown sort type {!r}".format(sort_type)) # <<<<<<<<<<<<<<
- * fst.ArcSort(self._mfst.get(), sort_type_enum)
+ /* "pywrapfst.pyx":2094
+ * 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, 2061, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2094, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_sort_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2061, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_sort_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_sort_type);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2061, __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, 2094, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
+ __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_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
+ __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_6);
+ __Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2061, __pyx_L1_error)
+ __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)
__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, 2061, __pyx_L1_error)
+ __PYX_ERR(0, 2094, __pyx_L1_error)
- /* "pywrapfst.pyx":2060
- * cdef void _arcsort(self, sort_type=b"ilabel") except *:
- * cdef fst.ArcSortType sort_type_enum
- * if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown sort type {!r}".format(sort_type))
- * fst.ArcSort(self._mfst.get(), sort_type_enum)
+ /* "pywrapfst.pyx":2093
+ * 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)
*/
}
- /* "pywrapfst.pyx":2062
- * if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
- * raise FstArgError("Unknown sort type {!r}".format(sort_type))
- * fst.ArcSort(self._mfst.get(), sort_type_enum) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":2095
+ * 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) # <<<<<<<<<<<<<<
*
- * def arcsort(self, sort_type=b"ilabel"):
+ * def arcsort(self, sort_type="ilabel"):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2062, __pyx_L1_error)
+ __PYX_ERR(0, 2095, __pyx_L1_error)
}
- fst::script::ArcSort(__pyx_v_self->_mfst.get(), __pyx_v_sort_type_enum);
+ fst::script::ArcSort(__pyx_v_self->_mfst.get(), __pyx_v__sort_type);
- /* "pywrapfst.pyx":2058
+ /* "pywrapfst.pyx":2091
* self._mfst.get().AddStates(n)
*
- * cdef void _arcsort(self, sort_type=b"ilabel") except *: # <<<<<<<<<<<<<<
- * cdef fst.ArcSortType sort_type_enum
- * if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
+ * cdef void _arcsort(self, sort_type="ilabel") except *: # <<<<<<<<<<<<<<
+ * cdef fst.ArcSortType _sort_type
+ * if not fst.GetArcSortType(tostring(sort_type), addr(_sort_type)):
*/
/* function exit code */
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst.MutableFst._arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2064
- * fst.ArcSort(self._mfst.get(), sort_type_enum)
+/* "pywrapfst.pyx":2097
+ * fst.ArcSort(self._mfst.get(), _sort_type)
*
- * def arcsort(self, sort_type=b"ilabel"): # <<<<<<<<<<<<<<
+ * def arcsort(self, sort_type="ilabel"): # <<<<<<<<<<<<<<
* """
* arcsort(self, sort_type="ilabel")
*/
static char __pyx_doc_9pywrapfst_10MutableFst_6arcsort[] = "\n arcsort(self, sort_type=\"ilabel\")\n\n Sorts arcs leaving each state of the FST.\n\n This operation destructively sorts arcs leaving each state using either\n input or output labels.\n\n Args:\n sort_type: Either \"ilabel\" (sort arcs according to input labels) or\n \"olabel\" (sort arcs according to output labels).\n\n Returns:\n self.\n\n Raises:\n FstArgError: Unknown sort type.\n ";
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_7arcsort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_sort_type = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("arcsort (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sort_type,0};
PyObject* values[1] = {0};
- values[0] = ((PyObject *)__pyx_n_b_ilabel);
+ values[0] = ((PyObject *)__pyx_n_u_ilabel);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 2064, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 2097, __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, 2064, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("arcsort", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2097, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_10MutableFst__arcsort __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arcsort", 0);
- /* "pywrapfst.pyx":2083
+ /* "pywrapfst.pyx":2116
* 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, 2083, __pyx_L1_error)
+ __PYX_ERR(0, 2116, __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, 2083, __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, 2116, __pyx_L1_error)
- /* "pywrapfst.pyx":2084
+ /* "pywrapfst.pyx":2117
* """
* self._arcsort(sort_type)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2064
- * fst.ArcSort(self._mfst.get(), sort_type_enum)
+ /* "pywrapfst.pyx":2097
+ * fst.ArcSort(self._mfst.get(), _sort_type)
*
- * def arcsort(self, sort_type=b"ilabel"): # <<<<<<<<<<<<<<
+ * def arcsort(self, sort_type="ilabel"): # <<<<<<<<<<<<<<
* """
* arcsort(self, sort_type="ilabel")
*/
return __pyx_r;
}
-/* "pywrapfst.pyx":2086
+/* "pywrapfst.pyx":2119
* return self
*
* cdef void _closure(self, bool closure_plus=False): # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_10MutableFst__closure(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__closure *__pyx_optional_args) {
bool __pyx_v_closure_plus = ((bool)0);
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_closure", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":2087
+ /* "pywrapfst.pyx":2120
*
* 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, 2087, __pyx_L1_error)
+ __PYX_ERR(0, 2120, __pyx_L1_error)
}
fst::script::Closure(__pyx_v_self->_mfst.get(), fst::script::GetClosureType(__pyx_v_closure_plus));
- /* "pywrapfst.pyx":2086
+ /* "pywrapfst.pyx":2119
* return self
*
* cdef void _closure(self, bool closure_plus=False): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2089
+/* "pywrapfst.pyx":2122
* fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
*
* def closure(self, bool closure_plus=False): # <<<<<<<<<<<<<<
static char __pyx_doc_9pywrapfst_10MutableFst_8closure[] = "\n closure(self, closure_plus=False)\n\n Computes concatenative closure.\n\n This operation destructively converts the FST to its concatenative closure.\n If A transduces string x to y with weight a, then the closure transduces x\n to y with weight a, xx to yy with weight a \\otimes a, xxx to yyy with weight\n a \\otimes a \\otimes a, and so on. The empty string is also transduced to\n itself with semiring One if `closure_plus` is False.\n\n Args:\n closure_plus: If False, do not accept the empty string.\n\n Returns:\n self.\n ";
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_9closure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
bool __pyx_v_closure_plus;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("closure (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "closure") < 0)) __PYX_ERR(0, 2089, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "closure") < 0)) __PYX_ERR(0, 2122, __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, 2089, __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, 2122, __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, 2089, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("closure", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2122, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.closure", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_10MutableFst__closure __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("closure", 0);
- /* "pywrapfst.pyx":2107
+ /* "pywrapfst.pyx":2140
* 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, 2107, __pyx_L1_error)
+ __PYX_ERR(0, 2140, __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":2108
+ /* "pywrapfst.pyx":2141
* """
* self._closure(closure_plus)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2089
+ /* "pywrapfst.pyx":2122
* fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
*
* def closure(self, bool closure_plus=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2110
+/* "pywrapfst.pyx":2143
* return self
*
* cdef void _concat(self, Fst fst2) except *: # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_10MutableFst__concat(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_fst2) {
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_concat", 0);
- /* "pywrapfst.pyx":2111
+ /* "pywrapfst.pyx":2144
*
* 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, 2111, __pyx_L1_error)
+ __PYX_ERR(0, 2144, __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, 2111, __pyx_L1_error)
+ __PYX_ERR(0, 2144, __pyx_L1_error)
}
fst::script::Concat(__pyx_v_self->_mfst.get(), (*__pyx_v_fst2->_fst));
- /* "pywrapfst.pyx":2112
+ /* "pywrapfst.pyx":2145
* 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, 2112, __pyx_L1_error)
+ __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, 2112, __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)
- /* "pywrapfst.pyx":2110
+ /* "pywrapfst.pyx":2143
* return self
*
* cdef void _concat(self, Fst fst2) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2114
+/* "pywrapfst.pyx":2147
* self._check_mutating_imethod()
*
* def concat(self, Fst fst2): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_11concat(PyObject *__pyx_v_self, PyObject *__pyx_v_fst2); /*proto*/
static char __pyx_doc_9pywrapfst_10MutableFst_10concat[] = "\n concat(self, fst2)\n\n Computes the concatenation (product) of two FSTs.\n\n This operation destructively concatenates the FST with a second FST. If A\n transduces string x to y with weight a and B transduces string w to v with\n weight b, then their concatenation transduces string xw to yv with weight a\n \\otimes b.\n\n Args:\n fst2: The second input FST.\n\n Returns:\n self.\n ";
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_11concat(PyObject *__pyx_v_self, PyObject *__pyx_v_fst2) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
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, 2114, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst2), __pyx_ptype_9pywrapfst_Fst, 1, "fst2", 0))) __PYX_ERR(0, 2147, __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 */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_10concat(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_fst2) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("concat", 0);
- /* "pywrapfst.pyx":2131
+ /* "pywrapfst.pyx":2164
* 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, 2131, __pyx_L1_error)
+ __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, 2131, __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)
- /* "pywrapfst.pyx":2132
+ /* "pywrapfst.pyx":2165
* """
* self._concat(fst2)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2114
+ /* "pywrapfst.pyx":2147
* self._check_mutating_imethod()
*
* def concat(self, Fst fst2): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2134
+/* "pywrapfst.pyx":2167
* return self
*
* cdef void _connect(self): # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_10MutableFst__connect(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_connect", 0);
- /* "pywrapfst.pyx":2135
+ /* "pywrapfst.pyx":2168
*
* 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, 2135, __pyx_L1_error)
+ __PYX_ERR(0, 2168, __pyx_L1_error)
}
fst::script::Connect(__pyx_v_self->_mfst.get());
- /* "pywrapfst.pyx":2134
+ /* "pywrapfst.pyx":2167
* return self
*
* cdef void _connect(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2137
+/* "pywrapfst.pyx":2170
* fst.Connect(self._mfst.get())
*
* def connect(self): # <<<<<<<<<<<<<<
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_12connect(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("connect", 0);
- /* "pywrapfst.pyx":2149
+ /* "pywrapfst.pyx":2182
* 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, 2149, __pyx_L1_error)
+ __PYX_ERR(0, 2182, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_connect(__pyx_v_self);
- /* "pywrapfst.pyx":2150
+ /* "pywrapfst.pyx":2183
* """
* self._connect()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2137
+ /* "pywrapfst.pyx":2170
* fst.Connect(self._mfst.get())
*
* def connect(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2152
+/* "pywrapfst.pyx":2185
* return self
*
* cdef void _decode(self, EncodeMapper mapper) except *: # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_10MutableFst__decode(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper) {
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_decode", 0);
- /* "pywrapfst.pyx":2153
+ /* "pywrapfst.pyx":2186
*
* 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, 2153, __pyx_L1_error)
+ __PYX_ERR(0, 2186, __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, 2153, __pyx_L1_error)
+ __PYX_ERR(0, 2186, __pyx_L1_error)
}
fst::script::Decode(__pyx_v_self->_mfst.get(), (*__pyx_v_mapper->_mapper));
- /* "pywrapfst.pyx":2154
+ /* "pywrapfst.pyx":2187
* 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, 2154, __pyx_L1_error)
+ __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, 2154, __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)
- /* "pywrapfst.pyx":2152
+ /* "pywrapfst.pyx":2185
* return self
*
* cdef void _decode(self, EncodeMapper mapper) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2156
+/* "pywrapfst.pyx":2189
* self._check_mutating_imethod()
*
* def decode(self, EncodeMapper mapper): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_15decode(PyObject *__pyx_v_self, PyObject *__pyx_v_mapper); /*proto*/
static char __pyx_doc_9pywrapfst_10MutableFst_14decode[] = "\n decode(self, mapper)\n\n Decodes encoded labels and/or weights.\n\n This operation reverses the encoding performed by `encode`.\n\n Args:\n mapper: An EncodeMapper object used to encode the FST.\n\n Returns:\n self.\n ";
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_15decode(PyObject *__pyx_v_self, PyObject *__pyx_v_mapper) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
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, 2156, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapper), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "mapper", 0))) __PYX_ERR(0, 2189, __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 */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_14decode(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("decode", 0);
- /* "pywrapfst.pyx":2170
+ /* "pywrapfst.pyx":2203
* 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, 2170, __pyx_L1_error)
+ __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, 2170, __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)
- /* "pywrapfst.pyx":2171
+ /* "pywrapfst.pyx":2204
* """
* self._decode(mapper)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2156
+ /* "pywrapfst.pyx":2189
* self._check_mutating_imethod()
*
* def decode(self, EncodeMapper mapper): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2173
+/* "pywrapfst.pyx":2206
* return self
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_delete_arcs", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":2174
+ /* "pywrapfst.pyx":2207
*
* 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, 2174, __pyx_L1_error)
+ __PYX_ERR(0, 2207, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state, __pyx_v_n);
} else {
- /* "pywrapfst.pyx":2175
+ /* "pywrapfst.pyx":2208
* 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, 2175, __pyx_L1_error)
+ __PYX_ERR(0, 2208, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state);
}
- /* "pywrapfst.pyx":2174
+ /* "pywrapfst.pyx":2207
*
* 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":2176
+ /* "pywrapfst.pyx":2209
* 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, 2176, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2209, __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, 2176, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2209, __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, 2176, __pyx_L1_error)
+ __PYX_ERR(0, 2209, __pyx_L1_error)
- /* "pywrapfst.pyx":2174
+ /* "pywrapfst.pyx":2207
*
* 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":2177
+ /* "pywrapfst.pyx":2210
* 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, 2177, __pyx_L1_error)
+ __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, 2177, __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)
- /* "pywrapfst.pyx":2173
+ /* "pywrapfst.pyx":2206
* return self
*
* cdef void _delete_arcs(self, int64 state, size_t n=0) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2179
+/* "pywrapfst.pyx":2212
* self._check_mutating_imethod()
*
* def delete_arcs(self, int64 state, size_t n=0): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_17delete_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int64 __pyx_v_state;
size_t __pyx_v_n;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("delete_arcs (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_arcs") < 0)) __PYX_ERR(0, 2179, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_arcs") < 0)) __PYX_ERR(0, 2212, __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, 2179, __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, 2212, __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, 2179, __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, 2212, __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, 2179, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("delete_arcs", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2212, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.delete_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_arcs __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("delete_arcs", 0);
- /* "pywrapfst.pyx":2197
+ /* "pywrapfst.pyx":2230
* 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, 2197, __pyx_L1_error)
+ __PYX_ERR(0, 2230, __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, 2197, __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, 2230, __pyx_L1_error)
- /* "pywrapfst.pyx":2198
+ /* "pywrapfst.pyx":2231
* """
* self._delete_arcs(state, n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2179
+ /* "pywrapfst.pyx":2212
* self._check_mutating_imethod()
*
* def delete_arcs(self, int64 state, size_t n=0): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2200
+/* "pywrapfst.pyx":2233
* return self
*
* cdef void _delete_states(self, states=None) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_delete_states", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":2202
+ /* "pywrapfst.pyx":2235
* 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, 2202, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_states); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2235, __pyx_L1_error)
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2203
+ /* "pywrapfst.pyx":2236
* # 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, 2203, __pyx_L1_error)
+ __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, 2203, __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_1 = ((!(__pyx_v_self->_mfst.get()->DeleteStates(((std::vector<int64> const )__pyx_t_2)) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2204
+ /* "pywrapfst.pyx":2237
* 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, 2204, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2237, __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, 2204, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2237, __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, 2204, __pyx_L1_error)
+ __PYX_ERR(0, 2237, __pyx_L1_error)
- /* "pywrapfst.pyx":2203
+ /* "pywrapfst.pyx":2236
* # Only the former signature has a possible indexing failure.
* if states:
* if not self._mfst.get().DeleteStates(<const vector[int64]> states): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2202
+ /* "pywrapfst.pyx":2235
* cdef void _delete_states(self, states=None) except *:
* # Only the former signature has a possible indexing failure.
* if states: # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "pywrapfst.pyx":2206
+ /* "pywrapfst.pyx":2239
* 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, 2206, __pyx_L1_error)
+ __PYX_ERR(0, 2239, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->DeleteStates();
}
__pyx_L3:;
- /* "pywrapfst.pyx":2207
+ /* "pywrapfst.pyx":2240
* 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, 2207, __pyx_L1_error)
+ __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, 2207, __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)
- /* "pywrapfst.pyx":2200
+ /* "pywrapfst.pyx":2233
* return self
*
* cdef void _delete_states(self, states=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2209
+/* "pywrapfst.pyx":2242
* self._check_mutating_imethod()
*
* def delete_states(self, states=None): # <<<<<<<<<<<<<<
static char __pyx_doc_9pywrapfst_10MutableFst_18delete_states[] = "\n delete_states(self, states=None)\n\n Deletes states.\n\n Args:\n states: An optional iterable of integer indices of the states to be\n deleted. If this argument is omitted, all states are deleted.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n ";
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_19delete_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_states = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("delete_states (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_states") < 0)) __PYX_ERR(0, 2209, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_states") < 0)) __PYX_ERR(0, 2242, __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, 2209, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("delete_states", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2242, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.delete_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_states __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("delete_states", 0);
- /* "pywrapfst.pyx":2225
+ /* "pywrapfst.pyx":2258
* 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, 2225, __pyx_L1_error)
+ __PYX_ERR(0, 2258, __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, 2225, __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, 2258, __pyx_L1_error)
- /* "pywrapfst.pyx":2226
+ /* "pywrapfst.pyx":2259
* """
* self._delete_states(states)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2209
+ /* "pywrapfst.pyx":2242
* self._check_mutating_imethod()
*
* def delete_states(self, states=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2228
+/* "pywrapfst.pyx":2261
* return self
*
* cdef void _encode(self, EncodeMapper mapper) except *: # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_10MutableFst__encode(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper) {
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_encode", 0);
- /* "pywrapfst.pyx":2229
+ /* "pywrapfst.pyx":2262
*
* 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, 2229, __pyx_L1_error)
+ __PYX_ERR(0, 2262, __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, 2229, __pyx_L1_error)
+ __PYX_ERR(0, 2262, __pyx_L1_error)
}
fst::script::Encode(__pyx_v_self->_mfst.get(), __pyx_v_mapper->_mapper.get());
- /* "pywrapfst.pyx":2230
+ /* "pywrapfst.pyx":2263
* 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, 2230, __pyx_L1_error)
+ __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, 2230, __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)
- /* "pywrapfst.pyx":2228
+ /* "pywrapfst.pyx":2261
* return self
*
* cdef void _encode(self, EncodeMapper mapper) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2232
+/* "pywrapfst.pyx":2265
* self._check_mutating_imethod()
*
* def encode(self, EncodeMapper mapper): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_21encode(PyObject *__pyx_v_self, PyObject *__pyx_v_mapper); /*proto*/
static char __pyx_doc_9pywrapfst_10MutableFst_20encode[] = "\n encode(self, mapper)\n\n Encodes labels and/or weights.\n\n This operation allows for the representation of a weighted transducer as a\n weighted acceptor, an unweighted transducer, or an unweighted acceptor by\n considering the pair (input label, output label), the pair (input label,\n weight), or the triple (input label, output label, weight) as a single\n label. Applying this operation mutates the EncodeMapper argument, which\n can then be used to decode.\n\n Args:\n mapper: An EncodeMapper object to be used as the mapper.\n\n Returns:\n self.\n ";
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_21encode(PyObject *__pyx_v_self, PyObject *__pyx_v_mapper) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
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, 2232, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapper), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "mapper", 0))) __PYX_ERR(0, 2265, __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 */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_20encode(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("encode", 0);
- /* "pywrapfst.pyx":2251
+ /* "pywrapfst.pyx":2284
* 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, 2251, __pyx_L1_error)
+ __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, 2251, __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)
- /* "pywrapfst.pyx":2252
+ /* "pywrapfst.pyx":2285
* """
* self._encode(mapper)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2232
+ /* "pywrapfst.pyx":2265
* self._check_mutating_imethod()
*
* def encode(self, EncodeMapper mapper): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2254
+/* "pywrapfst.pyx":2287
* return self
*
* cdef void _invert(self): # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_10MutableFst__invert(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_invert", 0);
- /* "pywrapfst.pyx":2255
+ /* "pywrapfst.pyx":2288
*
* 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, 2255, __pyx_L1_error)
+ __PYX_ERR(0, 2288, __pyx_L1_error)
}
fst::script::Invert(__pyx_v_self->_mfst.get());
- /* "pywrapfst.pyx":2254
+ /* "pywrapfst.pyx":2287
* return self
*
* cdef void _invert(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2257
+/* "pywrapfst.pyx":2290
* fst.Invert(self._mfst.get())
*
* def invert(self): # <<<<<<<<<<<<<<
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_22invert(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("invert", 0);
- /* "pywrapfst.pyx":2269
+ /* "pywrapfst.pyx":2302
* 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, 2269, __pyx_L1_error)
+ __PYX_ERR(0, 2302, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_invert(__pyx_v_self);
- /* "pywrapfst.pyx":2270
+ /* "pywrapfst.pyx":2303
* """
* self._invert()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2257
+ /* "pywrapfst.pyx":2290
* fst.Invert(self._mfst.get())
*
* def invert(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2272
+/* "pywrapfst.pyx":2305
* 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__10;
+ float __pyx_v_delta = __pyx_k__12;
- /* "pywrapfst.pyx":2274
+ /* "pywrapfst.pyx":2307
* cdef void _minimize(self,
* float delta=fst.kShortestDelta,
* bool allow_nondet=False) except *: # <<<<<<<<<<<<<<
*/
bool __pyx_v_allow_nondet = ((bool)0);
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_minimize", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":2276
+ /* "pywrapfst.pyx":2309
* 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, 2276, __pyx_L1_error)
+ __PYX_ERR(0, 2309, __pyx_L1_error)
}
fst::script::Minimize(__pyx_v_self->_mfst.get(), NULL, __pyx_v_delta, __pyx_v_allow_nondet);
- /* "pywrapfst.pyx":2277
+ /* "pywrapfst.pyx":2310
* # 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, 2277, __pyx_L1_error)
+ __PYX_ERR(0, 2310, __pyx_L1_error)
}
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2277, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2310, __pyx_L1_error)
- /* "pywrapfst.pyx":2272
+ /* "pywrapfst.pyx":2305
* return self
*
* cdef void _minimize(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2279
+/* "pywrapfst.pyx":2312
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_25minimize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
float __pyx_v_delta;
bool __pyx_v_allow_nondet;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("minimize (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minimize") < 0)) __PYX_ERR(0, 2279, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minimize") < 0)) __PYX_ERR(0, 2312, __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, 2279, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2312, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__11;
+ __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, 2279, __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, 2312, __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, 2279, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("minimize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2312, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.minimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_10MutableFst__minimize __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("minimize", 0);
- /* "pywrapfst.pyx":2305
+ /* "pywrapfst.pyx":2338
* 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, 2305, __pyx_L1_error)
+ __PYX_ERR(0, 2338, __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, 2305, __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, 2338, __pyx_L1_error)
- /* "pywrapfst.pyx":2306
+ /* "pywrapfst.pyx":2339
* """
* self._minimize(delta, allow_nondet)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2279
+ /* "pywrapfst.pyx":2312
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2308
+/* "pywrapfst.pyx":2341
* return self
*
* cpdef MutableArcIterator mutable_arcs(self, int64 state): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mutable_arcs", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 2308, __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, 2341, __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, 2308, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2341, __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, 2308, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2341, __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, 2308, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_MutableArcIterator))))) __PYX_ERR(0, 2341, __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":2320
+ /* "pywrapfst.pyx":2353
* 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, 2320, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2320, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2353, __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, 2320, __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, 2353, __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":2308
+ /* "pywrapfst.pyx":2341
* return self
*
* cpdef MutableArcIterator mutable_arcs(self, int64 state): # <<<<<<<<<<<<<<
static char __pyx_doc_9pywrapfst_10MutableFst_26mutable_arcs[] = "\n mutable_arcs(self, state)\n\n Returns a mutable iterator over arcs leaving the specified state.\n\n Args:\n state: The source state ID.\n\n Returns:\n A MutableArcIterator.\n ";
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_27mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
int64 __pyx_v_state;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("mutable_arcs (wrapper)", 0);
assert(__pyx_arg_state); {
- __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2308, __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, 2341, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
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("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, 2308, __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, 2341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2322
+/* "pywrapfst.pyx":2355
* return MutableArcIterator(self, state)
*
* def mutable_input_symbols(self): # <<<<<<<<<<<<<<
}
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_28mutable_input_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
- fst::SymbolTable *__pyx_v_syms;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mutable_input_symbols", 0);
- /* "pywrapfst.pyx":2328
+ /* "pywrapfst.pyx":2361
* Returns the FST's (mutable) input symbol table, or None if none is present.
* """
- * cdef fst.SymbolTable *syms = self._mfst.get().MutableInputSymbols() # <<<<<<<<<<<<<<
- * if syms == NULL:
+ * if self._mfst.get().MutableInputSymbols() == NULL: # <<<<<<<<<<<<<<
* return
+ * return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2328, __pyx_L1_error)
+ __PYX_ERR(0, 2361, __pyx_L1_error)
}
- __pyx_v_syms = __pyx_v_self->_mfst.get()->MutableInputSymbols();
-
- /* "pywrapfst.pyx":2329
- * """
- * cdef fst.SymbolTable *syms = self._mfst.get().MutableInputSymbols()
- * if syms == NULL: # <<<<<<<<<<<<<<
- * return
- * return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
- */
- __pyx_t_1 = ((__pyx_v_syms == NULL) != 0);
+ __pyx_t_1 = ((__pyx_v_self->_mfst.get()->MutableInputSymbols() == NULL) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2330
- * cdef fst.SymbolTable *syms = self._mfst.get().MutableInputSymbols()
- * if syms == NULL:
+ /* "pywrapfst.pyx":2362
+ * """
+ * if self._mfst.get().MutableInputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
* return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
*
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":2329
+ /* "pywrapfst.pyx":2361
+ * Returns the FST's (mutable) input symbol table, or None if none is present.
* """
- * cdef fst.SymbolTable *syms = self._mfst.get().MutableInputSymbols()
- * if syms == NULL: # <<<<<<<<<<<<<<
+ * if self._mfst.get().MutableInputSymbols() == NULL: # <<<<<<<<<<<<<<
* return
* return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
*/
}
- /* "pywrapfst.pyx":2331
- * if syms == NULL:
+ /* "pywrapfst.pyx":2363
+ * 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, 2331, __pyx_L1_error)
+ __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, 2331, __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_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2322
+ /* "pywrapfst.pyx":2355
* return MutableArcIterator(self, state)
*
* def mutable_input_symbols(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2333
+/* "pywrapfst.pyx":2365
* return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
*
* def mutable_output_symbols(self): # <<<<<<<<<<<<<<
}
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_30mutable_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
- __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_v_syms;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mutable_output_symbols", 0);
- /* "pywrapfst.pyx":2339
+ /* "pywrapfst.pyx":2371
* Returns the FST's (mutable) output symbol table, or None if none is present.
* """
- * cdef SymbolTable_ptr syms = self._mfst.get().MutableOutputSymbols() # <<<<<<<<<<<<<<
- * if syms == NULL:
+ * if self._mfst.get().MutableOutputSymbols() == NULL: # <<<<<<<<<<<<<<
* return
+ * return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2339, __pyx_L1_error)
+ __PYX_ERR(0, 2371, __pyx_L1_error)
}
- __pyx_v_syms = __pyx_v_self->_mfst.get()->MutableOutputSymbols();
-
- /* "pywrapfst.pyx":2340
- * """
- * cdef SymbolTable_ptr syms = self._mfst.get().MutableOutputSymbols()
- * if syms == NULL: # <<<<<<<<<<<<<<
- * return
- * return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
- */
- __pyx_t_1 = ((__pyx_v_syms == NULL) != 0);
+ __pyx_t_1 = ((__pyx_v_self->_mfst.get()->MutableOutputSymbols() == NULL) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2341
- * cdef SymbolTable_ptr syms = self._mfst.get().MutableOutputSymbols()
- * if syms == NULL:
+ /* "pywrapfst.pyx":2372
+ * """
+ * if self._mfst.get().MutableOutputSymbols() == NULL:
* return # <<<<<<<<<<<<<<
* return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
*
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "pywrapfst.pyx":2340
+ /* "pywrapfst.pyx":2371
+ * Returns the FST's (mutable) output symbol table, or None if none is present.
* """
- * cdef SymbolTable_ptr syms = self._mfst.get().MutableOutputSymbols()
- * if syms == NULL: # <<<<<<<<<<<<<<
+ * if self._mfst.get().MutableOutputSymbols() == NULL: # <<<<<<<<<<<<<<
* return
* return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
*/
}
- /* "pywrapfst.pyx":2342
- * if syms == NULL:
+ /* "pywrapfst.pyx":2373
+ * 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, 2342, __pyx_L1_error)
+ __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, 2342, __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_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2333
+ /* "pywrapfst.pyx":2365
* return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
*
* def mutable_output_symbols(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2344
+/* "pywrapfst.pyx":2375
* return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
*
* cpdef int64 num_states(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int64 __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("num_states", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 2344, __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, 2375, __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, 2344, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2375, __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, 2344, __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, 2375, __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":2350
+ /* "pywrapfst.pyx":2381
* Returns the number of states.
* """
* return self._mfst.get().NumStates() # <<<<<<<<<<<<<<
*
- * cdef void _project(self, bool project_output=False) except *:
+ * cdef void _project(self, project_type) except *:
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2350, __pyx_L1_error)
+ __PYX_ERR(0, 2381, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_mfst.get()->NumStates();
goto __pyx_L0;
- /* "pywrapfst.pyx":2344
+ /* "pywrapfst.pyx":2375
* return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
*
* cpdef int64 num_states(self): # <<<<<<<<<<<<<<
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("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, 2344, __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, 2375, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2352
+/* "pywrapfst.pyx":2383
* return self._mfst.get().NumStates()
*
- * cdef void _project(self, bool project_output=False) except *: # <<<<<<<<<<<<<<
- * fst.Project(self._mfst.get(), fst.GetProjectType(project_output))
+ * cdef void _project(self, project_type) except *: # <<<<<<<<<<<<<<
+ * fst.Project(self._mfst.get(), _get_project_type(tostring(project_type)))
*
*/
-static void __pyx_f_9pywrapfst_10MutableFst__project(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__project *__pyx_optional_args) {
- bool __pyx_v_project_output = ((bool)0);
+static void __pyx_f_9pywrapfst_10MutableFst__project(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_project_type) {
__Pyx_RefNannyDeclarations
+ std::string __pyx_t_1;
+ fst::ProjectType __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_project", 0);
- if (__pyx_optional_args) {
- if (__pyx_optional_args->__pyx_n > 0) {
- __pyx_v_project_output = __pyx_optional_args->project_output;
- }
- }
- /* "pywrapfst.pyx":2353
+ /* "pywrapfst.pyx":2384
*
- * cdef void _project(self, bool project_output=False) except *:
- * fst.Project(self._mfst.get(), fst.GetProjectType(project_output)) # <<<<<<<<<<<<<<
+ * cdef void _project(self, project_type) except *:
+ * fst.Project(self._mfst.get(), _get_project_type(tostring(project_type))) # <<<<<<<<<<<<<<
*
- * def project(self, bool project_output=False):
+ * def project(self, project_type):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2353, __pyx_L1_error)
+ __PYX_ERR(0, 2384, __pyx_L1_error)
}
- fst::script::Project(__pyx_v_self->_mfst.get(), fst::script::GetProjectType(__pyx_v_project_output));
+ __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)
+ fst::script::Project(__pyx_v_self->_mfst.get(), __pyx_t_2);
- /* "pywrapfst.pyx":2352
+ /* "pywrapfst.pyx":2383
* return self._mfst.get().NumStates()
*
- * cdef void _project(self, bool project_output=False) except *: # <<<<<<<<<<<<<<
- * fst.Project(self._mfst.get(), fst.GetProjectType(project_output))
+ * cdef void _project(self, project_type) except *: # <<<<<<<<<<<<<<
+ * fst.Project(self._mfst.get(), _get_project_type(tostring(project_type)))
*
*/
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2355
- * fst.Project(self._mfst.get(), fst.GetProjectType(project_output))
+/* "pywrapfst.pyx":2386
+ * fst.Project(self._mfst.get(), _get_project_type(tostring(project_type)))
*
- * def project(self, bool project_output=False): # <<<<<<<<<<<<<<
+ * def project(self, project_type): # <<<<<<<<<<<<<<
* """
- * project(self, project_output=False)
+ * project(self, project_type)
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_10MutableFst_35project(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_10MutableFst_34project[] = "\n project(self, project_output=False)\n\n Converts the FST to an acceptor using input or output labels.\n\n This operation destructively projects an FST onto its domain or range by\n either copying each arc's input label to its output label (the default) or\n vice versa.\n\n Args:\n project_output: Should the output labels be projected?\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_10MutableFst_35project(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- bool __pyx_v_project_output;
+static PyObject *__pyx_pw_9pywrapfst_10MutableFst_35project(PyObject *__pyx_v_self, PyObject *__pyx_v_project_type); /*proto*/
+static char __pyx_doc_9pywrapfst_10MutableFst_34project[] = "\n project(self, project_type)\n\n Converts the FST to an acceptor using input or output labels.\n\n This operation destructively projects an FST onto its domain or range by\n either copying each arc's input label to its output label (the default) or\n vice versa.\n\n Args:\n project_type: A string matching a known projection type; one of:\n \"input\", \"output\".\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_10MutableFst_35project(PyObject *__pyx_v_self, PyObject *__pyx_v_project_type) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("project (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_project_output,0};
- PyObject* values[1] = {0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_project_output);
- if (value) { values[0] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "project") < 0)) __PYX_ERR(0, 2355, __pyx_L3_error)
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- if (values[0]) {
- __pyx_v_project_output = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_project_output == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2355, __pyx_L3_error)
- } else {
- __pyx_v_project_output = ((bool)0);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("project", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2355, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("pywrapfst.MutableFst.project", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_34project(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_project_output);
+ __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_34project(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), ((PyObject *)__pyx_v_project_type));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_10MutableFst_34project(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, bool __pyx_v_project_output) {
+static PyObject *__pyx_pf_9pywrapfst_10MutableFst_34project(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_project_type) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- struct __pyx_opt_args_9pywrapfst_10MutableFst__project __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("project", 0);
- /* "pywrapfst.pyx":2371
+ /* "pywrapfst.pyx":2403
* self.
* """
- * self._project(project_output) # <<<<<<<<<<<<<<
+ * self._project(project_type) # <<<<<<<<<<<<<<
* return self
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_project");
- __PYX_ERR(0, 2371, __pyx_L1_error)
+ __PYX_ERR(0, 2403, __pyx_L1_error)
}
- __pyx_t_1.__pyx_n = 1;
- __pyx_t_1.project_output = __pyx_v_project_output;
- ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_project(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2371, __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)
- /* "pywrapfst.pyx":2372
+ /* "pywrapfst.pyx":2404
* """
- * self._project(project_output)
+ * self._project(project_type)
* return self # <<<<<<<<<<<<<<
*
* cdef void _prune(self,
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2355
- * fst.Project(self._mfst.get(), fst.GetProjectType(project_output))
+ /* "pywrapfst.pyx":2386
+ * fst.Project(self._mfst.get(), _get_project_type(tostring(project_type)))
*
- * def project(self, bool project_output=False): # <<<<<<<<<<<<<<
+ * def project(self, project_type): # <<<<<<<<<<<<<<
* """
- * project(self, project_output=False)
+ * project(self, project_type)
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":2374
+/* "pywrapfst.pyx":2406
* return self
*
* cdef void _prune(self, # <<<<<<<<<<<<<<
*/
static void __pyx_f_9pywrapfst_10MutableFst__prune(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__prune *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__12;
- int64 __pyx_v_nstate = __pyx_k__13;
+ float __pyx_v_delta = __pyx_k__14;
+ int64 __pyx_v_nstate = __pyx_k__15;
- /* "pywrapfst.pyx":2377
+ /* "pywrapfst.pyx":2409
* 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 wc = _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_wc;
+ fst::script::WeightClass __pyx_v__weight;
__Pyx_RefNannyDeclarations
fst::script::WeightClass __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_prune", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":2379
+ /* "pywrapfst.pyx":2411
* weight=None) except *:
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(), # <<<<<<<<<<<<<<
- * weight)
- * fst.Prune(self._mfst.get(), wc, nstate, delta)
+ * 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, 2379, __pyx_L1_error)
+ __PYX_ERR(0, 2411, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2380
+ /* "pywrapfst.pyx":2412
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
- * weight) # <<<<<<<<<<<<<<
- * fst.Prune(self._mfst.get(), wc, nstate, delta)
+ * 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, 2379, __pyx_L1_error)
- __pyx_v_wc = __pyx_t_1;
+ __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_v__weight = __pyx_t_1;
- /* "pywrapfst.pyx":2381
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
- * weight)
- * fst.Prune(self._mfst.get(), wc, nstate, delta) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":2413
+ * 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, 2381, __pyx_L1_error)
+ __PYX_ERR(0, 2413, __pyx_L1_error)
}
- fst::script::Prune(__pyx_v_self->_mfst.get(), __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
+ fst::script::Prune(__pyx_v_self->_mfst.get(), __pyx_v__weight, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":2382
- * weight)
- * fst.Prune(self._mfst.get(), wc, nstate, delta)
+ /* "pywrapfst.pyx":2414
+ * weight)
+ * fst.Prune(self._mfst.get(), _weight, nstate, delta)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*
* def prune(self,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2382, __pyx_L1_error)
+ __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, 2382, __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)
- /* "pywrapfst.pyx":2374
+ /* "pywrapfst.pyx":2406
* return self
*
* cdef void _prune(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2384
+/* "pywrapfst.pyx":2416
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
float __pyx_v_delta;
int64 __pyx_v_nstate;
PyObject *__pyx_v_weight = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("prune (wrapper)", 0);
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_weight,0};
PyObject* values[3] = {0,0,0};
- /* "pywrapfst.pyx":2387
+ /* "pywrapfst.pyx":2419
* 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, 2384, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 2416, __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, 2385, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__14;
+ __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, 2386, __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, 2418, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__15;
+ __pyx_v_nstate = __pyx_k__17;
}
__pyx_v_weight = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2384, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2416, __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":2384
+ /* "pywrapfst.pyx":2416
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_10MutableFst__prune __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("prune", 0);
- /* "pywrapfst.pyx":2407
+ /* "pywrapfst.pyx":2439
* 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, 2407, __pyx_L1_error)
+ __PYX_ERR(0, 2439, __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, 2407, __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, 2439, __pyx_L1_error)
- /* "pywrapfst.pyx":2408
+ /* "pywrapfst.pyx":2440
* """
* self._prune(delta, nstate, weight)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2384
+ /* "pywrapfst.pyx":2416
* self._check_mutating_imethod()
*
* def prune(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2410
+/* "pywrapfst.pyx":2442
* 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__16;
+ float __pyx_v_delta = __pyx_k__18;
- /* "pywrapfst.pyx":2412
+ /* "pywrapfst.pyx":2444
* cdef void _push(self,
* float delta=fst.kShortestDelta,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
* bool to_final=False):
- * fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,
+ * fst.Push(self._mfst.get(),
*/
bool __pyx_v_remove_total_weight = ((bool)0);
- /* "pywrapfst.pyx":2413
+ /* "pywrapfst.pyx":2445
* float delta=fst.kShortestDelta,
* bool remove_total_weight=False,
* bool to_final=False): # <<<<<<<<<<<<<<
- * fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,
- * remove_total_weight)
+ * fst.Push(self._mfst.get(),
+ * fst.GetReweightType(to_final),
*/
bool __pyx_v_to_final = ((bool)0);
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_push", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":2414
+ /* "pywrapfst.pyx":2446
* bool remove_total_weight=False,
* bool to_final=False):
- * fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta, # <<<<<<<<<<<<<<
- * remove_total_weight)
- *
+ * fst.Push(self._mfst.get(), # <<<<<<<<<<<<<<
+ * fst.GetReweightType(to_final),
+ * delta,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2414, __pyx_L1_error)
+ __PYX_ERR(0, 2446, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2415
- * bool to_final=False):
- * fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,
+ /* "pywrapfst.pyx":2449
+ * fst.GetReweightType(to_final),
+ * delta,
* remove_total_weight) # <<<<<<<<<<<<<<
*
* def push(self,
*/
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":2410
+ /* "pywrapfst.pyx":2442
* return self
*
* cdef void _push(self, # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2417
+/* "pywrapfst.pyx":2451
* remove_total_weight)
*
* def push(self, # <<<<<<<<<<<<<<
float __pyx_v_delta;
bool __pyx_v_remove_total_weight;
bool __pyx_v_to_final;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("push (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 2417, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 2451, __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, 2418, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2452, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__17;
+ __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, 2419, __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, 2453, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2419
+ /* "pywrapfst.pyx":2453
* 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, 2420, __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, 2454, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2420
+ /* "pywrapfst.pyx":2454
* 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, 2417, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("push", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2451, __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":2417
+ /* "pywrapfst.pyx":2451
* remove_total_weight)
*
* def push(self, # <<<<<<<<<<<<<<
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_10MutableFst__push __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("push", 0);
- /* "pywrapfst.pyx":2444
+ /* "pywrapfst.pyx":2478
* 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, 2444, __pyx_L1_error)
+ __PYX_ERR(0, 2478, __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":2445
+ /* "pywrapfst.pyx":2479
* """
* self._push(delta, remove_total_weight, to_final)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2417
+ /* "pywrapfst.pyx":2451
* remove_total_weight)
*
* def push(self, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2447
+/* "pywrapfst.pyx":2481
* return self
*
* cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *: # <<<<<<<<<<<<<<
- * cdef unique_ptr[vector[fst.LabelPair]] _ipairs
- * _ipairs.reset(new vector[fst.LabelPair]())
+ * cdef vector[fst.LabelPair] _ipairs
+ * cdef vector[fst.LabelPair] _opairs
*/
static void __pyx_f_9pywrapfst_10MutableFst__relabel_pairs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_pairs *__pyx_optional_args) {
PyObject *__pyx_v_ipairs = ((PyObject *)Py_None);
PyObject *__pyx_v_opairs = ((PyObject *)Py_None);
- std::unique_ptr<std::vector<__pyx_t_10cpywrapfst_LabelPair> > __pyx_v__ipairs;
- std::unique_ptr<std::vector<__pyx_t_10cpywrapfst_LabelPair> > __pyx_v__opairs;
- int64 __pyx_v_before;
- int64 __pyx_v_after;
+ std::vector<__pyx_t_10cpywrapfst_LabelPair> __pyx_v__ipairs;
+ std::vector<__pyx_t_10cpywrapfst_LabelPair> __pyx_v__opairs;
+ PyObject *__pyx_v_before = NULL;
+ PyObject *__pyx_v_after = NULL;
__Pyx_RefNannyDeclarations
- std::vector<__pyx_t_10cpywrapfst_LabelPair> *__pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- Py_ssize_t __pyx_t_4;
- PyObject *(*__pyx_t_5)(PyObject *);
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ Py_ssize_t __pyx_t_3;
+ PyObject *(*__pyx_t_4)(PyObject *);
+ PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- PyObject *(*__pyx_t_10)(PyObject *);
+ PyObject *(*__pyx_t_9)(PyObject *);
+ int64 __pyx_t_10;
int64 __pyx_t_11;
- int64 __pyx_t_12;
- __pyx_t_10cpywrapfst_LabelPair __pyx_t_13;
- int __pyx_t_14;
+ __pyx_t_10cpywrapfst_LabelPair __pyx_t_12;
+ int __pyx_t_13;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_relabel_pairs", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":2449
- * cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:
- * cdef unique_ptr[vector[fst.LabelPair]] _ipairs
- * _ipairs.reset(new vector[fst.LabelPair]()) # <<<<<<<<<<<<<<
- * cdef unique_ptr[vector[fst.LabelPair]] _opairs
- * _opairs.reset(new vector[fst.LabelPair]())
- */
- try {
- __pyx_t_1 = new std::vector<__pyx_t_10cpywrapfst_LabelPair> ();
- } catch(...) {
- __Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2449, __pyx_L1_error)
- }
- __pyx_v__ipairs.reset(__pyx_t_1);
-
- /* "pywrapfst.pyx":2451
- * _ipairs.reset(new vector[fst.LabelPair]())
- * cdef unique_ptr[vector[fst.LabelPair]] _opairs
- * _opairs.reset(new vector[fst.LabelPair]()) # <<<<<<<<<<<<<<
- * cdef int64 before
- * cdef int64 after
- */
- try {
- __pyx_t_1 = new std::vector<__pyx_t_10cpywrapfst_LabelPair> ();
- } catch(...) {
- __Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2451, __pyx_L1_error)
- }
- __pyx_v__opairs.reset(__pyx_t_1);
-
- /* "pywrapfst.pyx":2454
- * cdef int64 before
- * cdef int64 after
+ /* "pywrapfst.pyx":2484
+ * cdef vector[fst.LabelPair] _ipairs
+ * cdef vector[fst.LabelPair] _opairs
* if ipairs: # <<<<<<<<<<<<<<
* for (before, after) in ipairs:
- * _ipairs.get().push_back(fst.LabelPair(before, after))
+ * _ipairs.push_back(fst.LabelPair(before, after))
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2454, __pyx_L1_error)
- if (__pyx_t_2) {
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2484, __pyx_L1_error)
+ if (__pyx_t_1) {
- /* "pywrapfst.pyx":2455
- * cdef int64 after
+ /* "pywrapfst.pyx":2485
+ * cdef vector[fst.LabelPair] _opairs
* if ipairs:
* for (before, after) in ipairs: # <<<<<<<<<<<<<<
- * _ipairs.get().push_back(fst.LabelPair(before, after))
+ * _ipairs.push_back(fst.LabelPair(before, after))
* if opairs:
*/
if (likely(PyList_CheckExact(__pyx_v_ipairs)) || PyTuple_CheckExact(__pyx_v_ipairs)) {
- __pyx_t_3 = __pyx_v_ipairs; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
- __pyx_t_5 = NULL;
+ __pyx_t_2 = __pyx_v_ipairs; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+ __pyx_t_4 = NULL;
} else {
- __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ipairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2455, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2455, __pyx_L1_error)
+ __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_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)
}
for (;;) {
- if (likely(!__pyx_t_5)) {
- if (likely(PyList_CheckExact(__pyx_t_3))) {
- if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
+ if (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_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2455, __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, 2485, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2455, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __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_GOTREF(__pyx_t_5);
#endif
} else {
- if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2455, __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, 2485, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2455, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __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_GOTREF(__pyx_t_5);
#endif
}
} else {
- __pyx_t_6 = __pyx_t_5(__pyx_t_3);
- if (unlikely(!__pyx_t_6)) {
+ __pyx_t_5 = __pyx_t_4(__pyx_t_2);
+ if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2455, __pyx_L1_error)
+ else __PYX_ERR(0, 2485, __pyx_L1_error)
}
break;
}
- __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_5);
}
- if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
- PyObject* sequence = __pyx_t_6;
+ if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+ PyObject* sequence = __pyx_t_5;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 2455, __pyx_L1_error)
+ __PYX_ERR(0, 2485, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
} else {
- __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_8 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
}
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_8);
#else
- __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2455, __pyx_L1_error)
+ __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2485, __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_GOTREF(__pyx_t_7);
- __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2455, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
#endif
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2455, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
- index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
+ __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2485, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2455, __pyx_L1_error)
- __pyx_t_10 = NULL;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
+ index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
+ __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)
+ __pyx_t_9 = NULL;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L7_unpacking_done;
__pyx_L6_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_10 = NULL;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 2455, __pyx_L1_error)
+ __PYX_ERR(0, 2485, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
- __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2455, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2455, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_before = __pyx_t_11;
- __pyx_v_after = __pyx_t_12;
+ __Pyx_XDECREF_SET(__pyx_v_before, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_after, __pyx_t_7);
+ __pyx_t_7 = 0;
- /* "pywrapfst.pyx":2456
+ /* "pywrapfst.pyx":2486
* if ipairs:
* for (before, after) in ipairs:
- * _ipairs.get().push_back(fst.LabelPair(before, after)) # <<<<<<<<<<<<<<
+ * _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)
try {
- __pyx_t_13 = __pyx_t_10cpywrapfst_LabelPair(__pyx_v_before, __pyx_v_after);
+ __pyx_t_12 = __pyx_t_10cpywrapfst_LabelPair(__pyx_t_10, __pyx_t_11);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2456, __pyx_L1_error)
+ __PYX_ERR(0, 2486, __pyx_L1_error)
}
try {
- __pyx_v__ipairs.get()->push_back(__pyx_t_13);
+ __pyx_v__ipairs.push_back(__pyx_t_12);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2456, __pyx_L1_error)
+ __PYX_ERR(0, 2486, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2455
- * cdef int64 after
+ /* "pywrapfst.pyx":2485
+ * cdef vector[fst.LabelPair] _opairs
* if ipairs:
* for (before, after) in ipairs: # <<<<<<<<<<<<<<
- * _ipairs.get().push_back(fst.LabelPair(before, after))
+ * _ipairs.push_back(fst.LabelPair(before, after))
* if opairs:
*/
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2454
- * cdef int64 before
- * cdef int64 after
+ /* "pywrapfst.pyx":2484
+ * cdef vector[fst.LabelPair] _ipairs
+ * cdef vector[fst.LabelPair] _opairs
* if ipairs: # <<<<<<<<<<<<<<
* for (before, after) in ipairs:
- * _ipairs.get().push_back(fst.LabelPair(before, after))
+ * _ipairs.push_back(fst.LabelPair(before, after))
*/
}
- /* "pywrapfst.pyx":2457
+ /* "pywrapfst.pyx":2487
* for (before, after) in ipairs:
- * _ipairs.get().push_back(fst.LabelPair(before, after))
+ * _ipairs.push_back(fst.LabelPair(before, after))
* if opairs: # <<<<<<<<<<<<<<
* for (before, after) in opairs:
- * _opairs.get().push_back(fst.LabelPair(before, after))
+ * _opairs.push_back(fst.LabelPair(before, after))
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2457, __pyx_L1_error)
- if (__pyx_t_2) {
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2487, __pyx_L1_error)
+ if (__pyx_t_1) {
- /* "pywrapfst.pyx":2458
- * _ipairs.get().push_back(fst.LabelPair(before, after))
+ /* "pywrapfst.pyx":2488
+ * _ipairs.push_back(fst.LabelPair(before, after))
* if opairs:
* for (before, after) in opairs: # <<<<<<<<<<<<<<
- * _opairs.get().push_back(fst.LabelPair(before, after))
- * if _ipairs.get().empty() and _opairs.get().empty():
+ * _opairs.push_back(fst.LabelPair(before, after))
+ * if _ipairs.empty() and _opairs.empty():
*/
if (likely(PyList_CheckExact(__pyx_v_opairs)) || PyTuple_CheckExact(__pyx_v_opairs)) {
- __pyx_t_3 = __pyx_v_opairs; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
- __pyx_t_5 = NULL;
+ __pyx_t_2 = __pyx_v_opairs; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+ __pyx_t_4 = NULL;
} else {
- __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_opairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2458, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2458, __pyx_L1_error)
+ __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_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)
}
for (;;) {
- if (likely(!__pyx_t_5)) {
- if (likely(PyList_CheckExact(__pyx_t_3))) {
- if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
+ if (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_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2458, __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, 2488, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2458, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __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_GOTREF(__pyx_t_5);
#endif
} else {
- if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2458, __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, 2488, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2458, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __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_GOTREF(__pyx_t_5);
#endif
}
} else {
- __pyx_t_6 = __pyx_t_5(__pyx_t_3);
- if (unlikely(!__pyx_t_6)) {
+ __pyx_t_5 = __pyx_t_4(__pyx_t_2);
+ if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2458, __pyx_L1_error)
+ else __PYX_ERR(0, 2488, __pyx_L1_error)
}
break;
}
- __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_5);
}
- if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
- PyObject* sequence = __pyx_t_6;
+ if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+ PyObject* sequence = __pyx_t_5;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 2458, __pyx_L1_error)
+ __PYX_ERR(0, 2488, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
} else {
- __pyx_t_8 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
}
- __Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_6);
#else
- __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2458, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2458, __pyx_L1_error)
+ __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2488, __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_GOTREF(__pyx_t_6);
#endif
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2458, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
- index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L11_unpacking_failed;
+ __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2488, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
+ index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2458, __pyx_L1_error)
- __pyx_t_10 = NULL;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ 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)
+ __pyx_t_9 = NULL;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L12_unpacking_done;
__pyx_L11_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_10 = NULL;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 2458, __pyx_L1_error)
+ __PYX_ERR(0, 2488, __pyx_L1_error)
__pyx_L12_unpacking_done:;
}
- __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2458, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2458, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_before = __pyx_t_12;
- __pyx_v_after = __pyx_t_11;
+ __Pyx_XDECREF_SET(__pyx_v_before, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_after, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "pywrapfst.pyx":2459
+ /* "pywrapfst.pyx":2489
* if opairs:
* for (before, after) in opairs:
- * _opairs.get().push_back(fst.LabelPair(before, after)) # <<<<<<<<<<<<<<
- * if _ipairs.get().empty() and _opairs.get().empty():
+ * _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)
try {
- __pyx_t_13 = __pyx_t_10cpywrapfst_LabelPair(__pyx_v_before, __pyx_v_after);
+ __pyx_t_12 = __pyx_t_10cpywrapfst_LabelPair(__pyx_t_11, __pyx_t_10);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2459, __pyx_L1_error)
+ __PYX_ERR(0, 2489, __pyx_L1_error)
}
try {
- __pyx_v__opairs.get()->push_back(__pyx_t_13);
+ __pyx_v__opairs.push_back(__pyx_t_12);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2459, __pyx_L1_error)
+ __PYX_ERR(0, 2489, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2458
- * _ipairs.get().push_back(fst.LabelPair(before, after))
+ /* "pywrapfst.pyx":2488
+ * _ipairs.push_back(fst.LabelPair(before, after))
* if opairs:
* for (before, after) in opairs: # <<<<<<<<<<<<<<
- * _opairs.get().push_back(fst.LabelPair(before, after))
- * if _ipairs.get().empty() and _opairs.get().empty():
+ * _opairs.push_back(fst.LabelPair(before, after))
+ * if _ipairs.empty() and _opairs.empty():
*/
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2457
+ /* "pywrapfst.pyx":2487
* for (before, after) in ipairs:
- * _ipairs.get().push_back(fst.LabelPair(before, after))
+ * _ipairs.push_back(fst.LabelPair(before, after))
* if opairs: # <<<<<<<<<<<<<<
* for (before, after) in opairs:
- * _opairs.get().push_back(fst.LabelPair(before, after))
+ * _opairs.push_back(fst.LabelPair(before, after))
*/
}
- /* "pywrapfst.pyx":2460
+ /* "pywrapfst.pyx":2490
* for (before, after) in opairs:
- * _opairs.get().push_back(fst.LabelPair(before, after))
- * if _ipairs.get().empty() and _opairs.get().empty(): # <<<<<<<<<<<<<<
+ * _opairs.push_back(fst.LabelPair(before, after))
+ * if _ipairs.empty() and _opairs.empty(): # <<<<<<<<<<<<<<
* raise FstArgError("No relabeling pairs specified")
- * fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
+ * fst.Relabel(self._mfst.get(), _ipairs, _opairs)
*/
- __pyx_t_14 = (__pyx_v__ipairs.get()->empty() != 0);
- if (__pyx_t_14) {
+ __pyx_t_13 = (__pyx_v__ipairs.empty() != 0);
+ if (__pyx_t_13) {
} else {
- __pyx_t_2 = __pyx_t_14;
+ __pyx_t_1 = __pyx_t_13;
goto __pyx_L14_bool_binop_done;
}
- __pyx_t_14 = (__pyx_v__opairs.get()->empty() != 0);
- __pyx_t_2 = __pyx_t_14;
+ __pyx_t_13 = (__pyx_v__opairs.empty() != 0);
+ __pyx_t_1 = __pyx_t_13;
__pyx_L14_bool_binop_done:;
- if (unlikely(__pyx_t_2)) {
+ if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2461
- * _opairs.get().push_back(fst.LabelPair(before, after))
- * if _ipairs.get().empty() and _opairs.get().empty():
+ /* "pywrapfst.pyx":2491
+ * _opairs.push_back(fst.LabelPair(before, after))
+ * if _ipairs.empty() and _opairs.empty():
* raise FstArgError("No relabeling pairs specified") # <<<<<<<<<<<<<<
- * fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
+ * fst.Relabel(self._mfst.get(), _ipairs, _opairs)
* self._check_mutating_imethod()
*/
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2461, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_7);
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2491, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = NULL;
+ 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_6, function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_kp_u_No_relabeling_pairs_specified) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_u_No_relabeling_pairs_specified);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2461, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2461, __pyx_L1_error)
+ __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)
+ __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)
- /* "pywrapfst.pyx":2460
+ /* "pywrapfst.pyx":2490
* for (before, after) in opairs:
- * _opairs.get().push_back(fst.LabelPair(before, after))
- * if _ipairs.get().empty() and _opairs.get().empty(): # <<<<<<<<<<<<<<
+ * _opairs.push_back(fst.LabelPair(before, after))
+ * if _ipairs.empty() and _opairs.empty(): # <<<<<<<<<<<<<<
* raise FstArgError("No relabeling pairs specified")
- * fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
+ * fst.Relabel(self._mfst.get(), _ipairs, _opairs)
*/
}
- /* "pywrapfst.pyx":2462
- * if _ipairs.get().empty() and _opairs.get().empty():
+ /* "pywrapfst.pyx":2492
+ * if _ipairs.empty() and _opairs.empty():
* raise FstArgError("No relabeling pairs specified")
- * fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs)) # <<<<<<<<<<<<<<
+ * 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'", "_mfst");
- __PYX_ERR(0, 2462, __pyx_L1_error)
+ __PYX_ERR(0, 2492, __pyx_L1_error)
}
- fst::script::Relabel(__pyx_v_self->_mfst.get(), (*__pyx_v__ipairs), (*__pyx_v__opairs));
+ fst::script::Relabel(__pyx_v_self->_mfst.get(), __pyx_v__ipairs, __pyx_v__opairs);
- /* "pywrapfst.pyx":2463
+ /* "pywrapfst.pyx":2493
* raise FstArgError("No relabeling pairs specified")
- * fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
+ * fst.Relabel(self._mfst.get(), _ipairs, _opairs)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*
* def relabel_pairs(self, ipairs=None, opairs=None):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2463, __pyx_L1_error)
+ __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, 2463, __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)
- /* "pywrapfst.pyx":2447
+ /* "pywrapfst.pyx":2481
* return self
*
* cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *: # <<<<<<<<<<<<<<
- * cdef unique_ptr[vector[fst.LabelPair]] _ipairs
- * _ipairs.reset(new vector[fst.LabelPair]())
+ * cdef vector[fst.LabelPair] _ipairs
+ * cdef vector[fst.LabelPair] _opairs
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("pywrapfst.MutableFst._relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_before);
+ __Pyx_XDECREF(__pyx_v_after);
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2465
+/* "pywrapfst.pyx":2495
* self._check_mutating_imethod()
*
* def relabel_pairs(self, ipairs=None, opairs=None): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_41relabel_pairs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ipairs = 0;
PyObject *__pyx_v_opairs = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("relabel_pairs (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_pairs") < 0)) __PYX_ERR(0, 2465, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_pairs") < 0)) __PYX_ERR(0, 2495, __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, 2465, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("relabel_pairs", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2495, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_pairs __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("relabel_pairs", 0);
- /* "pywrapfst.pyx":2485
+ /* "pywrapfst.pyx":2515
* 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, 2485, __pyx_L1_error)
+ __PYX_ERR(0, 2515, __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, 2485, __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, 2515, __pyx_L1_error)
- /* "pywrapfst.pyx":2486
+ /* "pywrapfst.pyx":2516
* """
* self._relabel_pairs(ipairs, opairs)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2465
+ /* "pywrapfst.pyx":2495
* self._check_mutating_imethod()
*
* def relabel_pairs(self, ipairs=None, opairs=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2488
+/* "pywrapfst.pyx":2518
* return self
*
* cdef void _relabel_tables(self, # <<<<<<<<<<<<<<
- * _SymbolTable old_isymbols=None,
- * _SymbolTable new_isymbols=None,
+ * SymbolTableView old_isymbols=None,
+ * SymbolTableView new_isymbols=None,
*/
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":2489
+ /* "pywrapfst.pyx":2519
*
* cdef void _relabel_tables(self,
- * _SymbolTable old_isymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable new_isymbols=None,
- * unknown_isymbol=b"",
+ * SymbolTableView old_isymbols=None, # <<<<<<<<<<<<<<
+ * SymbolTableView new_isymbols=None,
+ * unknown_isymbol="",
*/
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":2490
+ /* "pywrapfst.pyx":2520
* cdef void _relabel_tables(self,
- * _SymbolTable old_isymbols=None,
- * _SymbolTable new_isymbols=None, # <<<<<<<<<<<<<<
- * unknown_isymbol=b"",
+ * SymbolTableView old_isymbols=None,
+ * SymbolTableView new_isymbols=None, # <<<<<<<<<<<<<<
+ * unknown_isymbol="",
* bool attach_new_isymbols=True,
*/
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- PyObject *__pyx_v_unknown_isymbol = ((PyObject *)__pyx_kp_b__8);
+ 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":2492
- * _SymbolTable new_isymbols=None,
- * unknown_isymbol=b"",
+ /* "pywrapfst.pyx":2522
+ * SymbolTableView new_isymbols=None,
+ * unknown_isymbol="",
* bool attach_new_isymbols=True, # <<<<<<<<<<<<<<
- * _SymbolTable old_osymbols=None,
- * _SymbolTable new_osymbols=None,
+ * SymbolTableView old_osymbols=None,
+ * SymbolTableView new_osymbols=None,
*/
bool __pyx_v_attach_new_isymbols = ((bool)1);
- /* "pywrapfst.pyx":2493
- * unknown_isymbol=b"",
+ /* "pywrapfst.pyx":2523
+ * unknown_isymbol="",
* bool attach_new_isymbols=True,
- * _SymbolTable old_osymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable new_osymbols=None,
- * unknown_osymbol=b"",
+ * SymbolTableView old_osymbols=None, # <<<<<<<<<<<<<<
+ * SymbolTableView new_osymbols=None,
+ * unknown_osymbol="",
*/
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":2494
+ /* "pywrapfst.pyx":2524
* bool attach_new_isymbols=True,
- * _SymbolTable old_osymbols=None,
- * _SymbolTable new_osymbols=None, # <<<<<<<<<<<<<<
- * unknown_osymbol=b"",
+ * SymbolTableView old_osymbols=None,
+ * SymbolTableView new_osymbols=None, # <<<<<<<<<<<<<<
+ * unknown_osymbol="",
* bool attach_new_osymbols=True) except *:
*/
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- PyObject *__pyx_v_unknown_osymbol = ((PyObject *)__pyx_kp_b__8);
+ 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":2496
- * _SymbolTable new_osymbols=None,
- * unknown_osymbol=b"",
+ /* "pywrapfst.pyx":2526
+ * SymbolTableView new_osymbols=None,
+ * unknown_osymbol="",
* bool attach_new_osymbols=True) except *: # <<<<<<<<<<<<<<
* if new_isymbols is None and new_osymbols is None:
* raise FstArgError("No new SymbolTables specified")
fst::SymbolTable const *__pyx_t_7;
std::string __pyx_t_8;
std::string __pyx_t_9;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_relabel_tables", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":2497
- * unknown_osymbol=b"",
+ /* "pywrapfst.pyx":2527
+ * unknown_osymbol="",
* bool attach_new_osymbols=True) except *:
* if new_isymbols is None and new_osymbols is None: # <<<<<<<<<<<<<<
* raise FstArgError("No new SymbolTables specified")
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2498
+ /* "pywrapfst.pyx":2528
* 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, 2498, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2528, __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, 2498, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2528, __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, 2498, __pyx_L1_error)
+ __PYX_ERR(0, 2528, __pyx_L1_error)
- /* "pywrapfst.pyx":2497
- * unknown_osymbol=b"",
+ /* "pywrapfst.pyx":2527
+ * unknown_osymbol="",
* bool attach_new_osymbols=True) except *:
* if new_isymbols is None and new_osymbols is None: # <<<<<<<<<<<<<<
* raise FstArgError("No new SymbolTables specified")
*/
}
- /* "pywrapfst.pyx":2499
+ /* "pywrapfst.pyx":2529
* 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, 2499, __pyx_L1_error)
+ __PYX_ERR(0, 2529, __pyx_L1_error)
}
__pyx_v__old_isymbols = __pyx_v_self->__pyx_base._fst.get()->InputSymbols();
- /* "pywrapfst.pyx":2500
+ /* "pywrapfst.pyx":2530
* 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":2501
+ /* "pywrapfst.pyx":2531
* 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, 2501, __pyx_L1_error)
+ __PYX_ERR(0, 2531, __pyx_L1_error)
}
- __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_old_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_old_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2501, __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_v__old_isymbols = __pyx_t_7;
- /* "pywrapfst.pyx":2500
+ /* "pywrapfst.pyx":2530
* raise FstArgError("No new SymbolTables specified")
* cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
* if old_isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2502
+ /* "pywrapfst.pyx":2532
* 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, 2502, __pyx_L1_error)
+ __PYX_ERR(0, 2532, __pyx_L1_error)
}
__pyx_v__old_osymbols = __pyx_v_self->__pyx_base._fst.get()->OutputSymbols();
- /* "pywrapfst.pyx":2503
+ /* "pywrapfst.pyx":2533
* _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":2504
+ /* "pywrapfst.pyx":2534
* 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, 2504, __pyx_L1_error)
+ __PYX_ERR(0, 2534, __pyx_L1_error)
}
- __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_old_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_old_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2504, __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_v__old_osymbols = __pyx_t_7;
- /* "pywrapfst.pyx":2503
+ /* "pywrapfst.pyx":2533
* _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":2505
+ /* "pywrapfst.pyx":2535
* 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":2506
+ /* "pywrapfst.pyx":2536
* _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":2507
+ /* "pywrapfst.pyx":2537
* 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, 2507, __pyx_L1_error)
+ __PYX_ERR(0, 2537, __pyx_L1_error)
}
- __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_new_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_new_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2507, __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_v__new_isymbols = __pyx_t_7;
- /* "pywrapfst.pyx":2506
+ /* "pywrapfst.pyx":2536
* _old_osymbols = old_osymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_new_isymbols = NULL
* if new_isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2508
+ /* "pywrapfst.pyx":2538
* 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":2509
+ /* "pywrapfst.pyx":2539
* _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":2510
+ /* "pywrapfst.pyx":2540
* 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, 2510, __pyx_L1_error)
+ __PYX_ERR(0, 2540, __pyx_L1_error)
}
- __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_new_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_new_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2510, __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_v__new_osymbols = __pyx_t_7;
- /* "pywrapfst.pyx":2509
+ /* "pywrapfst.pyx":2539
* _new_isymbols = new_isymbols._raw_ptr_or_raise()
* cdef const fst.SymbolTable *_new_osymbols = NULL
* if new_osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2511
+ /* "pywrapfst.pyx":2541
* 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, 2511, __pyx_L1_error)
+ __PYX_ERR(0, 2541, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2514
+ /* "pywrapfst.pyx":2544
* _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, 2514, __pyx_L1_error)
+ __pyx_t_8 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_isymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2544, __pyx_L1_error)
- /* "pywrapfst.pyx":2518
+ /* "pywrapfst.pyx":2548
* _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, 2518, __pyx_L1_error)
+ __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_osymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2548, __pyx_L1_error)
- /* "pywrapfst.pyx":2511
+ /* "pywrapfst.pyx":2541
* 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":2520
+ /* "pywrapfst.pyx":2550
* 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, 2520, __pyx_L1_error)
+ __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, 2520, __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)
- /* "pywrapfst.pyx":2488
+ /* "pywrapfst.pyx":2518
* return self
*
* cdef void _relabel_tables(self, # <<<<<<<<<<<<<<
- * _SymbolTable old_isymbols=None,
- * _SymbolTable new_isymbols=None,
+ * SymbolTableView old_isymbols=None,
+ * SymbolTableView new_isymbols=None,
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2522
+/* "pywrapfst.pyx":2552
* self._check_mutating_imethod()
*
* def relabel_tables(self, # <<<<<<<<<<<<<<
- * _SymbolTable old_isymbols=None,
- * _SymbolTable new_isymbols=None,
+ * SymbolTableView old_isymbols=None,
+ * SymbolTableView new_isymbols=None,
*/
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_43relabel_tables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_10MutableFst_42relabel_tables[] = "\n relabel_tables(self, old_isymbols=None, new_isymbols=None,\n unknown_isymbol=\"\", attach_new_isymbols=True,\n old_osymbols=None, new_osymbols=None,\n unknown_osymbol=\"\", attach_new_osymbols=True)\n\n Replaces input and/or output labels using SymbolTables.\n\n This operation destructively relabels the input and/or output labels of the\n FST using user-specified symbol tables; omitted symbols are identity-mapped.\n\n Args:\n old_isymbols: The old SymbolTable for input labels, defaulting to the\n FST's input symbol table.\n new_isymbols: A SymbolTable used to relabel the input labels\n unknown_isymbol: Input symbol to use to relabel OOVs (if empty,\n OOVs raise an exception)\n attach_new_isymbols: Should new_isymbols be made the FST's input symbol\n table?\n old_osymbols: The old SymbolTable for output labels, defaulting to the\n FST's output symbol table.\n new_osymbols: A SymbolTable used to relabel the output labels.\n unknown_osymbol: Outnput symbol to use to relabel OOVs (if empty,\n OOVs raise an exception)\n attach_new_isymbols: Should new_osymbols be made the FST's output symbol\n table?\n\n Returns:\n self.\n\n Raises:\n FstArgError: No SymbolTable specified.\n ";
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_43relabel_tables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols = 0;
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_isymbols = 0;
PyObject *__pyx_v_unknown_isymbol = 0;
bool __pyx_v_attach_new_isymbols;
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols = 0;
- struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols = 0;
+ struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_osymbols = 0;
PyObject *__pyx_v_unknown_osymbol = 0;
bool __pyx_v_attach_new_osymbols;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("relabel_tables (wrapper)", 0);
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old_isymbols,&__pyx_n_s_new_isymbols,&__pyx_n_s_unknown_isymbol,&__pyx_n_s_attach_new_isymbols,&__pyx_n_s_old_osymbols,&__pyx_n_s_new_osymbols,&__pyx_n_s_unknown_osymbol,&__pyx_n_s_attach_new_osymbols,0};
PyObject* values[8] = {0,0,0,0,0,0,0,0};
- /* "pywrapfst.pyx":2523
+ /* "pywrapfst.pyx":2553
*
* def relabel_tables(self,
- * _SymbolTable old_isymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable new_isymbols=None,
- * unknown_isymbol=b"",
+ * SymbolTableView old_isymbols=None, # <<<<<<<<<<<<<<
+ * SymbolTableView new_isymbols=None,
+ * unknown_isymbol="",
*/
- values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+ values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":2524
+ /* "pywrapfst.pyx":2554
* def relabel_tables(self,
- * _SymbolTable old_isymbols=None,
- * _SymbolTable new_isymbols=None, # <<<<<<<<<<<<<<
- * unknown_isymbol=b"",
+ * SymbolTableView old_isymbols=None,
+ * SymbolTableView new_isymbols=None, # <<<<<<<<<<<<<<
+ * unknown_isymbol="",
* bool attach_new_isymbols=True,
*/
- values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- values[2] = ((PyObject *)__pyx_kp_b__8);
+ values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
+ values[2] = ((PyObject *)__pyx_kp_u__11);
- /* "pywrapfst.pyx":2527
- * unknown_isymbol=b"",
+ /* "pywrapfst.pyx":2557
+ * unknown_isymbol="",
* bool attach_new_isymbols=True,
- * _SymbolTable old_osymbols=None, # <<<<<<<<<<<<<<
- * _SymbolTable new_osymbols=None,
- * unknown_osymbol=b"",
+ * SymbolTableView old_osymbols=None, # <<<<<<<<<<<<<<
+ * SymbolTableView new_osymbols=None,
+ * unknown_osymbol="",
*/
- values[4] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+ values[4] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
- /* "pywrapfst.pyx":2528
+ /* "pywrapfst.pyx":2558
* bool attach_new_isymbols=True,
- * _SymbolTable old_osymbols=None,
- * _SymbolTable new_osymbols=None, # <<<<<<<<<<<<<<
- * unknown_osymbol=b"",
+ * SymbolTableView old_osymbols=None,
+ * SymbolTableView new_osymbols=None, # <<<<<<<<<<<<<<
+ * unknown_osymbol="",
* bool attach_new_osymbols=True):
*/
- values[5] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
- values[6] = ((PyObject *)__pyx_kp_b__8);
+ values[5] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
+ values[6] = ((PyObject *)__pyx_kp_u__11);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_tables") < 0)) __PYX_ERR(0, 2522, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_tables") < 0)) __PYX_ERR(0, 2552, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_old_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[0]);
- __pyx_v_new_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[1]);
+ __pyx_v_old_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
+ __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, 2526, __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, 2556, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2526
- * _SymbolTable new_isymbols=None,
- * unknown_isymbol=b"",
+ /* "pywrapfst.pyx":2556
+ * SymbolTableView new_isymbols=None,
+ * unknown_isymbol="",
* bool attach_new_isymbols=True, # <<<<<<<<<<<<<<
- * _SymbolTable old_osymbols=None,
- * _SymbolTable new_osymbols=None,
+ * SymbolTableView old_osymbols=None,
+ * SymbolTableView new_osymbols=None,
*/
__pyx_v_attach_new_isymbols = ((bool)1);
}
- __pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[4]);
- __pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[5]);
+ __pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[4]);
+ __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, 2530, __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, 2560, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2530
- * _SymbolTable new_osymbols=None,
- * unknown_osymbol=b"",
+ /* "pywrapfst.pyx":2560
+ * SymbolTableView new_osymbols=None,
+ * unknown_osymbol="",
* bool attach_new_osymbols=True): # <<<<<<<<<<<<<<
* """
* relabel_tables(self, old_isymbols=None, new_isymbols=None,
}
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, 2522, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("relabel_tables", 0, 0, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2552, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.relabel_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_isymbols", 0))) __PYX_ERR(0, 2523, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_isymbols", 0))) __PYX_ERR(0, 2524, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_osymbols", 0))) __PYX_ERR(0, 2527, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_osymbols", 0))) __PYX_ERR(0, 2528, __pyx_L1_error)
+ 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)
__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":2522
+ /* "pywrapfst.pyx":2552
* self._check_mutating_imethod()
*
* def relabel_tables(self, # <<<<<<<<<<<<<<
- * _SymbolTable old_isymbols=None,
- * _SymbolTable new_isymbols=None,
+ * SymbolTableView old_isymbols=None,
+ * SymbolTableView new_isymbols=None,
*/
/* function exit code */
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_10MutableFst_42relabel_tables(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols) {
+static PyObject *__pyx_pf_9pywrapfst_10MutableFst_42relabel_tables(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_tables __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("relabel_tables", 0);
- /* "pywrapfst.pyx":2564
+ /* "pywrapfst.pyx":2594
* 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, 2564, __pyx_L1_error)
+ __PYX_ERR(0, 2594, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2571
+ /* "pywrapfst.pyx":2601
* 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, 2564, __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, 2594, __pyx_L1_error)
- /* "pywrapfst.pyx":2572
+ /* "pywrapfst.pyx":2602
* unknown_osymbol,
* attach_new_osymbols)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2522
+ /* "pywrapfst.pyx":2552
* self._check_mutating_imethod()
*
* def relabel_tables(self, # <<<<<<<<<<<<<<
- * _SymbolTable old_isymbols=None,
- * _SymbolTable new_isymbols=None,
+ * SymbolTableView old_isymbols=None,
+ * SymbolTableView new_isymbols=None,
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":2574
+/* "pywrapfst.pyx":2604
* return self
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_reserve_arcs", 0);
- /* "pywrapfst.pyx":2575
+ /* "pywrapfst.pyx":2605
*
* 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, 2575, __pyx_L1_error)
+ __PYX_ERR(0, 2605, __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":2576
+ /* "pywrapfst.pyx":2606
* 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, 2576, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __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, 2576, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2606, __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, 2576, __pyx_L1_error)
+ __PYX_ERR(0, 2606, __pyx_L1_error)
- /* "pywrapfst.pyx":2575
+ /* "pywrapfst.pyx":2605
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *:
* if not self._mfst.get().ReserveArcs(state, n): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2577
+ /* "pywrapfst.pyx":2607
* 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, 2577, __pyx_L1_error)
+ __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, 2577, __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)
- /* "pywrapfst.pyx":2574
+ /* "pywrapfst.pyx":2604
* return self
*
* cdef void _reserve_arcs(self, int64 state, size_t n) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2579
+/* "pywrapfst.pyx":2609
* self._check_mutating_imethod()
*
* def reserve_arcs(self, int64 state, size_t n): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_45reserve_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int64 __pyx_v_state;
size_t __pyx_v_n;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reserve_arcs (wrapper)", 0);
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2579, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2609, __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, 2579, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reserve_arcs") < 0)) __PYX_ERR(0, 2609, __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, 2579, __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, 2579, __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, 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)
}
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, 2579, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2609, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.reserve_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_44reserve_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, size_t __pyx_v_n) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reserve_arcs", 0);
- /* "pywrapfst.pyx":2595
+ /* "pywrapfst.pyx":2625
* 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, 2595, __pyx_L1_error)
+ __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, 2595, __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)
- /* "pywrapfst.pyx":2596
+ /* "pywrapfst.pyx":2626
* """
* self._reserve_arcs(state, n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2579
+ /* "pywrapfst.pyx":2609
* self._check_mutating_imethod()
*
* def reserve_arcs(self, int64 state, size_t n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2598
+/* "pywrapfst.pyx":2628
* return self
*
* cdef void _reserve_states(self, int64 n): # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_10MutableFst__reserve_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_n) {
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_reserve_states", 0);
- /* "pywrapfst.pyx":2599
+ /* "pywrapfst.pyx":2629
*
* 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, 2599, __pyx_L1_error)
+ __PYX_ERR(0, 2629, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->ReserveStates(__pyx_v_n);
- /* "pywrapfst.pyx":2598
+ /* "pywrapfst.pyx":2628
* return self
*
* cdef void _reserve_states(self, int64 n): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2601
+/* "pywrapfst.pyx":2631
* self._mfst.get().ReserveStates(n)
*
* def reserve_states(self, int64 n): # <<<<<<<<<<<<<<
static char __pyx_doc_9pywrapfst_10MutableFst_46reserve_states[] = "\n reserve_states(self, n)\n\n Reserve n states (best effort).\n\n Args:\n n: The number of states to reserve.\n\n Returns:\n self.\n ";
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_47reserve_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
int64 __pyx_v_n;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reserve_states (wrapper)", 0);
assert(__pyx_arg_n); {
- __pyx_v_n = __Pyx_PyInt_As_int64_t(__pyx_arg_n); if (unlikely((__pyx_v_n == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2601, __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, 2631, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_46reserve_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_n) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reserve_states", 0);
- /* "pywrapfst.pyx":2613
+ /* "pywrapfst.pyx":2643
* 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, 2613, __pyx_L1_error)
+ __PYX_ERR(0, 2643, __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":2614
+ /* "pywrapfst.pyx":2644
* """
* self._reserve_states(n)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2601
+ /* "pywrapfst.pyx":2631
* self._mfst.get().ReserveStates(n)
*
* def reserve_states(self, int64 n): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2616
+/* "pywrapfst.pyx":2646
* return self
*
* cdef void _reweight(self, potentials, bool to_final=False) except *: # <<<<<<<<<<<<<<
- * cdef unique_ptr[vector[fst.WeightClass]] _potentials
- * _potentials.reset(new vector[fst.WeightClass]())
+ * cdef string _weight_type = self.weight_type()
+ * cdef vector[fst.WeightClass] _potentials
*/
static void __pyx_f_9pywrapfst_10MutableFst__reweight(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, struct __pyx_opt_args_9pywrapfst_10MutableFst__reweight *__pyx_optional_args) {
bool __pyx_v_to_final = ((bool)0);
- std::unique_ptr<std::vector<fst::script::WeightClass> > __pyx_v__potentials;
- CYTHON_UNUSED std::string __pyx_v_weight_type;
+ std::string __pyx_v__weight_type;
+ std::vector<fst::script::WeightClass> __pyx_v__potentials;
PyObject *__pyx_v_weight = NULL;
__Pyx_RefNannyDeclarations
- std::vector<fst::script::WeightClass> *__pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t __pyx_t_3;
- PyObject *(*__pyx_t_4)(PyObject *);
- PyObject *__pyx_t_5 = NULL;
- fst::script::WeightClass __pyx_t_6;
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ PyObject *(*__pyx_t_3)(PyObject *);
+ PyObject *__pyx_t_4 = NULL;
+ fst::script::WeightClass __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_reweight", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":2618
+ /* "pywrapfst.pyx":2647
+ *
* cdef void _reweight(self, potentials, bool to_final=False) except *:
- * cdef unique_ptr[vector[fst.WeightClass]] _potentials
- * _potentials.reset(new vector[fst.WeightClass]()) # <<<<<<<<<<<<<<
- * cdef string weight_type = self.weight_type()
+ * cdef string _weight_type = self.weight_type() # <<<<<<<<<<<<<<
+ * cdef vector[fst.WeightClass] _potentials
* for weight in potentials:
*/
- try {
- __pyx_t_1 = new std::vector<fst::script::WeightClass> ();
- } catch(...) {
- __Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2618, __pyx_L1_error)
- }
- __pyx_v__potentials.reset(__pyx_t_1);
-
- /* "pywrapfst.pyx":2619
- * cdef unique_ptr[vector[fst.WeightClass]] _potentials
- * _potentials.reset(new vector[fst.WeightClass]())
- * cdef string weight_type = self.weight_type() # <<<<<<<<<<<<<<
- * for weight in potentials:
- * _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),
- */
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 2619, __pyx_L1_error)
+ __PYX_ERR(0, 2647, __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);
+ __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":2620
- * _potentials.reset(new vector[fst.WeightClass]())
- * cdef string weight_type = self.weight_type()
+ /* "pywrapfst.pyx":2649
+ * cdef string _weight_type = self.weight_type()
+ * cdef vector[fst.WeightClass] _potentials
* for weight in potentials: # <<<<<<<<<<<<<<
- * _potentials.get().push_back(_get_WeightClass_or_One(self.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_2 = __pyx_v_potentials; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
- __pyx_t_4 = NULL;
+ __pyx_t_1 = __pyx_v_potentials; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+ __pyx_t_3 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_potentials); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2620, __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, 2620, __pyx_L1_error)
+ __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_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)
}
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 (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_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, 2620, __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, 2649, __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, 2620, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
+ __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_GOTREF(__pyx_t_4);
#endif
} else {
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) 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, 2620, __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, 2649, __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, 2620, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
+ __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_GOTREF(__pyx_t_4);
#endif
}
} else {
- __pyx_t_5 = __pyx_t_4(__pyx_t_2);
- if (unlikely(!__pyx_t_5)) {
+ __pyx_t_4 = __pyx_t_3(__pyx_t_1);
+ if (unlikely(!__pyx_t_4)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2620, __pyx_L1_error)
+ else __PYX_ERR(0, 2649, __pyx_L1_error)
}
break;
}
- __Pyx_GOTREF(__pyx_t_5);
- }
- __Pyx_XDECREF_SET(__pyx_v_weight, __pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "pywrapfst.pyx":2621
- * cdef string weight_type = self.weight_type()
- * for weight in potentials:
- * _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(), # <<<<<<<<<<<<<<
- * weight))
- * fst.Reweight(self._mfst.get(), deref(_potentials),
- */
- if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 2621, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
}
+ __Pyx_XDECREF_SET(__pyx_v_weight, __pyx_t_4);
+ __pyx_t_4 = 0;
- /* "pywrapfst.pyx":2622
- * for weight in potentials:
- * _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),
- * weight)) # <<<<<<<<<<<<<<
- * fst.Reweight(self._mfst.get(), deref(_potentials),
- * fst.GetReweightType(to_final))
- */
- __pyx_t_6 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2621, __pyx_L1_error)
-
- /* "pywrapfst.pyx":2621
- * cdef string weight_type = self.weight_type()
+ /* "pywrapfst.pyx":2650
+ * cdef vector[fst.WeightClass] _potentials
* for weight in potentials:
- * _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(), # <<<<<<<<<<<<<<
- * weight))
- * fst.Reweight(self._mfst.get(), deref(_potentials),
+ * _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)
try {
- __pyx_v__potentials.get()->push_back(__pyx_t_6);
+ __pyx_v__potentials.push_back(__pyx_t_5);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2621, __pyx_L1_error)
+ __PYX_ERR(0, 2650, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2620
- * _potentials.reset(new vector[fst.WeightClass]())
- * cdef string weight_type = self.weight_type()
+ /* "pywrapfst.pyx":2649
+ * cdef string _weight_type = self.weight_type()
+ * cdef vector[fst.WeightClass] _potentials
* for weight in potentials: # <<<<<<<<<<<<<<
- * _potentials.get().push_back(_get_WeightClass_or_One(self.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_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2623
- * _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),
- * weight))
- * fst.Reweight(self._mfst.get(), deref(_potentials), # <<<<<<<<<<<<<<
- * fst.GetReweightType(to_final))
+ /* "pywrapfst.pyx":2651
+ * for weight in potentials:
+ * _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, 2623, __pyx_L1_error)
+ __PYX_ERR(0, 2651, __pyx_L1_error)
}
+ fst::script::Reweight(__pyx_v_self->_mfst.get(), __pyx_v__potentials, fst::script::GetReweightType(__pyx_v_to_final));
- /* "pywrapfst.pyx":2624
- * weight))
- * fst.Reweight(self._mfst.get(), deref(_potentials),
- * fst.GetReweightType(to_final)) # <<<<<<<<<<<<<<
- * self._check_mutating_imethod()
- *
- */
- fst::script::Reweight(__pyx_v_self->_mfst.get(), (*__pyx_v__potentials), fst::script::GetReweightType(__pyx_v_to_final));
-
- /* "pywrapfst.pyx":2625
- * fst.Reweight(self._mfst.get(), deref(_potentials),
- * fst.GetReweightType(to_final))
+ /* "pywrapfst.pyx":2652
+ * _potentials.push_back(_get_WeightClass_or_One(_weight_type, weight))
+ * fst.Reweight(self._mfst.get(), _potentials, fst.GetReweightType(to_final))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*
* def reweight(self, potentials, bool to_final=False):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2625, __pyx_L1_error)
+ __PYX_ERR(0, 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, 2625, __pyx_L1_error)
+ ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2652, __pyx_L1_error)
- /* "pywrapfst.pyx":2616
+ /* "pywrapfst.pyx":2646
* return self
*
* cdef void _reweight(self, potentials, bool to_final=False) except *: # <<<<<<<<<<<<<<
- * cdef unique_ptr[vector[fst.WeightClass]] _potentials
- * _potentials.reset(new vector[fst.WeightClass]())
+ * cdef string _weight_type = self.weight_type()
+ * cdef vector[fst.WeightClass] _potentials
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("pywrapfst.MutableFst._reweight", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_weight);
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2627
+/* "pywrapfst.pyx":2654
* self._check_mutating_imethod()
*
* def reweight(self, potentials, bool to_final=False): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_49reweight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_potentials = 0;
bool __pyx_v_to_final;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reweight (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reweight") < 0)) __PYX_ERR(0, 2627, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reweight") < 0)) __PYX_ERR(0, 2654, __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, 2627, __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, 2654, __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, 2627, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reweight", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2654, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.reweight", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_10MutableFst__reweight __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reweight", 0);
- /* "pywrapfst.pyx":2649
+ /* "pywrapfst.pyx":2676
* 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, 2649, __pyx_L1_error)
+ __PYX_ERR(0, 2676, __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, 2649, __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, 2676, __pyx_L1_error)
- /* "pywrapfst.pyx":2650
+ /* "pywrapfst.pyx":2677
* """
* self._reweight(potentials, to_final)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2627
+ /* "pywrapfst.pyx":2654
* self._check_mutating_imethod()
*
* def reweight(self, potentials, bool to_final=False): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2652
+/* "pywrapfst.pyx":2679
* return self
*
* cdef void _rmepsilon(self, # <<<<<<<<<<<<<<
- * queue_type=b"auto",
+ * queue_type="auto",
* bool connect=True,
*/
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_b_auto);
+ PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":2654
+ /* "pywrapfst.pyx":2681
* cdef void _rmepsilon(self,
- * queue_type=b"auto",
+ * queue_type="auto",
* bool connect=True, # <<<<<<<<<<<<<<
* weight=None,
* int64 nstate=fst.kNoStateId,
*/
bool __pyx_v_connect = ((bool)1);
- /* "pywrapfst.pyx":2655
- * queue_type=b"auto",
+ /* "pywrapfst.pyx":2682
+ * queue_type="auto",
* bool connect=True,
* weight=None, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
* float delta=fst.kShortestDelta) except *:
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- int64 __pyx_v_nstate = __pyx_k__18;
- float __pyx_v_delta = __pyx_k__19;
- fst::script::WeightClass __pyx_v_wc;
- std::unique_ptr<fst::script::RmEpsilonOptions> __pyx_v_opts;
+ int64 __pyx_v_nstate = __pyx_k__20;
+ float __pyx_v_delta = __pyx_k__21;
+ fst::script::WeightClass __pyx_v__weight;
+ std::unique_ptr<fst::script::RmEpsilonOptions> __pyx_v__opts;
__Pyx_RefNannyDeclarations
fst::script::WeightClass __pyx_t_1;
std::string __pyx_t_2;
enum fst::QueueType __pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_rmepsilon", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":2658
+ /* "pywrapfst.pyx":2685
* int64 nstate=fst.kNoStateId,
* float delta=fst.kShortestDelta) except *:
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(), # <<<<<<<<<<<<<<
- * weight)
- * cdef unique_ptr[fst.RmEpsilonOptions] opts
+ * 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, 2658, __pyx_L1_error)
+ __PYX_ERR(0, 2685, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2659
+ /* "pywrapfst.pyx":2686
* float delta=fst.kShortestDelta) except *:
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
- * weight) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.RmEpsilonOptions] opts
- * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
- */
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2658, __pyx_L1_error)
- __pyx_v_wc = __pyx_t_1;
-
- /* "pywrapfst.pyx":2661
- * weight)
- * cdef unique_ptr[fst.RmEpsilonOptions] opts
- * opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
- * connect,
- * wc,
- */
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2661, __pyx_L1_error)
- __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2661, __pyx_L1_error)
-
- /* "pywrapfst.pyx":2665
- * wc,
- * nstate,
- * delta)) # <<<<<<<<<<<<<<
- * fst.RmEpsilon(self._mfst.get(), deref(opts))
- * self._check_mutating_imethod()
- */
- __pyx_v_opts.reset(new fst::script::RmEpsilonOptions(__pyx_t_3, __pyx_v_connect, __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta));
-
- /* "pywrapfst.pyx":2666
- * nstate,
- * delta))
- * fst.RmEpsilon(self._mfst.get(), deref(opts)) # <<<<<<<<<<<<<<
+ * 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_v__weight = __pyx_t_1;
+
+ /* "pywrapfst.pyx":2689
+ * 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)
+
+ /* "pywrapfst.pyx":2688
+ * weight)
+ * cdef unique_ptr[fst.RmEpsilonOptions] _opts
+ * _opts.reset( # <<<<<<<<<<<<<<
+ * new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
+ * connect,
+ */
+ __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
+ * nstate,
+ * delta))
+ * fst.RmEpsilon(self._mfst.get(), deref(_opts)) # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2666, __pyx_L1_error)
+ __PYX_ERR(0, 2694, __pyx_L1_error)
}
- fst::script::RmEpsilon(__pyx_v_self->_mfst.get(), (*__pyx_v_opts));
+ fst::script::RmEpsilon(__pyx_v_self->_mfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":2667
- * delta))
- * fst.RmEpsilon(self._mfst.get(), deref(opts))
+ /* "pywrapfst.pyx":2695
+ * delta))
+ * fst.RmEpsilon(self._mfst.get(), deref(_opts))
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
*
* def rmepsilon(self,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2667, __pyx_L1_error)
+ __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, 2667, __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)
- /* "pywrapfst.pyx":2652
+ /* "pywrapfst.pyx":2679
* return self
*
* cdef void _rmepsilon(self, # <<<<<<<<<<<<<<
- * queue_type=b"auto",
+ * queue_type="auto",
* bool connect=True,
*/
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2669
+/* "pywrapfst.pyx":2697
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
- * queue_type=b"auto",
+ * queue_type="auto",
* bool connect=True,
*/
PyObject *__pyx_v_weight = 0;
int64 __pyx_v_nstate;
float __pyx_v_delta;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("rmepsilon (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_queue_type,&__pyx_n_s_connect,&__pyx_n_s_weight,&__pyx_n_s_nstate,&__pyx_n_s_delta,0};
PyObject* values[5] = {0,0,0,0,0};
- values[0] = ((PyObject *)__pyx_n_b_auto);
+ values[0] = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":2672
- * queue_type=b"auto",
+ /* "pywrapfst.pyx":2700
+ * queue_type="auto",
* bool connect=True,
* weight=None, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 2669, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 2697, __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, 2671, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2699, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":2671
+ /* "pywrapfst.pyx":2699
* def rmepsilon(self,
- * queue_type=b"auto",
+ * queue_type="auto",
* bool connect=True, # <<<<<<<<<<<<<<
* weight=None,
* int64 nstate=fst.kNoStateId,
}
__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, 2673, __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, 2701, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__20;
+ __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, 2674, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2702, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__21;
+ __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, 2669, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2697, __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":2669
+ /* "pywrapfst.pyx":2697
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
- * queue_type=b"auto",
+ * queue_type="auto",
* bool connect=True,
*/
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_10MutableFst__rmepsilon __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("rmepsilon", 0);
- /* "pywrapfst.pyx":2696
+ /* "pywrapfst.pyx":2724
* 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, 2696, __pyx_L1_error)
+ __PYX_ERR(0, 2724, __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, 2696, __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, 2724, __pyx_L1_error)
- /* "pywrapfst.pyx":2697
+ /* "pywrapfst.pyx":2725
* """
* self._rmepsilon(queue_type, connect, weight, nstate, delta)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2669
+ /* "pywrapfst.pyx":2697
* self._check_mutating_imethod()
*
* def rmepsilon(self, # <<<<<<<<<<<<<<
- * queue_type=b"auto",
+ * queue_type="auto",
* bool connect=True,
*/
return __pyx_r;
}
-/* "pywrapfst.pyx":2699
+/* "pywrapfst.pyx":2727
* return self
*
* cdef void _set_final(self, int64 state, weight=None) except *: # <<<<<<<<<<<<<<
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) {
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- fst::script::WeightClass __pyx_v_wc;
+ fst::script::WeightClass __pyx_v__weight;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
fst::script::WeightClass __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_set_final", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":2700
+ /* "pywrapfst.pyx":2728
*
* cdef void _set_final(self, int64 state, weight=None) except *:
* if not self._mfst.get().ValidStateId(state): # <<<<<<<<<<<<<<
* raise FstIndexError("State index out of range")
- * cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
+ * 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, 2700, __pyx_L1_error)
+ __PYX_ERR(0, 2728, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2701
+ /* "pywrapfst.pyx":2729
* cdef void _set_final(self, int64 state, weight=None) except *:
* if not self._mfst.get().ValidStateId(state):
* raise FstIndexError("State index out of range") # <<<<<<<<<<<<<<
- * cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
- * weight)
+ * 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, 2701, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2729, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_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, 2701, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2729, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 2701, __pyx_L1_error)
+ __PYX_ERR(0, 2729, __pyx_L1_error)
- /* "pywrapfst.pyx":2700
+ /* "pywrapfst.pyx":2728
*
* cdef void _set_final(self, int64 state, weight=None) except *:
* if not self._mfst.get().ValidStateId(state): # <<<<<<<<<<<<<<
* raise FstIndexError("State index out of range")
- * cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_One(self.weight_type(),
*/
}
- /* "pywrapfst.pyx":2702
+ /* "pywrapfst.pyx":2730
* if not self._mfst.get().ValidStateId(state):
* raise FstIndexError("State index out of range")
- * cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(), # <<<<<<<<<<<<<<
- * weight)
- * if not self._mfst.get().SetFinal(state, wc):
+ * 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, 2702, __pyx_L1_error)
+ __PYX_ERR(0, 2730, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2703
+ /* "pywrapfst.pyx":2731
* raise FstIndexError("State index out of range")
- * cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
- * weight) # <<<<<<<<<<<<<<
- * if not self._mfst.get().SetFinal(state, wc):
+ * 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, 2702, __pyx_L1_error)
- __pyx_v_wc = __pyx_t_5;
+ __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_v__weight = __pyx_t_5;
- /* "pywrapfst.pyx":2704
- * cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
- * weight)
- * if not self._mfst.get().SetFinal(state, wc): # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":2732
+ * 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")
* 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, 2704, __pyx_L1_error)
+ __PYX_ERR(0, 2732, __pyx_L1_error)
}
- __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetFinal(__pyx_v_state, __pyx_v_wc) != 0)) != 0);
+ __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetFinal(__pyx_v_state, __pyx_v__weight) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2705
- * weight)
- * if not self._mfst.get().SetFinal(state, wc):
+ /* "pywrapfst.pyx":2733
+ * 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, 2705, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2733, __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, 2705, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2733, __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, 2705, __pyx_L1_error)
+ __PYX_ERR(0, 2733, __pyx_L1_error)
- /* "pywrapfst.pyx":2704
- * cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
- * weight)
- * if not self._mfst.get().SetFinal(state, wc): # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":2732
+ * 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")
* self._check_mutating_imethod()
*/
}
- /* "pywrapfst.pyx":2706
- * if not self._mfst.get().SetFinal(state, wc):
+ /* "pywrapfst.pyx":2734
+ * 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, 2706, __pyx_L1_error)
+ __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, 2706, __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)
- /* "pywrapfst.pyx":2699
+ /* "pywrapfst.pyx":2727
* return self
*
* cdef void _set_final(self, int64 state, weight=None) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2708
+/* "pywrapfst.pyx":2736
* self._check_mutating_imethod()
*
* def set_final(self, int64 state, weight=None): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_53set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int64 __pyx_v_state;
PyObject *__pyx_v_weight = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_final (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2708, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2736, __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, 2708, __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, 2736, __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, 2708, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_final", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2736, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.set_final", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct __pyx_opt_args_9pywrapfst_10MutableFst__set_final __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_final", 0);
- /* "pywrapfst.pyx":2726
+ /* "pywrapfst.pyx":2754
* 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, 2726, __pyx_L1_error)
+ __PYX_ERR(0, 2754, __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, 2726, __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, 2754, __pyx_L1_error)
- /* "pywrapfst.pyx":2727
+ /* "pywrapfst.pyx":2755
* """
* self._set_final(state, weight)
* return self # <<<<<<<<<<<<<<
*
- * cdef void _set_input_symbols(self, _SymbolTable syms) except *:
+ * cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2708
+ /* "pywrapfst.pyx":2736
* self._check_mutating_imethod()
*
* def set_final(self, int64 state, weight=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2729
+/* "pywrapfst.pyx":2757
* return self
*
- * cdef void _set_input_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
- * if syms is None:
+ * cdef void _set_input_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
+ * if symbols is None:
* self._mfst.get().SetInputSymbols(NULL)
*/
-static void __pyx_f_9pywrapfst_10MutableFst__set_input_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+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) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
fst::SymbolTable const *__pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_set_input_symbols", 0);
- /* "pywrapfst.pyx":2730
+ /* "pywrapfst.pyx":2758
*
- * cdef void _set_input_symbols(self, _SymbolTable syms) except *:
- * if syms is None: # <<<<<<<<<<<<<<
+ * cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
+ * if symbols is None: # <<<<<<<<<<<<<<
* self._mfst.get().SetInputSymbols(NULL)
* return
*/
- __pyx_t_1 = (((PyObject *)__pyx_v_syms) == Py_None);
+ __pyx_t_1 = (((PyObject *)__pyx_v_symbols) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2731
- * cdef void _set_input_symbols(self, _SymbolTable syms) except *:
- * if syms is None:
+ /* "pywrapfst.pyx":2759
+ * cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
+ * if symbols is None:
* self._mfst.get().SetInputSymbols(NULL) # <<<<<<<<<<<<<<
* return
- * self._mfst.get().SetInputSymbols(syms._raw_ptr_or_raise())
+ * 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, 2731, __pyx_L1_error)
+ __PYX_ERR(0, 2759, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetInputSymbols(NULL);
- /* "pywrapfst.pyx":2732
- * if syms is None:
+ /* "pywrapfst.pyx":2760
+ * if symbols is None:
* self._mfst.get().SetInputSymbols(NULL)
* return # <<<<<<<<<<<<<<
- * self._mfst.get().SetInputSymbols(syms._raw_ptr_or_raise())
+ * self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
*
*/
goto __pyx_L0;
- /* "pywrapfst.pyx":2730
+ /* "pywrapfst.pyx":2758
*
- * cdef void _set_input_symbols(self, _SymbolTable syms) except *:
- * if syms is None: # <<<<<<<<<<<<<<
+ * cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
+ * if symbols is None: # <<<<<<<<<<<<<<
* self._mfst.get().SetInputSymbols(NULL)
* return
*/
}
- /* "pywrapfst.pyx":2733
+ /* "pywrapfst.pyx":2761
* self._mfst.get().SetInputSymbols(NULL)
* return
- * self._mfst.get().SetInputSymbols(syms._raw_ptr_or_raise()) # <<<<<<<<<<<<<<
+ * self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise()) # <<<<<<<<<<<<<<
*
- * def set_input_symbols(self, _SymbolTable syms):
+ * def set_input_symbols(self, SymbolTableView symbols):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2733, __pyx_L1_error)
+ __PYX_ERR(0, 2761, __pyx_L1_error)
}
- if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
+ 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, 2733, __pyx_L1_error)
+ __PYX_ERR(0, 2761, __pyx_L1_error)
}
- __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_syms->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2733, __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_v_self->_mfst.get()->SetInputSymbols(__pyx_t_3);
- /* "pywrapfst.pyx":2729
+ /* "pywrapfst.pyx":2757
* return self
*
- * cdef void _set_input_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
- * if syms is None:
+ * cdef void _set_input_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
+ * if symbols is None:
* self._mfst.get().SetInputSymbols(NULL)
*/
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2735
- * self._mfst.get().SetInputSymbols(syms._raw_ptr_or_raise())
+/* "pywrapfst.pyx":2763
+ * self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
*
- * def set_input_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
+ * def set_input_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
* """
- * set_input_symbols(self, syms)
+ * set_input_symbols(self, symbols)
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_10MutableFst_55set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
-static char __pyx_doc_9pywrapfst_10MutableFst_54set_input_symbols[] = "\n set_input_symbols(self, syms)\n\n Sets the input symbol table.\n\n Passing None as a value will delete the input symbol table.\n\n Args:\n syms: A SymbolTable.\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_10MutableFst_55set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
+static PyObject *__pyx_pw_9pywrapfst_10MutableFst_55set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols); /*proto*/
+static char __pyx_doc_9pywrapfst_10MutableFst_54set_input_symbols[] = "\n set_input_symbols(self, symbols)\n\n Sets the input symbol table.\n\n Passing None as a value will delete the input symbol table.\n\n Args:\n symbols: A SymbolTable.\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_10MutableFst_55set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_input_symbols (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 2735, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_54set_input_symbols(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 2763, __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 */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_10MutableFst_54set_input_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+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) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_input_symbols", 0);
- /* "pywrapfst.pyx":2749
+ /* "pywrapfst.pyx":2777
* self.
* """
- * self._set_input_symbols(syms) # <<<<<<<<<<<<<<
+ * self._set_input_symbols(symbols) # <<<<<<<<<<<<<<
* return self
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_input_symbols");
- __PYX_ERR(0, 2749, __pyx_L1_error)
+ __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_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2749, __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)
- /* "pywrapfst.pyx":2750
+ /* "pywrapfst.pyx":2778
* """
- * self._set_input_symbols(syms)
+ * self._set_input_symbols(symbols)
* return self # <<<<<<<<<<<<<<
*
- * cdef void _set_output_symbols(self, _SymbolTable syms) except *:
+ * cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2735
- * self._mfst.get().SetInputSymbols(syms._raw_ptr_or_raise())
+ /* "pywrapfst.pyx":2763
+ * self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
*
- * def set_input_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
+ * def set_input_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
* """
- * set_input_symbols(self, syms)
+ * set_input_symbols(self, symbols)
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":2752
+/* "pywrapfst.pyx":2780
* return self
*
- * cdef void _set_output_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
- * if syms is None:
+ * cdef void _set_output_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
+ * if symbols is None:
* self._mfst.get().SetOutputSymbols(NULL)
*/
-static void __pyx_f_9pywrapfst_10MutableFst__set_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+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) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
fst::SymbolTable const *__pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_set_output_symbols", 0);
- /* "pywrapfst.pyx":2753
+ /* "pywrapfst.pyx":2781
*
- * cdef void _set_output_symbols(self, _SymbolTable syms) except *:
- * if syms is None: # <<<<<<<<<<<<<<
+ * cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
+ * if symbols is None: # <<<<<<<<<<<<<<
* self._mfst.get().SetOutputSymbols(NULL)
* return
*/
- __pyx_t_1 = (((PyObject *)__pyx_v_syms) == Py_None);
+ __pyx_t_1 = (((PyObject *)__pyx_v_symbols) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":2754
- * cdef void _set_output_symbols(self, _SymbolTable syms) except *:
- * if syms is None:
+ /* "pywrapfst.pyx":2782
+ * cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
+ * if symbols is None:
* self._mfst.get().SetOutputSymbols(NULL) # <<<<<<<<<<<<<<
* return
- * self._mfst.get().SetOutputSymbols(syms._raw_ptr_or_raise())
+ * 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, 2754, __pyx_L1_error)
+ __PYX_ERR(0, 2782, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetOutputSymbols(NULL);
- /* "pywrapfst.pyx":2755
- * if syms is None:
+ /* "pywrapfst.pyx":2783
+ * if symbols is None:
* self._mfst.get().SetOutputSymbols(NULL)
* return # <<<<<<<<<<<<<<
- * self._mfst.get().SetOutputSymbols(syms._raw_ptr_or_raise())
+ * self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
*
*/
goto __pyx_L0;
- /* "pywrapfst.pyx":2753
+ /* "pywrapfst.pyx":2781
*
- * cdef void _set_output_symbols(self, _SymbolTable syms) except *:
- * if syms is None: # <<<<<<<<<<<<<<
+ * cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
+ * if symbols is None: # <<<<<<<<<<<<<<
* self._mfst.get().SetOutputSymbols(NULL)
* return
*/
}
- /* "pywrapfst.pyx":2756
+ /* "pywrapfst.pyx":2784
* self._mfst.get().SetOutputSymbols(NULL)
* return
- * self._mfst.get().SetOutputSymbols(syms._raw_ptr_or_raise()) # <<<<<<<<<<<<<<
+ * self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise()) # <<<<<<<<<<<<<<
*
- * def set_output_symbols(self, _SymbolTable syms):
+ * def set_output_symbols(self, SymbolTableView symbols):
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2756, __pyx_L1_error)
+ __PYX_ERR(0, 2784, __pyx_L1_error)
}
- if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
+ 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, 2756, __pyx_L1_error)
+ __PYX_ERR(0, 2784, __pyx_L1_error)
}
- __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_syms->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2756, __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_v_self->_mfst.get()->SetOutputSymbols(__pyx_t_3);
- /* "pywrapfst.pyx":2752
+ /* "pywrapfst.pyx":2780
* return self
*
- * cdef void _set_output_symbols(self, _SymbolTable syms) except *: # <<<<<<<<<<<<<<
- * if syms is None:
+ * cdef void _set_output_symbols(self, SymbolTableView symbols) except *: # <<<<<<<<<<<<<<
+ * if symbols is None:
* self._mfst.get().SetOutputSymbols(NULL)
*/
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2758
- * self._mfst.get().SetOutputSymbols(syms._raw_ptr_or_raise())
+/* "pywrapfst.pyx":2786
+ * self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
*
- * def set_output_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
+ * def set_output_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
* """
- * set_output_symbols(self, syms)
+ * set_output_symbols(self, symbols)
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_10MutableFst_57set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
-static char __pyx_doc_9pywrapfst_10MutableFst_56set_output_symbols[] = "\n set_output_symbols(self, syms)\n\n Sets the output symbol table.\n\n Passing None as a value will delete the output symbol table.\n\n Args:\n syms: A SymbolTable.\n\n Returns:\n self.\n ";
-static PyObject *__pyx_pw_9pywrapfst_10MutableFst_57set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
+static PyObject *__pyx_pw_9pywrapfst_10MutableFst_57set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols); /*proto*/
+static char __pyx_doc_9pywrapfst_10MutableFst_56set_output_symbols[] = "\n set_output_symbols(self, symbols)\n\n Sets the output symbol table.\n\n Passing None as a value will delete the output symbol table.\n\n Args:\n symbols: A SymbolTable.\n\n Returns:\n self.\n ";
+static PyObject *__pyx_pw_9pywrapfst_10MutableFst_57set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_output_symbols (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 2758, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_56set_output_symbols(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 2786, __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 */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_10MutableFst_56set_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
+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) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_output_symbols", 0);
- /* "pywrapfst.pyx":2772
+ /* "pywrapfst.pyx":2800
* self.
* """
- * self._set_output_symbols(syms) # <<<<<<<<<<<<<<
+ * self._set_output_symbols(symbols) # <<<<<<<<<<<<<<
* return self
*
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_output_symbols");
- __PYX_ERR(0, 2772, __pyx_L1_error)
+ __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_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2772, __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)
- /* "pywrapfst.pyx":2773
+ /* "pywrapfst.pyx":2801
* """
- * self._set_output_symbols(syms)
+ * self._set_output_symbols(symbols)
* return self # <<<<<<<<<<<<<<
*
* cdef void _set_properties(self, uint64 props, uint64 mask):
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2758
- * self._mfst.get().SetOutputSymbols(syms._raw_ptr_or_raise())
+ /* "pywrapfst.pyx":2786
+ * self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
*
- * def set_output_symbols(self, _SymbolTable syms): # <<<<<<<<<<<<<<
+ * def set_output_symbols(self, SymbolTableView symbols): # <<<<<<<<<<<<<<
* """
- * set_output_symbols(self, syms)
+ * set_output_symbols(self, symbols)
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":2775
+/* "pywrapfst.pyx":2803
* return self
*
* cdef void _set_properties(self, uint64 props, uint64 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":2776
+ /* "pywrapfst.pyx":2804
*
* cdef void _set_properties(self, uint64 props, uint64 mask):
* self._mfst.get().SetProperties(props, mask) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2776, __pyx_L1_error)
+ __PYX_ERR(0, 2804, __pyx_L1_error)
}
__pyx_v_self->_mfst.get()->SetProperties(__pyx_v_props, __pyx_v_mask);
- /* "pywrapfst.pyx":2775
+ /* "pywrapfst.pyx":2803
* return self
*
* cdef void _set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2778
+/* "pywrapfst.pyx":2806
* self._mfst.get().SetProperties(props, mask)
*
* def set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
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;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_properties (wrapper)", 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, 2778, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, 1); __PYX_ERR(0, 2806, __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, 2778, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_properties") < 0)) __PYX_ERR(0, 2806, __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, 2778, __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, 2778, __pyx_L3_error)
+ __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)
}
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, 2778, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2806, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableFst.set_properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_58set_properties(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, uint64 __pyx_v_props, uint64 __pyx_v_mask) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_properties", 0);
- /* "pywrapfst.pyx":2792
+ /* "pywrapfst.pyx":2820
* self.
* """
* self._set_properties(props, mask) # <<<<<<<<<<<<<<
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_properties");
- __PYX_ERR(0, 2792, __pyx_L1_error)
+ __PYX_ERR(0, 2820, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_properties(__pyx_v_self, __pyx_v_props, __pyx_v_mask);
- /* "pywrapfst.pyx":2793
+ /* "pywrapfst.pyx":2821
* """
* self._set_properties(props, mask)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2778
+ /* "pywrapfst.pyx":2806
* self._mfst.get().SetProperties(props, mask)
*
* def set_properties(self, uint64 props, uint64 mask): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2795
+/* "pywrapfst.pyx":2823
* return self
*
* cdef void _set_start(self, int64 state) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_set_start", 0);
- /* "pywrapfst.pyx":2796
+ /* "pywrapfst.pyx":2824
*
* 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, 2796, __pyx_L1_error)
+ __PYX_ERR(0, 2824, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetStart(__pyx_v_state) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2797
+ /* "pywrapfst.pyx":2825
* 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, 2797, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2825, __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, 2797, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2825, __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, 2797, __pyx_L1_error)
+ __PYX_ERR(0, 2825, __pyx_L1_error)
- /* "pywrapfst.pyx":2796
+ /* "pywrapfst.pyx":2824
*
* cdef void _set_start(self, int64 state) except *:
* if not self._mfst.get().SetStart(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2795
+ /* "pywrapfst.pyx":2823
* return self
*
* cdef void _set_start(self, int64 state) except *: # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2799
+/* "pywrapfst.pyx":2827
* raise FstIndexError("State index out of range")
*
* def set_start(self, int64 state): # <<<<<<<<<<<<<<
static char __pyx_doc_9pywrapfst_10MutableFst_60set_start[] = "\n set_start(self, state)\n\n Sets a state to be the initial state state.\n\n Args:\n state: The integer index of a state.\n\n Returns:\n self.\n\n Raises:\n FstIndexError: State index out of range.\n ";
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_61set_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
int64 __pyx_v_state;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_start (wrapper)", 0);
assert(__pyx_arg_state); {
- __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2799, __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, 2827, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_60set_start(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_start", 0);
- /* "pywrapfst.pyx":2814
+ /* "pywrapfst.pyx":2842
* 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, 2814, __pyx_L1_error)
+ __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, 2814, __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)
- /* "pywrapfst.pyx":2815
+ /* "pywrapfst.pyx":2843
* """
* self._set_start(state)
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2799
+ /* "pywrapfst.pyx":2827
* raise FstIndexError("State index out of range")
*
* def set_start(self, int64 state): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2817
+/* "pywrapfst.pyx":2845
* return self
*
* cdef void _topsort(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_topsort", 0);
- /* "pywrapfst.pyx":2819
+ /* "pywrapfst.pyx":2847
* 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, 2819, __pyx_L1_error)
+ __PYX_ERR(0, 2847, __pyx_L1_error)
}
__pyx_t_1 = ((!(fst::script::TopSort(__pyx_v_self->_mfst.get()) != 0)) != 0);
if (__pyx_t_1) {
- /* "pywrapfst.pyx":2820
+ /* "pywrapfst.pyx":2848
* # 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, 2820, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logging); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2848, __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, 2820, __pyx_L1_error)
+ __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_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, 2820, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2848, __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":2819
+ /* "pywrapfst.pyx":2847
* 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":2817
+ /* "pywrapfst.pyx":2845
* return self
*
* cdef void _topsort(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyFinishContext();
}
-/* "pywrapfst.pyx":2822
+/* "pywrapfst.pyx":2850
* logging.warning("Cannot topsort cyclic FST")
*
* def topsort(self): # <<<<<<<<<<<<<<
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_62topsort(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("topsort", 0);
- /* "pywrapfst.pyx":2835
+ /* "pywrapfst.pyx":2863
* 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, 2835, __pyx_L1_error)
+ __PYX_ERR(0, 2863, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_topsort(__pyx_v_self);
- /* "pywrapfst.pyx":2836
+ /* "pywrapfst.pyx":2864
* """
* self._topsort()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2822
+ /* "pywrapfst.pyx":2850
* logging.warning("Cannot topsort cyclic FST")
*
* def topsort(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2838
+/* "pywrapfst.pyx":2866
* return self
*
* def union(self, *fsts2): # <<<<<<<<<<<<<<
}
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_64union(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_fsts2) {
+ struct __pyx_obj_9pywrapfst_Fst *__pyx_v__fst2 = 0;
std::vector<__pyx_t_9pywrapfst_const_FstClass_ptr> __pyx_v__fsts2;
- struct __pyx_obj_9pywrapfst_Fst *__pyx_v_fst2 = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("union", 0);
- /* "pywrapfst.pyx":2856
+ /* "pywrapfst.pyx":2884
+ * cdef Fst _fst2
* cdef vector[const_FstClass_ptr] _fsts2
- * cdef Fst fst2
- * for fst2 in fsts2: # <<<<<<<<<<<<<<
- * _fsts2.push_back(fst2._fst.get())
+ * for _fst2 in fsts2: # <<<<<<<<<<<<<<
+ * _fsts2.push_back(_fst2._fst.get())
* fst.Union(self._mfst.get(), _fsts2)
*/
__pyx_t_1 = __pyx_v_fsts2; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
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, 2856, __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, 2884, __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, 2856, __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, 2884, __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, 2856, __pyx_L1_error)
- __Pyx_XDECREF_SET(__pyx_v_fst2, ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_3));
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 2884, __pyx_L1_error)
+ __Pyx_XDECREF_SET(__pyx_v__fst2, ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_3));
__pyx_t_3 = 0;
- /* "pywrapfst.pyx":2857
- * cdef Fst fst2
- * for fst2 in fsts2:
- * _fsts2.push_back(fst2._fst.get()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":2885
+ * cdef vector[const_FstClass_ptr] _fsts2
+ * for _fst2 in fsts2:
+ * _fsts2.push_back(_fst2._fst.get()) # <<<<<<<<<<<<<<
* fst.Union(self._mfst.get(), _fsts2)
* self._check_mutating_imethod()
*/
- if (unlikely(((PyObject *)__pyx_v_fst2) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__fst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2857, __pyx_L1_error)
+ __PYX_ERR(0, 2885, __pyx_L1_error)
}
try {
- __pyx_v__fsts2.push_back(__pyx_v_fst2->_fst.get());
+ __pyx_v__fsts2.push_back(__pyx_v__fst2->_fst.get());
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 2857, __pyx_L1_error)
+ __PYX_ERR(0, 2885, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2856
+ /* "pywrapfst.pyx":2884
+ * cdef Fst _fst2
* cdef vector[const_FstClass_ptr] _fsts2
- * cdef Fst fst2
- * for fst2 in fsts2: # <<<<<<<<<<<<<<
- * _fsts2.push_back(fst2._fst.get())
+ * for _fst2 in fsts2: # <<<<<<<<<<<<<<
+ * _fsts2.push_back(_fst2._fst.get())
* fst.Union(self._mfst.get(), _fsts2)
*/
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":2858
- * for fst2 in fsts2:
- * _fsts2.push_back(fst2._fst.get())
+ /* "pywrapfst.pyx":2886
+ * for _fst2 in fsts2:
+ * _fsts2.push_back(_fst2._fst.get())
* fst.Union(self._mfst.get(), _fsts2) # <<<<<<<<<<<<<<
* self._check_mutating_imethod()
* return self
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2858, __pyx_L1_error)
+ __PYX_ERR(0, 2886, __pyx_L1_error)
}
fst::script::Union(__pyx_v_self->_mfst.get(), __pyx_v__fsts2);
- /* "pywrapfst.pyx":2859
- * _fsts2.push_back(fst2._fst.get())
+ /* "pywrapfst.pyx":2887
+ * _fsts2.push_back(_fst2._fst.get())
* fst.Union(self._mfst.get(), _fsts2)
* self._check_mutating_imethod() # <<<<<<<<<<<<<<
* return self
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
- __PYX_ERR(0, 2859, __pyx_L1_error)
+ __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, 2859, __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)
- /* "pywrapfst.pyx":2860
+ /* "pywrapfst.pyx":2888
* fst.Union(self._mfst.get(), _fsts2)
* self._check_mutating_imethod()
* return self # <<<<<<<<<<<<<<
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
- /* "pywrapfst.pyx":2838
+ /* "pywrapfst.pyx":2866
* return self
*
* def union(self, *fsts2): # <<<<<<<<<<<<<<
__Pyx_AddTraceback("pywrapfst.MutableFst.union", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_fst2);
+ __Pyx_XDECREF((PyObject *)__pyx_v__fst2);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":2876
+/* "pywrapfst.pyx":2904
* """
*
- * def __init__(self, arc_type=b"standard"): # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.MutableFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
+ * def __init__(self, arc_type="standard"): # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.MutableFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
*/
/* Python wrapper */
static int __pyx_pw_9pywrapfst_9VectorFst_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_9VectorFst_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_arc_type = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arc_type,0};
PyObject* values[1] = {0};
- values[0] = ((PyObject *)__pyx_n_b_standard);
+ values[0] = ((PyObject *)__pyx_n_u_standard);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2876, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2904, __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, 2876, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2904, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.VectorFst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
}
static int __pyx_pf_9pywrapfst_9VectorFst___init__(struct __pyx_obj_9pywrapfst_VectorFst *__pyx_v_self, PyObject *__pyx_v_arc_type) {
- std::unique_ptr<fst::script::MutableFstClass> __pyx_v_tfst;
+ std::unique_ptr<fst::script::MutableFstClass> __pyx_v__tfst;
int __pyx_r;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":2878
- * def __init__(self, arc_type=b"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("Unknown arc type: {!r}".format(arc_type))
+ /* "pywrapfst.pyx":2906
+ * 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, 2878, __pyx_L1_error)
- __pyx_v_tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2906, __pyx_L1_error)
+ __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));
- /* "pywrapfst.pyx":2879
- * 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("Unknown arc type: {!r}".format(arc_type))
- * self._fst.reset(tfst.release())
+ /* "pywrapfst.pyx":2907
+ * 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}")
+ * self._fst.reset(_tfst.release())
*/
- __pyx_t_2 = ((__pyx_v_tfst.get()->Properties(fst::kError, 1) == fst::kError) != 0);
+ __pyx_t_2 = ((__pyx_v__tfst.get()->Properties(fst::kError, 1) == fst::kError) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":2880
- * tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
- * if tfst.get().Properties(fst.kError, True) == fst.kError:
- * raise FstOpError("Unknown arc type: {!r}".format(arc_type)) # <<<<<<<<<<<<<<
- * self._fst.reset(tfst.release())
+ /* "pywrapfst.pyx":2908
+ * _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, 2880, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2908, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_arc_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2880, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_arc_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_arc_type);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2880, __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, 2908, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
+ __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_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
+ __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_6);
+ __Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2880, __pyx_L1_error)
+ __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)
__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, 2880, __pyx_L1_error)
+ __PYX_ERR(0, 2908, __pyx_L1_error)
- /* "pywrapfst.pyx":2879
- * 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("Unknown arc type: {!r}".format(arc_type))
- * self._fst.reset(tfst.release())
+ /* "pywrapfst.pyx":2907
+ * 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}")
+ * self._fst.reset(_tfst.release())
*/
}
- /* "pywrapfst.pyx":2881
- * if tfst.get().Properties(fst.kError, True) == fst.kError:
- * raise FstOpError("Unknown arc type: {!r}".format(arc_type))
- * self._fst.reset(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":2909
+ * 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,
* 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, 2881, __pyx_L1_error)
+ __PYX_ERR(0, 2909, __pyx_L1_error)
}
- __pyx_v_self->__pyx_base.__pyx_base._fst.reset(__pyx_v_tfst.release());
+ __pyx_v_self->__pyx_base.__pyx_base._fst.reset(__pyx_v__tfst.release());
- /* "pywrapfst.pyx":2883
- * self._fst.reset(tfst.release())
+ /* "pywrapfst.pyx":2911
+ * 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, 2883, __pyx_L1_error)
+ __PYX_ERR(0, 2911, __pyx_L1_error)
}
- /* "pywrapfst.pyx":2882
- * raise FstOpError("Unknown arc type: {!r}".format(arc_type))
- * self._fst.reset(tfst.release())
+ /* "pywrapfst.pyx":2910
+ * raise FstOpError(f"Unknown arc type: {arc_type!r}")
+ * 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'", "_mfst");
- __PYX_ERR(0, 2882, __pyx_L1_error)
+ __PYX_ERR(0, 2910, __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":2876
+ /* "pywrapfst.pyx":2904
* """
*
- * def __init__(self, arc_type=b"standard"): # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.MutableFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
+ * def __init__(self, arc_type="standard"): # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.MutableFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
*/
/* function exit code */
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst.VectorFst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":2902
+/* "pywrapfst.pyx":2930
*
*
* cdef Fst _init_Fst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__init_Fst(__pyx_t_9pywrapfst_FstClass_ptr __pyx_v_tfst) {
- struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ofst = 0;
+ struct __pyx_obj_9pywrapfst_Fst *__pyx_v__ofst = 0;
struct __pyx_obj_9pywrapfst_Fst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_Fst", 0);
- /* "pywrapfst.pyx":2903
+ /* "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)
+ * cdef Fst _ofst = Fst.__new__(Fst)
*/
__pyx_t_1 = ((__pyx_v_tfst->Properties(fst::kError, 1) == fst::kError) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2904
+ /* "pywrapfst.pyx":2932
* 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)
+ * 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, 2904, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2932, __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, 2904, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2932, __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, 2904, __pyx_L1_error)
+ __PYX_ERR(0, 2932, __pyx_L1_error)
- /* "pywrapfst.pyx":2903
+ /* "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)
+ * cdef Fst _ofst = Fst.__new__(Fst)
*/
}
- /* "pywrapfst.pyx":2905
+ /* "pywrapfst.pyx":2933
* if tfst.Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed")
- * cdef Fst ofst = Fst.__new__(Fst) # <<<<<<<<<<<<<<
- * ofst._fst.reset(tfst)
- * return ofst
+ * 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, 2905, __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, 2933, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_v_ofst = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_2);
+ __pyx_v__ofst = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":2906
+ /* "pywrapfst.pyx":2934
* raise FstOpError("Operation failed")
- * cdef Fst ofst = Fst.__new__(Fst)
- * ofst._fst.reset(tfst) # <<<<<<<<<<<<<<
- * return ofst
+ * cdef Fst _ofst = Fst.__new__(Fst)
+ * _ofst._fst.reset(tfst) # <<<<<<<<<<<<<<
+ * return _ofst
*
*/
- if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2906, __pyx_L1_error)
+ __PYX_ERR(0, 2934, __pyx_L1_error)
}
- __pyx_v_ofst->_fst.reset(__pyx_v_tfst);
+ __pyx_v__ofst->_fst.reset(__pyx_v_tfst);
- /* "pywrapfst.pyx":2907
- * cdef Fst ofst = Fst.__new__(Fst)
- * ofst._fst.reset(tfst)
- * return ofst # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":2935
+ * cdef Fst _ofst = Fst.__new__(Fst)
+ * _ofst._fst.reset(tfst)
+ * return _ofst # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_ofst));
- __pyx_r = __pyx_v_ofst;
+ __Pyx_INCREF(((PyObject *)__pyx_v__ofst));
+ __pyx_r = __pyx_v__ofst;
goto __pyx_L0;
- /* "pywrapfst.pyx":2902
+ /* "pywrapfst.pyx":2930
*
*
* cdef Fst _init_Fst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
__Pyx_AddTraceback("pywrapfst._init_Fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_ofst);
+ __Pyx_XDECREF((PyObject *)__pyx_v__ofst);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":2910
+/* "pywrapfst.pyx":2938
*
*
* cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst): # <<<<<<<<<<<<<<
*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst__init_MutableFst(__pyx_t_9pywrapfst_MutableFstClass_ptr __pyx_v_tfst) {
- struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_ofst = 0;
+ struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v__ofst = 0;
struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_MutableFst", 0);
- /* "pywrapfst.pyx":2911
+ /* "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)
+ * cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
*/
__pyx_t_1 = ((__pyx_v_tfst->Properties(fst::kError, 1) == fst::kError) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2912
+ /* "pywrapfst.pyx":2940
* 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)
+ * 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, 2912, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2940, __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, 2912, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2940, __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, 2912, __pyx_L1_error)
+ __PYX_ERR(0, 2940, __pyx_L1_error)
- /* "pywrapfst.pyx":2911
+ /* "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)
+ * cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
*/
}
- /* "pywrapfst.pyx":2913
+ /* "pywrapfst.pyx":2941
* if tfst.Properties(fst.kError, True) == fst.kError:
* raise FstOpError("Operation failed")
- * cdef MutableFst ofst = MutableFst.__new__(MutableFst) # <<<<<<<<<<<<<<
- * ofst._fst.reset(tfst)
+ * 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, 2913, __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, 2941, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_v_ofst = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_2);
+ __pyx_v__ofst = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":2914
+ /* "pywrapfst.pyx":2942
* raise FstOpError("Operation failed")
- * cdef MutableFst ofst = MutableFst.__new__(MutableFst)
- * ofst._fst.reset(tfst) # <<<<<<<<<<<<<<
+ * cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
+ * _ofst._fst.reset(tfst) # <<<<<<<<<<<<<<
* # Makes a copy of it as the derived type! Cool.
- * ofst._mfst = static_pointer_cast[fst.MutableFstClass, fst.FstClass](ofst._fst)
+ * _ofst._mfst = static_pointer_cast[fst.MutableFstClass,
*/
- if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2914, __pyx_L1_error)
+ __PYX_ERR(0, 2942, __pyx_L1_error)
}
- __pyx_v_ofst->__pyx_base._fst.reset(__pyx_v_tfst);
+ __pyx_v__ofst->__pyx_base._fst.reset(__pyx_v_tfst);
- /* "pywrapfst.pyx":2916
- * ofst._fst.reset(tfst)
+ /* "pywrapfst.pyx":2945
* # Makes a copy of it as the derived type! Cool.
- * ofst._mfst = static_pointer_cast[fst.MutableFstClass, fst.FstClass](ofst._fst) # <<<<<<<<<<<<<<
- * return ofst
+ * _ofst._mfst = static_pointer_cast[fst.MutableFstClass,
+ * fst.FstClass](_ofst._fst) # <<<<<<<<<<<<<<
+ * return _ofst
*
*/
- if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 2916, __pyx_L1_error)
+ __PYX_ERR(0, 2945, __pyx_L1_error)
}
- if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
+
+ /* "pywrapfst.pyx":2944
+ * _ofst._fst.reset(tfst)
+ * # Makes a copy of it as the derived type! Cool.
+ * _ofst._mfst = static_pointer_cast[fst.MutableFstClass, # <<<<<<<<<<<<<<
+ * fst.FstClass](_ofst._fst)
+ * return _ofst
+ */
+ if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
- __PYX_ERR(0, 2916, __pyx_L1_error)
+ __PYX_ERR(0, 2944, __pyx_L1_error)
}
- __pyx_v_ofst->_mfst = std::static_pointer_cast<fst::script::MutableFstClass,fst::script::FstClass>(__pyx_v_ofst->__pyx_base._fst);
+ __pyx_v__ofst->_mfst = std::static_pointer_cast<fst::script::MutableFstClass,fst::script::FstClass>(__pyx_v__ofst->__pyx_base._fst);
- /* "pywrapfst.pyx":2917
- * # Makes a copy of it as the derived type! Cool.
- * ofst._mfst = static_pointer_cast[fst.MutableFstClass, fst.FstClass](ofst._fst)
- * return ofst # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":2946
+ * _ofst._mfst = static_pointer_cast[fst.MutableFstClass,
+ * fst.FstClass](_ofst._fst)
+ * return _ofst # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_ofst));
- __pyx_r = __pyx_v_ofst;
+ __Pyx_INCREF(((PyObject *)__pyx_v__ofst));
+ __pyx_r = __pyx_v__ofst;
goto __pyx_L0;
- /* "pywrapfst.pyx":2910
+ /* "pywrapfst.pyx":2938
*
*
* cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst): # <<<<<<<<<<<<<<
__Pyx_AddTraceback("pywrapfst._init_MutableFst", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_ofst);
+ __Pyx_XDECREF((PyObject *)__pyx_v__ofst);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":2920
+/* "pywrapfst.pyx":2949
*
*
* cdef Fst _init_XFst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_XFst", 0);
- /* "pywrapfst.pyx":2921
+ /* "pywrapfst.pyx":2950
*
* 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":2922
+ /* "pywrapfst.pyx":2951
* 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, 2922, __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, 2951, __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":2921
+ /* "pywrapfst.pyx":2950
*
* cdef Fst _init_XFst(FstClass_ptr tfst):
* if tfst.Properties(fst.kMutable, True) == fst.kMutable: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":2924
+ /* "pywrapfst.pyx":2953
* 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, 2924, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
__pyx_r = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "pywrapfst.pyx":2920
+ /* "pywrapfst.pyx":2949
*
*
* cdef Fst _init_XFst(FstClass_ptr tfst): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":2927
+/* "pywrapfst.pyx":2956
*
*
* cpdef Fst _read_Fst(source): # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.FstClass.Read(tostring(source)))
+ * cdef unique_ptr[fst.FstClass] _tfst
+ * _tfst.reset(fst.FstClass.Read(path_tostring(source)))
*/
static PyObject *__pyx_pw_9pywrapfst_17_read_Fst(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *__pyx_v_source, CYTHON_UNUSED int __pyx_skip_dispatch) {
- std::unique_ptr<fst::script::FstClass> __pyx_v_tfst;
+ std::unique_ptr<fst::script::FstClass> __pyx_v__tfst;
struct __pyx_obj_9pywrapfst_Fst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_read_Fst", 0);
- /* "pywrapfst.pyx":2929
+ /* "pywrapfst.pyx":2958
* cpdef Fst _read_Fst(source):
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.FstClass.Read(tostring(source))) # <<<<<<<<<<<<<<
- * if tfst.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(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_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2929, __pyx_L1_error)
- __pyx_v_tfst.reset(fst::script::FstClass::Read(__pyx_t_1));
+ __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2958, __pyx_L1_error)
+ __pyx_v__tfst.reset(fst::script::FstClass::Read(__pyx_t_1));
- /* "pywrapfst.pyx":2930
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.FstClass.Read(tostring(source)))
- * if tfst.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_XFst(tfst.release())
+ /* "pywrapfst.pyx":2959
+ * 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}")
+ * return _init_XFst(_tfst.release())
*/
- __pyx_t_2 = ((__pyx_v_tfst.get() == NULL) != 0);
+ __pyx_t_2 = ((__pyx_v__tfst.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":2931
- * tfst.reset(fst.FstClass.Read(tostring(source)))
- * if tfst.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source)) # <<<<<<<<<<<<<<
- * return _init_XFst(tfst.release())
+ /* "pywrapfst.pyx":2960
+ * _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, 2931, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2960, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2931, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2931, __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, 2960, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
+ __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_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
+ __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_6);
+ __Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2931, __pyx_L1_error)
+ __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)
__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, 2931, __pyx_L1_error)
+ __PYX_ERR(0, 2960, __pyx_L1_error)
- /* "pywrapfst.pyx":2930
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.FstClass.Read(tostring(source)))
- * if tfst.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_XFst(tfst.release())
+ /* "pywrapfst.pyx":2959
+ * 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}")
+ * return _init_XFst(_tfst.release())
*/
}
- /* "pywrapfst.pyx":2932
- * if tfst.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(source))
- * return _init_XFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":2961
+ * 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, 2932, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2927
+ /* "pywrapfst.pyx":2956
*
*
* cpdef Fst _read_Fst(source): # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.FstClass.Read(tostring(source)))
+ * cdef unique_ptr[fst.FstClass] _tfst
+ * _tfst.reset(fst.FstClass.Read(path_tostring(source)))
*/
/* function exit code */
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst._read_Fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
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("_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, 2927, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":2935
+/* "pywrapfst.pyx":2964
*
*
- * cpdef Fst _read_Fst_from_string(state): # <<<<<<<<<<<<<<
- * cdef stringstream sstrm
- * sstrm << tostring(state)
+ * cpdef Fst _read_Fst_from_string(string state): # <<<<<<<<<<<<<<
+ * cdef stringstream _sstrm
+ * _sstrm << state
*/
-static PyObject *__pyx_pw_9pywrapfst_19_read_Fst_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/
-static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__read_Fst_from_string(PyObject *__pyx_v_state, CYTHON_UNUSED int __pyx_skip_dispatch) {
- std::stringstream __pyx_v_sstrm;
- std::unique_ptr<fst::script::FstClass> __pyx_v_tfst;
+static PyObject *__pyx_pw_9pywrapfst_19_read_Fst_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state); /*proto*/
+static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__read_Fst_from_string(std::string __pyx_v_state, CYTHON_UNUSED int __pyx_skip_dispatch) {
+ std::stringstream __pyx_v__sstrm;
+ std::unique_ptr<fst::script::FstClass> __pyx_v__tfst;
struct __pyx_obj_9pywrapfst_Fst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- std::string __pyx_t_1;
- int __pyx_t_2;
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_read_Fst_from_string", 0);
- /* "pywrapfst.pyx":2937
- * cpdef Fst _read_Fst_from_string(state):
- * cdef stringstream sstrm
- * sstrm << tostring(state) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.FstClass.ReadStream(sstrm, b"<pywrapfst>"))
+ /* "pywrapfst.pyx":2966
+ * cpdef Fst _read_Fst_from_string(string state):
+ * cdef stringstream _sstrm
+ * _sstrm << state # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.FstClass] _tfst
+ * _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>"))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2937, __pyx_L1_error)
- (void)((__pyx_v_sstrm << __pyx_t_1));
+ (void)((__pyx_v__sstrm << __pyx_v_state));
- /* "pywrapfst.pyx":2939
- * sstrm << tostring(state)
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.FstClass.ReadStream(sstrm, b"<pywrapfst>")) # <<<<<<<<<<<<<<
- * if tfst.get() == NULL:
- * raise FstIOError("Read failed")
- */
- __pyx_v_tfst.reset(fst::script::FstClass::Read(__pyx_v_sstrm, __pyx_k_pywrapfst));
-
- /* "pywrapfst.pyx":2940
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.FstClass.ReadStream(sstrm, b"<pywrapfst>"))
- * if tfst.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed")
- * return _init_XFst(tfst.release())
- */
- __pyx_t_2 = ((__pyx_v_tfst.get() == NULL) != 0);
- if (unlikely(__pyx_t_2)) {
+ /* "pywrapfst.pyx":2968
+ * _sstrm << state
+ * cdef unique_ptr[fst.FstClass] _tfst
+ * _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>")) # <<<<<<<<<<<<<<
+ * if _tfst.get() == NULL:
+ * raise FstIOError("Read from string failed")
+ */
+ __pyx_v__tfst.reset(fst::script::FstClass::Read(__pyx_v__sstrm, __pyx_k_pywrapfst));
+
+ /* "pywrapfst.pyx":2969
+ * cdef unique_ptr[fst.FstClass] _tfst
+ * _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>"))
+ * if _tfst.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstIOError("Read from string failed")
+ * return _init_XFst(_tfst.release())
+ */
+ __pyx_t_1 = ((__pyx_v__tfst.get() == NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":2941
- * tfst.reset(fst.FstClass.ReadStream(sstrm, b"<pywrapfst>"))
- * if tfst.get() == NULL:
- * raise FstIOError("Read failed") # <<<<<<<<<<<<<<
- * return _init_XFst(tfst.release())
+ /* "pywrapfst.pyx":2970
+ * _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_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2941, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2970, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
}
}
- __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_Read_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Read_failed);
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2941, __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_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)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2941, __pyx_L1_error)
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __PYX_ERR(0, 2970, __pyx_L1_error)
- /* "pywrapfst.pyx":2940
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.FstClass.ReadStream(sstrm, b"<pywrapfst>"))
- * if tfst.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed")
- * return _init_XFst(tfst.release())
+ /* "pywrapfst.pyx":2969
+ * cdef unique_ptr[fst.FstClass] _tfst
+ * _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>"))
+ * if _tfst.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstIOError("Read from string failed")
+ * return _init_XFst(_tfst.release())
*/
}
- /* "pywrapfst.pyx":2942
- * if tfst.get() == NULL:
- * raise FstIOError("Read failed")
- * return _init_XFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":2971
+ * if _tfst.get() == NULL:
+ * raise FstIOError("Read from string 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, 2942, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_3);
- __pyx_t_3 = 0;
+ __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_GOTREF(__pyx_t_2);
+ __pyx_r = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_2);
+ __pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":2935
+ /* "pywrapfst.pyx":2964
*
*
- * cpdef Fst _read_Fst_from_string(state): # <<<<<<<<<<<<<<
- * cdef stringstream sstrm
- * sstrm << tostring(state)
+ * cpdef Fst _read_Fst_from_string(string state): # <<<<<<<<<<<<<<
+ * cdef stringstream _sstrm
+ * _sstrm << state
*/
/* function exit code */
__pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("pywrapfst._read_Fst_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
}
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_19_read_Fst_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/
-static PyObject *__pyx_pw_9pywrapfst_19_read_Fst_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state) {
+static PyObject *__pyx_pw_9pywrapfst_19_read_Fst_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_19_read_Fst_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state) {
+ std::string __pyx_v_state;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_read_Fst_from_string (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_18_read_Fst_from_string(__pyx_self, ((PyObject *)__pyx_v_state));
+ 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)
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("pywrapfst._read_Fst_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_9pywrapfst_18_read_Fst_from_string(__pyx_self, ((std::string)__pyx_v_state));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_18_read_Fst_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state) {
+static PyObject *__pyx_pf_9pywrapfst_18_read_Fst_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state) {
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("_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, 2935, __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, 2964, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3055
+/* "pywrapfst.pyx":3084
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<Arc at 0x{:x}>".format(id(self))
+ * return f"<Arc at 0x{id(self):x}>"
*
*/
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3056
+ /* "pywrapfst.pyx":3085
*
* def __repr__(self):
- * return "<Arc at 0x{:x}>".format(id(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_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Arc_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3056, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3056, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- }
- }
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3056, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3085, __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;
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u_Arc_at_0x);
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__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_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":3055
+ /* "pywrapfst.pyx":3084
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<Arc at 0x{:x}>".format(id(self))
+ * return f"<Arc at 0x{id(self):x}>"
*
*/
/* 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_AddTraceback("pywrapfst.Arc.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":3058
- * return "<Arc at 0x{:x}>".format(id(self))
+/* "pywrapfst.pyx":3087
+ * return f"<Arc at 0x{id(self):x}>"
*
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate): # <<<<<<<<<<<<<<
- * cdef fst.WeightClass wc = _get_WeightClass_or_One(b"tropical", weight)
- * self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_One(b"tropical", weight)
+ * self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
*/
/* Python wrapper */
int64 __pyx_v_olabel;
PyObject *__pyx_v_weight = 0;
int64 __pyx_v_nextstate;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
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, 3058, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 3087, __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, 3058, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 3087, __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, 3058, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 3087, __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, 3058, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3087, __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, 3058, __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, 3058, __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, 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_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, 3058, __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, 3087, __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, 3058, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3087, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Arc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
}
static int __pyx_pf_9pywrapfst_3Arc_2__init__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_ilabel, int64 __pyx_v_olabel, PyObject *__pyx_v_weight, int64 __pyx_v_nextstate) {
- fst::script::WeightClass __pyx_v_wc;
+ fst::script::WeightClass __pyx_v__weight;
int __pyx_r;
__Pyx_RefNannyDeclarations
fst::script::WeightClass __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":3059
+ /* "pywrapfst.pyx":3088
*
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
- * cdef fst.WeightClass wc = _get_WeightClass_or_One(b"tropical", weight) # <<<<<<<<<<<<<<
- * self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
+ * 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, 3059, __pyx_L1_error)
- __pyx_v_wc = __pyx_t_1;
+ __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_v__weight = __pyx_t_1;
- /* "pywrapfst.pyx":3060
+ /* "pywrapfst.pyx":3089
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
- * cdef fst.WeightClass wc = _get_WeightClass_or_One(b"tropical", weight)
- * self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate)) # <<<<<<<<<<<<<<
+ * 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, 3060, __pyx_L1_error)
+ __PYX_ERR(0, 3089, __pyx_L1_error)
}
- __pyx_v_self->_arc.reset(new fst::script::ArcClass(__pyx_v_ilabel, __pyx_v_olabel, __pyx_v_wc, __pyx_v_nextstate));
+ __pyx_v_self->_arc.reset(new fst::script::ArcClass(__pyx_v_ilabel, __pyx_v_olabel, __pyx_v__weight, __pyx_v_nextstate));
- /* "pywrapfst.pyx":3058
- * return "<Arc at 0x{:x}>".format(id(self))
+ /* "pywrapfst.pyx":3087
+ * return f"<Arc at 0x{id(self):x}>"
*
* def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate): # <<<<<<<<<<<<<<
- * cdef fst.WeightClass wc = _get_WeightClass_or_One(b"tropical", weight)
- * self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_One(b"tropical", weight)
+ * self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
*/
/* function exit code */
return __pyx_r;
}
-/* "pywrapfst.pyx":3062
- * self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
+/* "pywrapfst.pyx":3091
+ * self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
*
* cpdef Arc copy(self): # <<<<<<<<<<<<<<
* return Arc(self.ilabel, self.olabel, self.weight, self.nextstate)
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3062, __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, 3091, __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, 3062, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3091, __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, 3062, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Arc))))) __PYX_ERR(0, 3091, __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":3063
+ /* "pywrapfst.pyx":3092
*
* 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, 3063, __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, 3092, __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, 3063, __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, 3092, __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, 3063, __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, 3092, __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, 3063, __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, 3092, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3063, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3092, __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, 3063, __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, 3092, __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":3062
- * self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
+ /* "pywrapfst.pyx":3091
+ * self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
*
* cpdef Arc copy(self): # <<<<<<<<<<<<<<
* return Arc(self.ilabel, self.olabel, self.weight, self.nextstate)
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("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, 3062, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3067
+/* "pywrapfst.pyx":3096
* property ilabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
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("__get__", 0);
- /* "pywrapfst.pyx":3068
+ /* "pywrapfst.pyx":3097
*
* 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, 3068, __pyx_L1_error)
+ __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, 3068, __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3067
+ /* "pywrapfst.pyx":3096
* property ilabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3070
+/* "pywrapfst.pyx":3099
* return deref(self._arc).ilabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
static int __pyx_pw_9pywrapfst_3Arc_6ilabel_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_9pywrapfst_3Arc_6ilabel_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
int64 __pyx_v_value;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__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, 3070, __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, 3099, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
static int __pyx_pf_9pywrapfst_3Arc_6ilabel_2__set__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":3071
+ /* "pywrapfst.pyx":3100
*
* 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, 3071, __pyx_L1_error)
+ __PYX_ERR(0, 3100, __pyx_L1_error)
}
(*__pyx_v_self->_arc).ilabel = __pyx_v_value;
- /* "pywrapfst.pyx":3070
+ /* "pywrapfst.pyx":3099
* return deref(self._arc).ilabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3075
+/* "pywrapfst.pyx":3104
* property olabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
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("__get__", 0);
- /* "pywrapfst.pyx":3076
+ /* "pywrapfst.pyx":3105
*
* 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, 3076, __pyx_L1_error)
+ __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, 3076, __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3075
+ /* "pywrapfst.pyx":3104
* property olabel:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3078
+/* "pywrapfst.pyx":3107
* return deref(self._arc).olabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
static int __pyx_pw_9pywrapfst_3Arc_6olabel_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_9pywrapfst_3Arc_6olabel_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
int64 __pyx_v_value;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__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, 3078, __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, 3107, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
static int __pyx_pf_9pywrapfst_3Arc_6olabel_2__set__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":3079
+ /* "pywrapfst.pyx":3108
*
* 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, 3079, __pyx_L1_error)
+ __PYX_ERR(0, 3108, __pyx_L1_error)
}
(*__pyx_v_self->_arc).olabel = __pyx_v_value;
- /* "pywrapfst.pyx":3078
+ /* "pywrapfst.pyx":3107
* return deref(self._arc).olabel
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3083
+/* "pywrapfst.pyx":3112
* property weight:
*
* def __get__(self): # <<<<<<<<<<<<<<
- * cdef Weight weight = Weight.__new__(Weight)
- * weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
*/
/* Python wrapper */
}
static PyObject *__pyx_pf_9pywrapfst_3Arc_6weight___get__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_weight = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
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("__get__", 0);
- /* "pywrapfst.pyx":3084
+ /* "pywrapfst.pyx":3113
*
* def __get__(self):
- * cdef Weight weight = Weight.__new__(Weight) # <<<<<<<<<<<<<<
- * weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
- * return weight
+ * 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, 3084, __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, 3113, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":3085
+ /* "pywrapfst.pyx":3114
* def __get__(self):
- * cdef Weight weight = Weight.__new__(Weight)
- * weight._weight.reset(new fst.WeightClass(deref(self._arc).weight)) # <<<<<<<<<<<<<<
- * return weight
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(deref(self._arc).weight)) # <<<<<<<<<<<<<<
+ * return _weight
*
*/
- if (unlikely(((PyObject *)__pyx_v_weight) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 3085, __pyx_L1_error)
+ __PYX_ERR(0, 3114, __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, 3085, __pyx_L1_error)
+ __PYX_ERR(0, 3114, __pyx_L1_error)
}
- __pyx_v_weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_arc).weight));
+ __pyx_v__weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_arc).weight));
- /* "pywrapfst.pyx":3086
- * cdef Weight weight = Weight.__new__(Weight)
- * weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
- * return weight # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3115
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
+ * return _weight # <<<<<<<<<<<<<<
*
* def __set__(self, weight):
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_weight));
- __pyx_r = ((PyObject *)__pyx_v_weight);
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __pyx_r = ((PyObject *)__pyx_v__weight);
goto __pyx_L0;
- /* "pywrapfst.pyx":3083
+ /* "pywrapfst.pyx":3112
* property weight:
*
* def __get__(self): # <<<<<<<<<<<<<<
- * cdef Weight weight = Weight.__new__(Weight)
- * weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst.Arc.weight.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_weight);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":3088
- * return weight
+/* "pywrapfst.pyx":3117
+ * return _weight
*
* def __set__(self, weight): # <<<<<<<<<<<<<<
* deref(self._arc).weight = _get_WeightClass_or_One(b"tropical", weight)
int __pyx_r;
__Pyx_RefNannyDeclarations
fst::script::WeightClass __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":3089
+ /* "pywrapfst.pyx":3118
*
* def __set__(self, weight):
* deref(self._arc).weight = _get_WeightClass_or_One(b"tropical", weight) # <<<<<<<<<<<<<<
*
* property nextstate:
*/
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3089, __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, 3118, __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, 3089, __pyx_L1_error)
+ __PYX_ERR(0, 3118, __pyx_L1_error)
}
(*__pyx_v_self->_arc).weight = __pyx_t_1;
- /* "pywrapfst.pyx":3088
- * return weight
+ /* "pywrapfst.pyx":3117
+ * return _weight
*
* def __set__(self, weight): # <<<<<<<<<<<<<<
* deref(self._arc).weight = _get_WeightClass_or_One(b"tropical", weight)
return __pyx_r;
}
-/* "pywrapfst.pyx":3093
+/* "pywrapfst.pyx":3122
* property nextstate:
*
* def __get__(self): # <<<<<<<<<<<<<<
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("__get__", 0);
- /* "pywrapfst.pyx":3094
+ /* "pywrapfst.pyx":3123
*
* 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, 3094, __pyx_L1_error)
+ __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, 3094, __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3093
+ /* "pywrapfst.pyx":3122
* property nextstate:
*
* def __get__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3096
+/* "pywrapfst.pyx":3125
* return deref(self._arc).nextstate
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
static int __pyx_pw_9pywrapfst_3Arc_9nextstate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_9pywrapfst_3Arc_9nextstate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
int64 __pyx_v_value;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__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, 3096, __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, 3125, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
static int __pyx_pf_9pywrapfst_3Arc_9nextstate_2__set__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "pywrapfst.pyx":3097
+ /* "pywrapfst.pyx":3126
*
* 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, 3097, __pyx_L1_error)
+ __PYX_ERR(0, 3126, __pyx_L1_error)
}
(*__pyx_v_self->_arc).nextstate = __pyx_v_value;
- /* "pywrapfst.pyx":3096
+ /* "pywrapfst.pyx":3125
* return deref(self._arc).nextstate
*
* def __set__(self, int64 value): # <<<<<<<<<<<<<<
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("__reduce_cython__", 0);
/* "(tree fragment)":2
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._arc cannot be converted to a Python object for pickling")
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
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("__setstate_cython__", 0);
/* "(tree fragment)":4
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._arc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3100
+/* "pywrapfst.pyx":3129
*
*
* cdef Arc _init_Arc(const fst.ArcClass &arc): # <<<<<<<<<<<<<<
- * cdef Weight weight = Weight.__new__(Weight)
- * weight._weight.reset(new fst.WeightClass(arc.weight))
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(arc.weight))
*/
static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst__init_Arc(fst::script::ArcClass const &__pyx_v_arc) {
- struct __pyx_obj_9pywrapfst_Weight *__pyx_v_weight = 0;
+ struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 0;
struct __pyx_obj_9pywrapfst_Arc *__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;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_init_Arc", 0);
- /* "pywrapfst.pyx":3101
+ /* "pywrapfst.pyx":3130
*
* 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)
+ * 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, 3101, __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, 3130, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
+ __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":3102
+ /* "pywrapfst.pyx":3131
* 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)
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(arc.weight)) # <<<<<<<<<<<<<<
+ * return Arc(arc.ilabel, arc.olabel, _weight, arc.nextstate)
*
*/
- if (unlikely(((PyObject *)__pyx_v_weight) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
- __PYX_ERR(0, 3102, __pyx_L1_error)
+ __PYX_ERR(0, 3131, __pyx_L1_error)
}
- __pyx_v_weight->_weight.reset(new fst::script::WeightClass(__pyx_v_arc.weight));
+ __pyx_v__weight->_weight.reset(new fst::script::WeightClass(__pyx_v_arc.weight));
- /* "pywrapfst.pyx":3103
- * cdef Weight weight = Weight.__new__(Weight)
- * weight._weight.reset(new fst.WeightClass(arc.weight))
- * return Arc(arc.ilabel, arc.olabel, weight, arc.nextstate) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3132
+ * 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, 3103, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.olabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3103, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.nextstate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3103, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3103, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_weight));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_weight));
- PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_weight));
+ __Pyx_INCREF(((PyObject *)__pyx_v__weight));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v__weight));
+ PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v__weight));
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
__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, 3103, __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, 3132, __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":3100
+ /* "pywrapfst.pyx":3129
*
*
* cdef Arc _init_Arc(const fst.ArcClass &arc): # <<<<<<<<<<<<<<
- * cdef Weight weight = Weight.__new__(Weight)
- * weight._weight.reset(new fst.WeightClass(arc.weight))
+ * cdef Weight _weight = Weight.__new__(Weight)
+ * _weight._weight.reset(new fst.WeightClass(arc.weight))
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst._init_Arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_weight);
+ __Pyx_XDECREF((PyObject *)__pyx_v__weight);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":3114
+/* "pywrapfst.pyx":3143
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<ArcIterator at 0x{:x}>".format(id(self))
+ * return f"<ArcIterator at 0x{id(self):x}>"
*
*/
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3115
+ /* "pywrapfst.pyx":3144
*
* def __repr__(self):
- * return "<ArcIterator at 0x{:x}>".format(id(self)) # <<<<<<<<<<<<<<
+ * return f"<ArcIterator at 0x{id(self):x}>" # <<<<<<<<<<<<<<
*
* def __init__(self, Fst ifst, int64 state):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_ArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3115, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3115, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- }
- }
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3115, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3144, __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;
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u_ArcIterator_at_0x);
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__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_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":3114
+ /* "pywrapfst.pyx":3143
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<ArcIterator at 0x{:x}>".format(id(self))
+ * return f"<ArcIterator at 0x{id(self):x}>"
*
*/
/* 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_AddTraceback("pywrapfst.ArcIterator.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":3117
- * return "<ArcIterator at 0x{:x}>".format(id(self))
+/* "pywrapfst.pyx":3146
+ * return f"<ArcIterator at 0x{id(self):x}>"
*
* def __init__(self, Fst ifst, int64 state): # <<<<<<<<<<<<<<
* if not ifst._fst.get().ValidStateId(state):
static int __pyx_pw_9pywrapfst_11ArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
int64 __pyx_v_state;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
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, 3117, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3146, __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, 3117, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3146, __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, 3117, __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, 3146, __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, 3117, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3146, __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, 3117, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3146, __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 */
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::shared_ptr<fst::script::FstClass> __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":3118
+ /* "pywrapfst.pyx":3147
*
* 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, 3118, __pyx_L1_error)
+ __PYX_ERR(0, 3147, __pyx_L1_error)
}
__pyx_t_1 = ((!(__pyx_v_ifst->_fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
- /* "pywrapfst.pyx":3119
+ /* "pywrapfst.pyx":3148
* 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, 3119, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3148, __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, 3119, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3148, __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, 3119, __pyx_L1_error)
+ __PYX_ERR(0, 3148, __pyx_L1_error)
- /* "pywrapfst.pyx":3118
+ /* "pywrapfst.pyx":3147
*
* def __init__(self, Fst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3121
+ /* "pywrapfst.pyx":3150
* 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, 3121, __pyx_L1_error)
+ __PYX_ERR(0, 3150, __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, 3121, __pyx_L1_error)
+ __PYX_ERR(0, 3150, __pyx_L1_error)
}
__pyx_v_self->_fst = __pyx_t_5;
- /* "pywrapfst.pyx":3122
+ /* "pywrapfst.pyx":3151
* # 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, 3122, __pyx_L1_error)
+ __PYX_ERR(0, 3151, __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, 3122, __pyx_L1_error)
+ __PYX_ERR(0, 3151, __pyx_L1_error)
}
__pyx_v_self->_aiter.reset(new fst::script::ArcIteratorClass((*__pyx_v_self->_fst), __pyx_v_state));
- /* "pywrapfst.pyx":3117
- * return "<ArcIterator at 0x{:x}>".format(id(self))
+ /* "pywrapfst.pyx":3146
+ * return f"<ArcIterator at 0x{id(self):x}>"
*
* def __init__(self, Fst ifst, int64 state): # <<<<<<<<<<<<<<
* if not ifst._fst.get().ValidStateId(state):
return __pyx_r;
}
-/* "pywrapfst.pyx":3125
+/* "pywrapfst.pyx":3154
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":3126
+ /* "pywrapfst.pyx":3155
* # 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":3125
+ /* "pywrapfst.pyx":3154
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3129
+/* "pywrapfst.pyx":3158
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "pywrapfst.pyx":3130
+ /* "pywrapfst.pyx":3159
* # 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, 3130, __pyx_L1_error)
+ __PYX_ERR(0, 3159, __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":3131
+ /* "pywrapfst.pyx":3160
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* self.next()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 3131, __pyx_L1_error)
+ __PYX_ERR(0, 3160, __pyx_L1_error)
- /* "pywrapfst.pyx":3130
+ /* "pywrapfst.pyx":3159
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3132
+ /* "pywrapfst.pyx":3161
* 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, 3132, __pyx_L1_error)
+ __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, 3132, __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_GOTREF(__pyx_t_2);
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "pywrapfst.pyx":3133
+ /* "pywrapfst.pyx":3162
* 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, 3133, __pyx_L1_error)
+ __PYX_ERR(0, 3162, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3134
+ /* "pywrapfst.pyx":3163
* result = self.value()
* self.next()
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "pywrapfst.pyx":3129
+ /* "pywrapfst.pyx":3158
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3136
+/* "pywrapfst.pyx":3165
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
bool __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("done", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3136, __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, 3165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_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, 3136, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3136, __pyx_L1_error)
+ __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_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":3145
+ /* "pywrapfst.pyx":3174
* 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, 3145, __pyx_L1_error)
+ __PYX_ERR(0, 3174, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3136
+ /* "pywrapfst.pyx":3165
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
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("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, 3136, __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, 3165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3147
+/* "pywrapfst.pyx":3176
* return self._aiter.get().Done()
*
* cpdef uint8 flags(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
uint8 __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("flags", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3147, __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, 3176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_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, 3147, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3147, __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, 3176, __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":3156
+ /* "pywrapfst.pyx":3185
* 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, 3156, __pyx_L1_error)
+ __PYX_ERR(0, 3185, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":3147
+ /* "pywrapfst.pyx":3176
* return self._aiter.get().Done()
*
* cpdef uint8 flags(self): # <<<<<<<<<<<<<<
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("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, 3147, __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, 3176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3158
+/* "pywrapfst.pyx":3187
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("next", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3158, __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, 3187, __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, 3158, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3187, __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":3164
+ /* "pywrapfst.pyx":3193
* 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, 3164, __pyx_L1_error)
+ __PYX_ERR(0, 3193, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Next();
- /* "pywrapfst.pyx":3158
+ /* "pywrapfst.pyx":3187
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
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("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, 3158, __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, 3187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3166
+/* "pywrapfst.pyx":3195
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
size_t __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("position", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3166, __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, 3195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_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, 3166, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3195, __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, 3166, __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, 3195, __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":3175
+ /* "pywrapfst.pyx":3204
* 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, 3175, __pyx_L1_error)
+ __PYX_ERR(0, 3204, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Position();
goto __pyx_L0;
- /* "pywrapfst.pyx":3166
+ /* "pywrapfst.pyx":3195
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
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("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, 3166, __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, 3195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3177
+/* "pywrapfst.pyx":3206
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reset", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3177, __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, 3206, __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, 3177, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3206, __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":3183
+ /* "pywrapfst.pyx":3212
* 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, 3183, __pyx_L1_error)
+ __PYX_ERR(0, 3212, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Reset();
- /* "pywrapfst.pyx":3177
+ /* "pywrapfst.pyx":3206
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
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("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, 3177, __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, 3206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3185
+/* "pywrapfst.pyx":3214
* self._aiter.get().Reset()
*
* cpdef void seek(self, size_t a): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("seek", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3185, __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, 3214, __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, 3185, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3214, __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, 3185, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3214, __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":3194
+ /* "pywrapfst.pyx":3223
* 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, 3194, __pyx_L1_error)
+ __PYX_ERR(0, 3223, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Seek(__pyx_v_a);
- /* "pywrapfst.pyx":3185
+ /* "pywrapfst.pyx":3214
* self._aiter.get().Reset()
*
* cpdef void seek(self, size_t a): # <<<<<<<<<<<<<<
static char __pyx_doc_9pywrapfst_11ArcIterator_18seek[] = "\n seek(self, a)\n\n Advance the iterator to a new position.\n\n Args:\n a: The position to seek to.\n ";
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_19seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a) {
size_t __pyx_v_a;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__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, 3185, __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, 3214, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
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("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, 3185, __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, 3214, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3196
+/* "pywrapfst.pyx":3225
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint8 flags, uint8 mask): # <<<<<<<<<<<<<<
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_flags", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3196, __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, 3225, __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, 3196, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3225, __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, 3196, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3225, __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, 3196, __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, 3225, __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, 3196, __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, 3225, __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, 3196, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3225, __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, 3196, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
#endif
}
- /* "pywrapfst.pyx":3206
+ /* "pywrapfst.pyx":3235
* 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, 3206, __pyx_L1_error)
+ __PYX_ERR(0, 3235, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);
- /* "pywrapfst.pyx":3196
+ /* "pywrapfst.pyx":3225
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint8 flags, uint8 mask): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_21set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
uint8 __pyx_v_flags;
uint8 __pyx_v_mask;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_flags (wrapper)", 0);
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, 3196, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3225, __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, 3196, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3225, __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, 3196, __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, 3196, __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, 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)
}
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, 3196, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3225, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.ArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
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("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, 3196, __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, 3225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3208
+/* "pywrapfst.pyx":3237
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef object value(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("value", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3208, __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, 3237, __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, 3208, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3237, __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":3214
+ /* "pywrapfst.pyx":3243
* 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, 3214, __pyx_L1_error)
+ __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, 3214, __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3208
+ /* "pywrapfst.pyx":3237
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef object value(self): # <<<<<<<<<<<<<<
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("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, 3208, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
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("__reduce_cython__", 0);
/* "(tree fragment)":2
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling")
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
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("__setstate_cython__", 0);
/* "(tree fragment)":4
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3226
+/* "pywrapfst.pyx":3255
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<MutableArcIterator at 0x{:x}>".format(id(self))
+ * return f"<MutableArcIterator at 0x{id(self):x}>"
*
*/
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3227
+ /* "pywrapfst.pyx":3256
*
* def __repr__(self):
- * return "<MutableArcIterator at 0x{:x}>".format(id(self)) # <<<<<<<<<<<<<<
+ * return f"<MutableArcIterator at 0x{id(self):x}>" # <<<<<<<<<<<<<<
*
* def __init__(self, MutableFst ifst, int64 state):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_MutableArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3227, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3227, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- }
- }
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3227, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3256, __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;
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u_MutableArcIterator_at_0x);
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__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_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":3226
+ /* "pywrapfst.pyx":3255
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<MutableArcIterator at 0x{:x}>".format(id(self))
+ * return f"<MutableArcIterator at 0x{id(self):x}>"
*
*/
/* 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_AddTraceback("pywrapfst.MutableArcIterator.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":3229
- * return "<MutableArcIterator at 0x{:x}>".format(id(self))
+/* "pywrapfst.pyx":3258
+ * return f"<MutableArcIterator at 0x{id(self):x}>"
*
* def __init__(self, MutableFst ifst, int64 state): # <<<<<<<<<<<<<<
* if not ifst._fst.get().ValidStateId(state):
static int __pyx_pw_9pywrapfst_18MutableArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_ifst = 0;
int64 __pyx_v_state;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
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, 3229, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3258, __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, 3229, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3258, __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, 3229, __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, 3258, __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, 3229, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3258, __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, 3229, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_MutableFst, 1, "ifst", 0))) __PYX_ERR(0, 3258, __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 */
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::shared_ptr<fst::script::MutableFstClass> __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":3230
+ /* "pywrapfst.pyx":3259
*
* 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, 3230, __pyx_L1_error)
+ __PYX_ERR(0, 3259, __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":3231
+ /* "pywrapfst.pyx":3260
* 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, 3231, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3260, __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, 3231, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3260, __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, 3231, __pyx_L1_error)
+ __PYX_ERR(0, 3260, __pyx_L1_error)
- /* "pywrapfst.pyx":3230
+ /* "pywrapfst.pyx":3259
*
* def __init__(self, MutableFst ifst, int64 state):
* if not ifst._fst.get().ValidStateId(state): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3233
+ /* "pywrapfst.pyx":3262
* 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, 3233, __pyx_L1_error)
+ __PYX_ERR(0, 3262, __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, 3233, __pyx_L1_error)
+ __PYX_ERR(0, 3262, __pyx_L1_error)
}
__pyx_v_self->_mfst = __pyx_t_5;
- /* "pywrapfst.pyx":3234
+ /* "pywrapfst.pyx":3263
* # 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, 3234, __pyx_L1_error)
+ __PYX_ERR(0, 3263, __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, 3234, __pyx_L1_error)
+ __PYX_ERR(0, 3263, __pyx_L1_error)
}
__pyx_v_self->_aiter.reset(new fst::script::MutableArcIteratorClass(__pyx_v_ifst->_mfst.get(), __pyx_v_state));
- /* "pywrapfst.pyx":3229
- * return "<MutableArcIterator at 0x{:x}>".format(id(self))
+ /* "pywrapfst.pyx":3258
+ * return f"<MutableArcIterator at 0x{id(self):x}>"
*
* def __init__(self, MutableFst ifst, int64 state): # <<<<<<<<<<<<<<
* if not ifst._fst.get().ValidStateId(state):
}
static PyObject *__pyx_gb_9pywrapfst_18MutableArcIterator_6generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
-/* "pywrapfst.pyx":3237
+/* "pywrapfst.pyx":3266
*
* # Magic method used to get a Pythonic Iterator API out of the C++ API.
* def __iter__(self): # <<<<<<<<<<<<<<
struct __pyx_obj_9pywrapfst___pyx_scope_struct____iter__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
__pyx_cur_scope = (struct __pyx_obj_9pywrapfst___pyx_scope_struct____iter__ *)__pyx_tp_new_9pywrapfst___pyx_scope_struct____iter__(__pyx_ptype_9pywrapfst___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
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, 3237, __pyx_L1_error)
+ __PYX_ERR(0, 3266, __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, 3237, __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, 3266, __pyx_L1_error)
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
PyObject *__pyx_r = NULL;
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
switch (__pyx_generator->resume_label) {
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3237, __pyx_L1_error)
+ if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3266, __pyx_L1_error)
- /* "pywrapfst.pyx":3238
+ /* "pywrapfst.pyx":3267
* # 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, 3238, __pyx_L1_error)
+ __PYX_ERR(0, 3267, __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":3239
+ /* "pywrapfst.pyx":3268
* 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, 3239, __pyx_L1_error)
+ __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, 3239, __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_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, 3239, __pyx_L1_error)
+ if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3268, __pyx_L1_error)
- /* "pywrapfst.pyx":3240
+ /* "pywrapfst.pyx":3269
* 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, 3240, __pyx_L1_error)
+ __PYX_ERR(0, 3269, __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":3237
+ /* "pywrapfst.pyx":3266
*
* # Magic method used to get a Pythonic Iterator API out of the C++ API.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3242
+/* "pywrapfst.pyx":3271
* self.next()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
bool __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("done", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3242, __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, 3271, __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, 3242, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3271, __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, 3242, __pyx_L1_error)
+ __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_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":3251
+ /* "pywrapfst.pyx":3280
* 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, 3251, __pyx_L1_error)
+ __PYX_ERR(0, 3280, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3242
+ /* "pywrapfst.pyx":3271
* self.next()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
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("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, 3242, __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, 3271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3253
+/* "pywrapfst.pyx":3282
* return self._aiter.get().Done()
*
* cpdef uint8 flags(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
uint8 __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("flags", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3253, __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, 3282, __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, 3253, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3282, __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, 3253, __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, 3282, __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":3262
+ /* "pywrapfst.pyx":3291
* 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, 3262, __pyx_L1_error)
+ __PYX_ERR(0, 3291, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Flags();
goto __pyx_L0;
- /* "pywrapfst.pyx":3253
+ /* "pywrapfst.pyx":3282
* return self._aiter.get().Done()
*
* cpdef uint8 flags(self): # <<<<<<<<<<<<<<
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("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, 3253, __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, 3282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3264
+/* "pywrapfst.pyx":3293
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("next", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3264, __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, 3293, __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, 3264, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3293, __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":3270
+ /* "pywrapfst.pyx":3299
* 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, 3270, __pyx_L1_error)
+ __PYX_ERR(0, 3299, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Next();
- /* "pywrapfst.pyx":3264
+ /* "pywrapfst.pyx":3293
* return self._aiter.get().Flags()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
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("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, 3264, __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, 3293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3272
+/* "pywrapfst.pyx":3301
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
size_t __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("position", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3272, __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, 3301, __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, 3272, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3301, __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, 3272, __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, 3301, __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":3281
+ /* "pywrapfst.pyx":3310
* 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, 3281, __pyx_L1_error)
+ __PYX_ERR(0, 3310, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_aiter.get()->Position();
goto __pyx_L0;
- /* "pywrapfst.pyx":3272
+ /* "pywrapfst.pyx":3301
* self._aiter.get().Next()
*
* cpdef size_t position(self): # <<<<<<<<<<<<<<
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("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, 3272, __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, 3301, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3283
+/* "pywrapfst.pyx":3312
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reset", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3283, __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, 3312, __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, 3283, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3312, __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":3289
+ /* "pywrapfst.pyx":3318
* 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, 3289, __pyx_L1_error)
+ __PYX_ERR(0, 3318, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Reset();
- /* "pywrapfst.pyx":3283
+ /* "pywrapfst.pyx":3312
* return self._aiter.get().Position()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
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("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, 3283, __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, 3312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3291
+/* "pywrapfst.pyx":3320
* self._aiter.get().Reset()
*
* cpdef void seek(self, size_t a): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("seek", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3291, __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, 3320, __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, 3291, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3320, __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, 3291, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3320, __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":3300
+ /* "pywrapfst.pyx":3329
* 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, 3300, __pyx_L1_error)
+ __PYX_ERR(0, 3329, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->Seek(__pyx_v_a);
- /* "pywrapfst.pyx":3291
+ /* "pywrapfst.pyx":3320
* self._aiter.get().Reset()
*
* cpdef void seek(self, size_t a): # <<<<<<<<<<<<<<
static char __pyx_doc_9pywrapfst_18MutableArcIterator_17seek[] = "\n seek(self, a)\n\n Advance the iterator to a new position.\n\n Args:\n a: The position to seek to.\n ";
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_18seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a) {
size_t __pyx_v_a;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__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, 3291, __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, 3320, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
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("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, 3291, __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, 3320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3302
+/* "pywrapfst.pyx":3331
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint8 flags, uint8 mask): # <<<<<<<<<<<<<<
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_flags", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3302, __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, 3331, __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, 3302, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3331, __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, 3302, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3331, __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, 3302, __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, 3331, __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, 3302, __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, 3331, __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, 3302, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3331, __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, 3302, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
#endif
}
- /* "pywrapfst.pyx":3312
+ /* "pywrapfst.pyx":3341
* 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, 3312, __pyx_L1_error)
+ __PYX_ERR(0, 3341, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);
- /* "pywrapfst.pyx":3302
+ /* "pywrapfst.pyx":3331
* self._aiter.get().Seek(a)
*
* cpdef void set_flags(self, uint8 flags, uint8 mask): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_20set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
uint8 __pyx_v_flags;
uint8 __pyx_v_mask;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_flags (wrapper)", 0);
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, 3302, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3331, __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, 3302, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3331, __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, 3302, __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, 3302, __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, 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)
}
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, 3302, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3331, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.MutableArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
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("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, 3302, __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, 3331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3314
+/* "pywrapfst.pyx":3343
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef void set_value(self, Arc arc): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_value", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3314, __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, 3343, __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, 3314, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3343, __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":3323
+ /* "pywrapfst.pyx":3352
* 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, 3323, __pyx_L1_error)
+ __PYX_ERR(0, 3352, __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, 3323, __pyx_L1_error)
+ __PYX_ERR(0, 3352, __pyx_L1_error)
}
__pyx_v_self->_aiter.get()->SetValue((*__pyx_v_arc->_arc));
- /* "pywrapfst.pyx":3314
+ /* "pywrapfst.pyx":3343
* self._aiter.get().SetFlags(flags, mask)
*
* cpdef void set_value(self, Arc arc): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_22set_value(PyObject *__pyx_v_self, PyObject *__pyx_v_arc); /*proto*/
static char __pyx_doc_9pywrapfst_18MutableArcIterator_21set_value[] = "\n set_value(self, arc)\n\n Replace the current arc with a new arc.\n\n Args:\n arc: The arc to replace the current arc with.\n ";
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_22set_value(PyObject *__pyx_v_self, PyObject *__pyx_v_arc) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
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, 3314, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 3343, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_21set_value(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_arc));
/* function exit code */
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ 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, 3314, __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, 3343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3325
+/* "pywrapfst.pyx":3354
* self._aiter.get().SetValue(deref(arc._arc))
*
* cpdef object value(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("value", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3325, __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, 3354, __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, 3325, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3354, __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":3331
+ /* "pywrapfst.pyx":3360
* 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, 3331, __pyx_L1_error)
+ __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, 3331, __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3325
+ /* "pywrapfst.pyx":3354
* self._aiter.get().SetValue(deref(arc._arc))
*
* cpdef object value(self): # <<<<<<<<<<<<<<
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("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, 3325, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
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("__reduce_cython__", 0);
/* "(tree fragment)":2
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling")
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
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("__setstate_cython__", 0);
/* "(tree fragment)":4
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3345
+/* "pywrapfst.pyx":3374
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<StateIterator at 0x{:x}>".format(id(self))
+ * return f"<StateIterator at 0x{id(self):x}>"
*
*/
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":3346
+ /* "pywrapfst.pyx":3375
*
* def __repr__(self):
- * return "<StateIterator at 0x{:x}>".format(id(self)) # <<<<<<<<<<<<<<
+ * return f"<StateIterator at 0x{id(self):x}>" # <<<<<<<<<<<<<<
*
* def __init__(self, Fst ifst):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_StateIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- }
- }
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3346, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3375, __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;
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u_StateIterator_at_0x);
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__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_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":3345
+ /* "pywrapfst.pyx":3374
* """
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<StateIterator at 0x{:x}>".format(id(self))
+ * return f"<StateIterator at 0x{id(self):x}>"
*
*/
/* 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_AddTraceback("pywrapfst.StateIterator.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":3348
- * return "<StateIterator at 0x{:x}>".format(id(self))
+/* "pywrapfst.pyx":3377
+ * return f"<StateIterator at 0x{id(self):x}>"
*
* def __init__(self, Fst ifst): # <<<<<<<<<<<<<<
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
static int __pyx_pw_9pywrapfst_13StateIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_13StateIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
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, 3348, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3377, __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, 3348, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3377, __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, 3348, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3377, __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_r;
__Pyx_RefNannyDeclarations
std::shared_ptr<fst::script::FstClass> __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":3350
+ /* "pywrapfst.pyx":3379
* 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, 3350, __pyx_L1_error)
+ __PYX_ERR(0, 3379, __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, 3350, __pyx_L1_error)
+ __PYX_ERR(0, 3379, __pyx_L1_error)
}
__pyx_v_self->_fst = __pyx_t_1;
- /* "pywrapfst.pyx":3351
+ /* "pywrapfst.pyx":3380
* # 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, 3351, __pyx_L1_error)
+ __PYX_ERR(0, 3380, __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, 3351, __pyx_L1_error)
+ __PYX_ERR(0, 3380, __pyx_L1_error)
}
__pyx_v_self->_siter.reset(new fst::script::StateIteratorClass((*__pyx_v_self->_fst)));
- /* "pywrapfst.pyx":3348
- * return "<StateIterator at 0x{:x}>".format(id(self))
+ /* "pywrapfst.pyx":3377
+ * return f"<StateIterator at 0x{id(self):x}>"
*
* def __init__(self, Fst ifst): # <<<<<<<<<<<<<<
* # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
return __pyx_r;
}
-/* "pywrapfst.pyx":3354
+/* "pywrapfst.pyx":3383
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "pywrapfst.pyx":3355
+ /* "pywrapfst.pyx":3384
* # 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":3354
+ /* "pywrapfst.pyx":3383
*
* # This just registers this class as a possible iterator.
* def __iter__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3358
+/* "pywrapfst.pyx":3387
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "pywrapfst.pyx":3359
+ /* "pywrapfst.pyx":3388
* # 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, 3359, __pyx_L1_error)
+ __PYX_ERR(0, 3388, __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":3360
+ /* "pywrapfst.pyx":3389
* def __next__(self):
* if self.done():
* raise StopIteration # <<<<<<<<<<<<<<
* self.next()
*/
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
- __PYX_ERR(0, 3360, __pyx_L1_error)
+ __PYX_ERR(0, 3389, __pyx_L1_error)
- /* "pywrapfst.pyx":3359
+ /* "pywrapfst.pyx":3388
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self):
* if self.done(): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":3361
+ /* "pywrapfst.pyx":3390
* 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, 3361, __pyx_L1_error)
+ __PYX_ERR(0, 3390, __pyx_L1_error)
}
__pyx_v_result = ((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3362
+ /* "pywrapfst.pyx":3391
* 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, 3362, __pyx_L1_error)
+ __PYX_ERR(0, 3391, __pyx_L1_error)
}
((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
- /* "pywrapfst.pyx":3363
+ /* "pywrapfst.pyx":3392
* 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, 3363, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3358
+ /* "pywrapfst.pyx":3387
*
* # Magic method used to get a Pythonic API out of the C++ API.
* def __next__(self): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "pywrapfst.pyx":3365
+/* "pywrapfst.pyx":3394
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
bool __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("done", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3365, __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, 3394, __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, 3365, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3394, __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, 3365, __pyx_L1_error)
+ __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_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":3374
+ /* "pywrapfst.pyx":3403
* 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, 3374, __pyx_L1_error)
+ __PYX_ERR(0, 3403, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":3365
+ /* "pywrapfst.pyx":3394
* return result
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
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("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, 3365, __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, 3394, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3376
+/* "pywrapfst.pyx":3405
* return self._siter.get().Done()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("next", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3376, __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, 3405, __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, 3376, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3405, __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":3382
+ /* "pywrapfst.pyx":3411
* 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, 3382, __pyx_L1_error)
+ __PYX_ERR(0, 3411, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Next();
- /* "pywrapfst.pyx":3376
+ /* "pywrapfst.pyx":3405
* return self._siter.get().Done()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
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("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, 3376, __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, 3405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3384
+/* "pywrapfst.pyx":3413
* self._siter.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reset", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3384, __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, 3413, __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, 3384, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3413, __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":3390
+ /* "pywrapfst.pyx":3419
* 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, 3390, __pyx_L1_error)
+ __PYX_ERR(0, 3419, __pyx_L1_error)
}
__pyx_v_self->_siter.get()->Reset();
- /* "pywrapfst.pyx":3384
+ /* "pywrapfst.pyx":3413
* self._siter.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
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("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, 3384, __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, 3413, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3392
+/* "pywrapfst.pyx":3421
* self._siter.get().Reset()
*
* cpdef int64 value(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int64 __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("value", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 3392, __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, 3421, __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, 3392, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3421, __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, 3392, __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, 3421, __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":3398
+ /* "pywrapfst.pyx":3427
* 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, 3398, __pyx_L1_error)
+ __PYX_ERR(0, 3427, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_siter.get()->Value();
goto __pyx_L0;
- /* "pywrapfst.pyx":3392
+ /* "pywrapfst.pyx":3421
* self._siter.get().Reset()
*
* cpdef int64 value(self): # <<<<<<<<<<<<<<
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("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, 3392, __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, 3421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
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("__reduce_cython__", 0);
/* "(tree fragment)":2
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling")
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
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("__setstate_cython__", 0);
/* "(tree fragment)":4
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3404
+/* "pywrapfst.pyx":3433
*
*
* cdef Fst _map(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * map_type=b"identity",
+ * map_type="identity",
*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__map(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, struct __pyx_opt_args_9pywrapfst__map *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__30;
- PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_b_identity);
+ float __pyx_v_delta = __pyx_k__32;
+ PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_u_identity);
double __pyx_v_power = ((double)1.);
- /* "pywrapfst.pyx":3408
- * map_type=b"identity",
+ /* "pywrapfst.pyx":3437
+ * map_type="identity",
* double power=1.,
* weight=None): # <<<<<<<<<<<<<<
- * cdef fst.MapType map_type_enum
- * if not fst.GetMapType(tostring(map_type), addr(map_type_enum)):
+ * cdef fst.MapType _map_type
+ * if not fst.GetMapType(tostring(map_type), addr(_map_type)):
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- enum fst::script::MapType __pyx_v_map_type_enum;
- fst::script::WeightClass __pyx_v_wc;
+ enum fst::script::MapType __pyx_v__map_type;
+ fst::script::WeightClass __pyx_v__weight;
struct __pyx_obj_9pywrapfst_Fst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- fst::script::WeightClass __pyx_t_8;
+ fst::script::WeightClass __pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_map", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3410
+ /* "pywrapfst.pyx":3439
* weight=None):
- * cdef fst.MapType map_type_enum
- * if not fst.GetMapType(tostring(map_type), addr(map_type_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown map type: {!r}".format(map_type))
- * cdef fst.WeightClass wc
+ * 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, 3410, __pyx_L1_error)
- __pyx_t_2 = ((!(fst::script::GetMapType(__pyx_t_1, (&__pyx_v_map_type_enum)) != 0)) != 0);
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_map_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3439, __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":3411
- * cdef fst.MapType map_type_enum
- * if not fst.GetMapType(tostring(map_type), addr(map_type_enum)):
- * raise FstArgError("Unknown map type: {!r}".format(map_type)) # <<<<<<<<<<<<<<
- * cdef fst.WeightClass wc
- * if map_type_enum == fst.TIMES_MAPPER:
+ /* "pywrapfst.pyx":3440
+ * 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, 3411, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_map_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3411, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_map_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_map_type);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3411, __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, 3440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
+ __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_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
+ __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_6);
+ __Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3411, __pyx_L1_error)
+ __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)
__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, 3411, __pyx_L1_error)
+ __PYX_ERR(0, 3440, __pyx_L1_error)
- /* "pywrapfst.pyx":3410
+ /* "pywrapfst.pyx":3439
* weight=None):
- * cdef fst.MapType map_type_enum
- * if not fst.GetMapType(tostring(map_type), addr(map_type_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown map type: {!r}".format(map_type))
- * cdef fst.WeightClass wc
+ * 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
*/
}
- /* "pywrapfst.pyx":3413
- * raise FstArgError("Unknown map type: {!r}".format(map_type))
- * cdef fst.WeightClass wc
- * if map_type_enum == fst.TIMES_MAPPER: # <<<<<<<<<<<<<<
- * wc = _get_WeightClass_or_One(ifst.weight_type(), weight)
+ /* "pywrapfst.pyx":3442
+ * 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)
* else:
*/
- __pyx_t_2 = ((__pyx_v_map_type_enum == fst::script::TIMES_MAPPER) != 0);
+ __pyx_t_2 = ((__pyx_v__map_type == fst::script::TIMES_MAPPER) != 0);
if (__pyx_t_2) {
- /* "pywrapfst.pyx":3414
- * cdef fst.WeightClass wc
- * if map_type_enum == fst.TIMES_MAPPER:
- * wc = _get_WeightClass_or_One(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3443
+ * cdef fst.WeightClass _weight
+ * if _map_type == fst.TIMES_MAPPER:
+ * _weight = _get_WeightClass_or_One(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
* else:
- * wc = _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, 3414, __pyx_L1_error)
+ __PYX_ERR(0, 3443, __pyx_L1_error)
}
- __pyx_t_8 = __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, 3414, __pyx_L1_error)
- __pyx_v_wc = __pyx_t_8;
+ __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_v__weight = __pyx_t_7;
- /* "pywrapfst.pyx":3413
- * raise FstArgError("Unknown map type: {!r}".format(map_type))
- * cdef fst.WeightClass wc
- * if map_type_enum == fst.TIMES_MAPPER: # <<<<<<<<<<<<<<
- * wc = _get_WeightClass_or_One(ifst.weight_type(), weight)
+ /* "pywrapfst.pyx":3442
+ * 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)
* else:
*/
goto __pyx_L4;
}
- /* "pywrapfst.pyx":3416
- * wc = _get_WeightClass_or_One(ifst.weight_type(), weight)
+ /* "pywrapfst.pyx":3445
+ * _weight = _get_WeightClass_or_One(ifst.weight_type(), weight)
* else:
- * wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
- * return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, power, wc))
+ * _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, 3416, __pyx_L1_error)
+ __PYX_ERR(0, 3445, __pyx_L1_error)
}
- __pyx_t_8 = __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, 3416, __pyx_L1_error)
- __pyx_v_wc = __pyx_t_8;
+ __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_v__weight = __pyx_t_7;
}
__pyx_L4:;
- /* "pywrapfst.pyx":3417
+ /* "pywrapfst.pyx":3446
* else:
- * wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
- * return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, power, wc)) # <<<<<<<<<<<<<<
+ * _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, 3417, __pyx_L1_error)
+ __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_enum, __pyx_v_delta, __pyx_v_power, __pyx_v_wc))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3417, __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_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3404
+ /* "pywrapfst.pyx":3433
*
*
* cdef Fst _map(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * map_type=b"identity",
+ * map_type="identity",
*/
/* function exit code */
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pywrapfst._map", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":3420
+/* "pywrapfst.pyx":3449
*
*
* cpdef Fst arcmap(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * map_type=b"identity",
+ * map_type="identity",
*/
static PyObject *__pyx_pw_9pywrapfst_21arcmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst_arcmap(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_arcmap *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__31;
- PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_b_identity);
+ float __pyx_v_delta = __pyx_k__33;
+ PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_u_identity);
double __pyx_v_power = ((double)1.);
- /* "pywrapfst.pyx":3424
- * map_type=b"identity",
+ /* "pywrapfst.pyx":3453
+ * map_type="identity",
* double power=1.,
* weight=None): # <<<<<<<<<<<<<<
* """
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst__map __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arcmap", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3465
+ /* "pywrapfst.pyx":3493
* 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, 3465, __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, 3493, __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":3420
+ /* "pywrapfst.pyx":3449
*
*
* cpdef Fst arcmap(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * map_type=b"identity",
+ * map_type="identity",
*/
/* function exit code */
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_21arcmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_20arcmap[] = "\n arcmap(ifst, delta=0.0009765625, map_type=\"identity\", power=1., weight=None)\n\n Constructively applies a transform to all arcs and final states.\n\n This operation transforms each arc and final state in the input FST using\n one of the following:\n\n * identity: maps to self.\n * input_epsilon: replaces all input labels with epsilon.\n * invert: reciprocates all non-Zero weights.\n * float_power: raises all weights to a floating-point power.\n * output_epsilon: replaces all output labels with epsilon.\n * quantize: quantizes weights.\n * plus: adds a constant to all weights.\n * power: raises all weights to an integral power.\n * rmweight: replaces all non-Zero weights with 1.\n * superfinal: redirects final states to a new superfinal state.\n * times: right-multiplies a constant by all weights.\n * to_log: converts weights to the log semiring.\n * to_log64: converts weights to the log64 semiring.\n * to_standard: converts weights to the tropical (\"standard\") semiring.\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta (ignored unless `map_type` is\n `quantize`).\n map_type: A string matching a known mapping operation (see above).\n power: A positive scalar or integer power; ignored unless `map_type` is\n `float_power` or `power` (in which case it defaults to 1).\n weight: A Weight or weight string passed to the arc-mapper; ignored unless\n `map_type` is `plus` (in which case it defaults to semiring Zero) or\n `times` (in which case it defaults to semiring One).\n\n Returns:\n An FST with arcs and final states remapped.\n\n Raises:\n FstArgError: Unknown map type.\n ";
+static char __pyx_doc_9pywrapfst_20arcmap[] = "\n arcmap(ifst, delta=0.0009765625, map_type=\"identity\", power=1., weight=None)\n\n Constructively applies a transform to all arcs and final states.\n\n This operation transforms each arc and final state in the input FST using\n one of the following:\n\n * identity: maps to self.\n * input_epsilon: replaces all input labels with epsilon.\n * invert: reciprocates all non-Zero weights.\n * output_epsilon: replaces all output labels with epsilon.\n * quantize: quantizes weights.\n * plus: adds a constant to all weights.\n * power: raises all weights to a power.\n * rmweight: replaces all non-Zero weights with 1.\n * superfinal: redirects final states to a new superfinal state.\n * times: right-multiplies a constant by all weights.\n * to_log: converts weights to the log semiring.\n * to_log64: converts weights to the log64 semiring.\n * to_std: converts weights to the tropical semiring.\n\n Args:\n ifst: The input FST.\n delta: Comparison/quantization delta (ignored unless `map_type` is\n `quantize`).\n map_type: A string matching a known mapping operation (see above).\n power: A positive scalar or integer power; ignored unless `map_type` is\n `power` (in which case it defaults to 1).\n weight: A Weight or weight string passed to the arc-mapper; ignored unless\n `map_type` is `plus` (in which case it defaults to semiring Zero) or\n `times` (in which case it defaults to semiring One).\n\n Returns:\n An FST with arcs and final states remapped.\n\n Raises:\n FstArgError: Unknown map type.\n ";
static PyObject *__pyx_pw_9pywrapfst_21arcmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
float __pyx_v_delta;
PyObject *__pyx_v_map_type = 0;
double __pyx_v_power;
PyObject *__pyx_v_weight = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("arcmap (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_map_type,&__pyx_n_s_power,&__pyx_n_s_weight,0};
PyObject* values[5] = {0,0,0,0,0};
- values[2] = ((PyObject *)__pyx_n_b_identity);
+ values[2] = ((PyObject *)__pyx_n_u_identity);
- /* "pywrapfst.pyx":3424
- * map_type=b"identity",
+ /* "pywrapfst.pyx":3453
+ * 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, 3420, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcmap") < 0)) __PYX_ERR(0, 3449, __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, 3421, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3450, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__31;
+ __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, 3423, __pyx_L3_error)
+ __pyx_v_power = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_power == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3452, __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, 3420, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3449, __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, 3420, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3449, __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":3420
+ /* "pywrapfst.pyx":3449
*
*
* cpdef Fst arcmap(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * map_type=b"identity",
+ * map_type="identity",
*/
/* function exit code */
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_arcmap __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arcmap", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 4;
__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, 3420, __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, 3449, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3468
+/* "pywrapfst.pyx":3496
*
*
* cpdef MutableFst compose(Fst ifst1, # <<<<<<<<<<<<<<
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
*/
static PyObject *__pyx_pw_9pywrapfst_23compose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_compose(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_compose *__pyx_optional_args) {
- PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);
+ PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":3471
+ /* "pywrapfst.pyx":3499
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
* bool connect=True): # <<<<<<<<<<<<<<
* """
* compose(ifst1, ifst2, compose_filter="auto", connect=True)
*/
bool __pyx_v_connect = ((bool)1);
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- std::unique_ptr<fst::ComposeOptions> __pyx_v_opts;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
+ std::unique_ptr<fst::ComposeOptions> __pyx_v__opts;
struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
enum fst::ComposeFilter __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("compose", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3495
+ /* "pywrapfst.pyx":3523
* """
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions(
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.ComposeOptions] _opts
+ * _opts.reset(
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3495, __pyx_L1_error)
+ __PYX_ERR(0, 3523, __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)));
+ __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":3499
- * 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())
+ /* "pywrapfst.pyx":3527
+ * _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, 3499, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3499, __pyx_L1_error)
+ __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)
- /* "pywrapfst.pyx":3497
- * tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
- * cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions( # <<<<<<<<<<<<<<
- * connect,
- * _get_compose_filter(tostring(compose_filter))))
+ /* "pywrapfst.pyx":3525
+ * _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
+ * cdef unique_ptr[fst.ComposeOptions] _opts
+ * _opts.reset( # <<<<<<<<<<<<<<
+ * new fst.ComposeOptions(connect,
+ * _get_compose_filter(tostring(compose_filter))))
*/
- __pyx_v_opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
+ __pyx_v__opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
- /* "pywrapfst.pyx":3500
- * connect,
- * _get_compose_filter(tostring(compose_filter))))
- * fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
+ /* "pywrapfst.pyx":3528
+ * 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())
*
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3500, __pyx_L1_error)
+ __PYX_ERR(0, 3528, __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, 3500, __pyx_L1_error)
+ __PYX_ERR(0, 3528, __pyx_L1_error)
}
- fst::script::Compose((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
+ fst::script::Compose((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":3501
- * _get_compose_filter(tostring(compose_filter))))
- * fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3529
+ * _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, 3501, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3468
+ /* "pywrapfst.pyx":3496
*
*
* cpdef MutableFst compose(Fst ifst1, # <<<<<<<<<<<<<<
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
*/
/* function exit code */
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
PyObject *__pyx_v_compose_filter = 0;
bool __pyx_v_connect;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("compose (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_compose_filter,&__pyx_n_s_connect,0};
PyObject* values[4] = {0,0,0,0};
- values[2] = ((PyObject *)__pyx_n_b_auto);
+ values[2] = ((PyObject *)__pyx_n_u_auto);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
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, 3468, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, 1); __PYX_ERR(0, 3496, __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, 3468, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(0, 3496, __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, 3471, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3499, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3471
+ /* "pywrapfst.pyx":3499
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
* bool connect=True): # <<<<<<<<<<<<<<
* """
* compose(ifst1, ifst2, compose_filter="auto", 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, 3468, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3496, __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, 3468, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3469, __pyx_L1_error)
+ 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)
__pyx_r = __pyx_pf_9pywrapfst_22compose(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);
- /* "pywrapfst.pyx":3468
+ /* "pywrapfst.pyx":3496
*
*
* cpdef MutableFst compose(Fst ifst1, # <<<<<<<<<<<<<<
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
*/
/* function exit code */
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_compose __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("compose", 0);
__Pyx_XDECREF(__pyx_r);
__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, 3468, __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, 3496, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3504
+/* "pywrapfst.pyx":3532
*
*
- * cpdef Fst convert(Fst ifst, fst_type=b""): # <<<<<<<<<<<<<<
+ * cpdef Fst convert(Fst ifst, fst_type=""): # <<<<<<<<<<<<<<
* """
* convert(ifst, fst_type="")
*/
static PyObject *__pyx_pw_9pywrapfst_25convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst_convert(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_convert *__pyx_optional_args) {
- PyObject *__pyx_v_fst_type = ((PyObject *)__pyx_kp_b__8);
- std::string __pyx_v_fst_type_string;
- std::unique_ptr<fst::script::FstClass> __pyx_v_tfst;
+ PyObject *__pyx_v_fst_type = ((PyObject *)__pyx_kp_u__11);
+ std::string __pyx_v__fst_type;
+ std::unique_ptr<fst::script::FstClass> __pyx_v__tfst;
struct __pyx_obj_9pywrapfst_Fst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_6;
+ Py_UCS4 __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("convert", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3521
+ /* "pywrapfst.pyx":3549
* FstOpError: Conversion failed.
* """
- * cdef string fst_type_string = tostring(fst_type) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))
+ * 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, 3521, __pyx_L1_error)
- __pyx_v_fst_type_string = __pyx_t_1;
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3549, __pyx_L1_error)
+ __pyx_v__fst_type = __pyx_t_1;
- /* "pywrapfst.pyx":3523
- * cdef string fst_type_string = tostring(fst_type)
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string)) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3551
+ * cdef string _fst_type = tostring(fst_type)
+ * cdef unique_ptr[fst.FstClass] _tfst
+ * _tfst.reset(fst.Convert(deref(ifst._fst), _fst_type)) # <<<<<<<<<<<<<<
* # Script-land Convert returns a null pointer to signal failure.
- * if tfst.get() == NULL:
+ * if _tfst.get() == NULL:
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3523, __pyx_L1_error)
+ __PYX_ERR(0, 3551, __pyx_L1_error)
}
- __pyx_v_tfst.reset(fst::script::Convert((*__pyx_v_ifst->_fst), __pyx_v_fst_type_string));
+ __pyx_v__tfst.reset(fst::script::Convert((*__pyx_v_ifst->_fst), __pyx_v__fst_type));
- /* "pywrapfst.pyx":3525
- * tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))
+ /* "pywrapfst.pyx":3553
+ * _tfst.reset(fst.Convert(deref(ifst._fst), _fst_type))
* # Script-land Convert returns a null pointer to signal failure.
- * if tfst.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstOpError("Conversion to {!r} failed".format(fst_type))
- * return _init_XFst(tfst.release())
+ * if _tfst.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstOpError(f"Conversion to {fst_type!r} failed")
+ * return _init_XFst(_tfst.release())
*/
- __pyx_t_2 = ((__pyx_v_tfst.get() == NULL) != 0);
+ __pyx_t_2 = ((__pyx_v__tfst.get() == NULL) != 0);
if (unlikely(__pyx_t_2)) {
- /* "pywrapfst.pyx":3526
+ /* "pywrapfst.pyx":3554
* # Script-land Convert returns a null pointer to signal failure.
- * if tfst.get() == NULL:
- * raise FstOpError("Conversion to {!r} failed".format(fst_type)) # <<<<<<<<<<<<<<
- * return _init_XFst(tfst.release())
+ * 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, 3526, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3554, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Conversion_to_r_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3526, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_fst_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_fst_type);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3526, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3554, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
+ __pyx_t_6 = 0;
+ __pyx_t_7 = 127;
+ __Pyx_INCREF(__pyx_kp_u_Conversion_to);
+ __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_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_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
+ __pyx_t_8 = 0;
+ __Pyx_INCREF(__pyx_kp_u_failed);
+ __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_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
+ __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_6);
+ __Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3526, __pyx_L1_error)
+ __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)
__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, 3526, __pyx_L1_error)
+ __PYX_ERR(0, 3554, __pyx_L1_error)
- /* "pywrapfst.pyx":3525
- * tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))
+ /* "pywrapfst.pyx":3553
+ * _tfst.reset(fst.Convert(deref(ifst._fst), _fst_type))
* # Script-land Convert returns a null pointer to signal failure.
- * if tfst.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstOpError("Conversion to {!r} failed".format(fst_type))
- * return _init_XFst(tfst.release())
+ * if _tfst.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstOpError(f"Conversion to {fst_type!r} failed")
+ * return _init_XFst(_tfst.release())
*/
}
- /* "pywrapfst.pyx":3527
- * if tfst.get() == NULL:
- * raise FstOpError("Conversion to {!r} failed".format(fst_type))
- * return _init_XFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3555
+ * 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, 3527, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3504
+ /* "pywrapfst.pyx":3532
*
*
- * cpdef Fst convert(Fst ifst, fst_type=b""): # <<<<<<<<<<<<<<
+ * cpdef Fst convert(Fst ifst, fst_type=""): # <<<<<<<<<<<<<<
* """
* convert(ifst, fst_type="")
*/
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("pywrapfst.convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
static PyObject *__pyx_pw_9pywrapfst_25convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
PyObject *__pyx_v_fst_type = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("convert (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_fst_type,0};
PyObject* values[2] = {0,0};
- values[1] = ((PyObject *)__pyx_kp_b__8);
+ values[1] = ((PyObject *)__pyx_kp_u__11);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 3504, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 3532, __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, 3504, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("convert", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3532, __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, 3504, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3532, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_24convert(__pyx_self, __pyx_v_ifst, __pyx_v_fst_type);
/* function exit code */
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_convert __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("convert", 0);
__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, 3504, __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, 3532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3530
+/* "pywrapfst.pyx":3558
*
*
* cpdef MutableFst determinize(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kShortestDelta,
- * det_type=b"functional",
+ * det_type="functional",
*/
static PyObject *__pyx_pw_9pywrapfst_27determinize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_determinize(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_determinize *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__32;
- PyObject *__pyx_v_det_type = ((PyObject *)__pyx_n_b_functional);
- int64 __pyx_v_nstate = __pyx_k__33;
+ float __pyx_v_delta = __pyx_k__34;
+ PyObject *__pyx_v_det_type = ((PyObject *)__pyx_n_u_functional);
+ int64 __pyx_v_nstate = __pyx_k__35;
int64 __pyx_v_subsequential_label = ((int64)0);
- /* "pywrapfst.pyx":3535
+ /* "pywrapfst.pyx":3563
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None, # <<<<<<<<<<<<<<
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- /* "pywrapfst.pyx":3536
+ /* "pywrapfst.pyx":3564
* int64 subsequential_label=0,
* weight=None,
* bool increment_subsequential_label=False): # <<<<<<<<<<<<<<
* determinize(ifst, delta=1e-6, det_type="functional",
*/
bool __pyx_v_increment_subsequential_label = ((bool)0);
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- fst::script::WeightClass __pyx_v_wc;
- enum fst::DeterminizeType __pyx_v_determinize_type_enum;
- std::unique_ptr<fst::script::DeterminizeOptions> __pyx_v_opts;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
+ fst::script::WeightClass __pyx_v__weight;
+ enum fst::DeterminizeType __pyx_v__det_type;
+ std::unique_ptr<fst::script::DeterminizeOptions> __pyx_v__opts;
struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
fst::script::WeightClass __pyx_t_1;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("determinize", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3570
+ /* "pywrapfst.pyx":3598
* """
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
+ * 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 wc = _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, 3570, __pyx_L1_error)
+ __PYX_ERR(0, 3598, __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)));
+ __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3572
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
+ /* "pywrapfst.pyx":3600
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* # Threshold is set to semiring Zero (no pruning) if weight unspecified.
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), # <<<<<<<<<<<<<<
- * weight)
- * cdef fst.DeterminizeType determinize_type_enum
+ * 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, 3572, __pyx_L1_error)
+ __PYX_ERR(0, 3600, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3573
+ /* "pywrapfst.pyx":3601
* # Threshold is set to semiring Zero (no pruning) if weight unspecified.
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(),
- * weight) # <<<<<<<<<<<<<<
- * cdef fst.DeterminizeType determinize_type_enum
- * if not fst.GetDeterminizeType(tostring(det_type),
- */
- __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3572, __pyx_L1_error)
- __pyx_v_wc = __pyx_t_1;
-
- /* "pywrapfst.pyx":3575
- * weight)
- * cdef fst.DeterminizeType determinize_type_enum
- * if not fst.GetDeterminizeType(tostring(det_type), # <<<<<<<<<<<<<<
- * addr(determinize_type_enum)):
- * raise FstArgError("Unknown determinization type: {!r}".format(det_type))
- */
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_det_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3575, __pyx_L1_error)
-
- /* "pywrapfst.pyx":3576
- * cdef fst.DeterminizeType determinize_type_enum
- * if not fst.GetDeterminizeType(tostring(det_type),
- * addr(determinize_type_enum)): # <<<<<<<<<<<<<<
- * raise FstArgError("Unknown determinization type: {!r}".format(det_type))
- * cdef unique_ptr[fst.DeterminizeOptions] opts
- */
- __pyx_t_3 = ((!(fst::script::GetDeterminizeType(__pyx_t_2, (&__pyx_v_determinize_type_enum)) != 0)) != 0);
-
- /* "pywrapfst.pyx":3575
- * weight)
- * cdef fst.DeterminizeType determinize_type_enum
- * if not fst.GetDeterminizeType(tostring(det_type), # <<<<<<<<<<<<<<
- * addr(determinize_type_enum)):
- * raise FstArgError("Unknown determinization type: {!r}".format(det_type))
- */
+ * 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_v__weight = __pyx_t_1;
+
+ /* "pywrapfst.pyx":3603
+ * 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_3 = ((!(fst::script::GetDeterminizeType(__pyx_t_2, (&__pyx_v__det_type)) != 0)) != 0);
if (unlikely(__pyx_t_3)) {
- /* "pywrapfst.pyx":3577
- * if not fst.GetDeterminizeType(tostring(det_type),
- * addr(determinize_type_enum)):
- * raise FstArgError("Unknown determinization type: {!r}".format(det_type)) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.DeterminizeOptions] opts
- * opts.reset(new fst.DeterminizeOptions(delta,
+ /* "pywrapfst.pyx":3604
+ * 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, 3577, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_determinization_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3577, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
- }
- }
- __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_det_type) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_det_type);
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3577, __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, 3604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
+ __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_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_7)) {
+ __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_7);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- __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, 3577, __pyx_L1_error)
+ __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)
__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, 3577, __pyx_L1_error)
+ __PYX_ERR(0, 3604, __pyx_L1_error)
- /* "pywrapfst.pyx":3575
- * weight)
- * cdef fst.DeterminizeType determinize_type_enum
- * if not fst.GetDeterminizeType(tostring(det_type), # <<<<<<<<<<<<<<
- * addr(determinize_type_enum)):
- * raise FstArgError("Unknown determinization type: {!r}".format(det_type))
+ /* "pywrapfst.pyx":3603
+ * 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
*/
}
- /* "pywrapfst.pyx":3579
- * raise FstArgError("Unknown determinization type: {!r}".format(det_type))
- * cdef unique_ptr[fst.DeterminizeOptions] opts
- * opts.reset(new fst.DeterminizeOptions(delta, # <<<<<<<<<<<<<<
- * wc,
- * nstate,
+ /* "pywrapfst.pyx":3606
+ * raise FstArgError(f"Unknown determinization type: {det_type!r}")
+ * cdef unique_ptr[fst.DeterminizeOptions] _opts
+ * _opts.reset( # <<<<<<<<<<<<<<
+ * new fst.DeterminizeOptions(delta,
+ * _weight,
*/
- __pyx_v_opts.reset(new fst::script::DeterminizeOptions(__pyx_v_delta, __pyx_v_wc, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_determinize_type_enum, __pyx_v_increment_subsequential_label));
+ __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":3585
- * determinize_type_enum,
- * increment_subsequential_label))
- * fst.Determinize(deref(ifst._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
+ /* "pywrapfst.pyx":3613
+ * _det_type,
+ * increment_subsequential_label))
+ * fst.Determinize(deref(ifst._fst), _tfst.get(), deref(_opts)) # <<<<<<<<<<<<<<
+ * return _init_MutableFst(_tfst.release())
*
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3585, __pyx_L1_error)
+ __PYX_ERR(0, 3613, __pyx_L1_error)
}
- fst::script::Determinize((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
+ fst::script::Determinize((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":3586
- * increment_subsequential_label))
- * fst.Determinize(deref(ifst._fst), tfst.get(), deref(opts))
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3614
+ * 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, 3586, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_4);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3530
+ /* "pywrapfst.pyx":3558
*
*
* cpdef MutableFst determinize(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kShortestDelta,
- * det_type=b"functional",
+ * det_type="functional",
*/
/* function exit code */
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("pywrapfst.determinize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
int64 __pyx_v_subsequential_label;
PyObject *__pyx_v_weight = 0;
bool __pyx_v_increment_subsequential_label;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("determinize (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_det_type,&__pyx_n_s_nstate,&__pyx_n_s_subsequential_label,&__pyx_n_s_weight,&__pyx_n_s_increment_subsequential_label,0};
PyObject* values[7] = {0,0,0,0,0,0,0};
- values[2] = ((PyObject *)__pyx_n_b_functional);
+ values[2] = ((PyObject *)__pyx_n_u_functional);
- /* "pywrapfst.pyx":3535
+ /* "pywrapfst.pyx":3563
* 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, 3530, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "determinize") < 0)) __PYX_ERR(0, 3558, __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, 3531, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3559, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__32;
+ __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, 3533, __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, 3561, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__33;
+ __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, 3534, __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, 3562, __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, 3536, __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, 3564, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3536
+ /* "pywrapfst.pyx":3564
* 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, 3530, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3558, __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, 3530, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3558, __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":3530
+ /* "pywrapfst.pyx":3558
*
*
* cpdef MutableFst determinize(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kShortestDelta,
- * det_type=b"functional",
+ * det_type="functional",
*/
/* function exit code */
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_determinize __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("determinize", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 6;
__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, 3530, __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, 3558, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3589
+/* "pywrapfst.pyx":3617
*
*
* cpdef MutableFst difference(Fst ifst1, # <<<<<<<<<<<<<<
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
*/
static PyObject *__pyx_pw_9pywrapfst_29difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_difference(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_difference *__pyx_optional_args) {
- PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);
+ PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":3592
+ /* "pywrapfst.pyx":3620
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
* bool connect=True): # <<<<<<<<<<<<<<
* """
* difference(ifst1, ifst2, compose_filter="auto", connect=True)
*/
bool __pyx_v_connect = ((bool)1);
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- std::unique_ptr<fst::ComposeOptions> __pyx_v_opts;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
+ std::unique_ptr<fst::ComposeOptions> __pyx_v__opts;
struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
enum fst::ComposeFilter __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("difference", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3617
+ /* "pywrapfst.pyx":3645
* """
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions(
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.ComposeOptions] _opts
+ * _opts.reset(
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3617, __pyx_L1_error)
+ __PYX_ERR(0, 3645, __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)));
+ __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":3621
- * opts.reset(new fst.ComposeOptions(
- * connect,
- * _get_compose_filter(tostring(compose_filter)))) # <<<<<<<<<<<<<<
- * fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
- * return _init_MutableFst(tfst.release())
+ /* "pywrapfst.pyx":3649
+ * _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, 3621, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3621, __pyx_L1_error)
+ __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)
- /* "pywrapfst.pyx":3619
- * tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
- * cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions( # <<<<<<<<<<<<<<
- * connect,
- * _get_compose_filter(tostring(compose_filter))))
+ /* "pywrapfst.pyx":3647
+ * _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
+ * cdef unique_ptr[fst.ComposeOptions] _opts
+ * _opts.reset( # <<<<<<<<<<<<<<
+ * new fst.ComposeOptions(connect,
+ * _get_compose_filter(tostring(compose_filter))))
*/
- __pyx_v_opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
+ __pyx_v__opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
- /* "pywrapfst.pyx":3622
- * connect,
- * _get_compose_filter(tostring(compose_filter))))
- * fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
- *
+ /* "pywrapfst.pyx":3650
+ * new fst.ComposeOptions(connect,
+ * _get_compose_filter(tostring(compose_filter))))
+ * fst.Difference(deref(ifst1._fst), # <<<<<<<<<<<<<<
+ * deref(ifst2._fst),
+ * _tfst.get(),
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3622, __pyx_L1_error)
+ __PYX_ERR(0, 3650, __pyx_L1_error)
}
+
+ /* "pywrapfst.pyx":3651
+ * _get_compose_filter(tostring(compose_filter))))
+ * fst.Difference(deref(ifst1._fst),
+ * deref(ifst2._fst), # <<<<<<<<<<<<<<
+ * _tfst.get(),
+ * deref(_opts))
+ */
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3622, __pyx_L1_error)
+ __PYX_ERR(0, 3651, __pyx_L1_error)
}
- fst::script::Difference((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
- /* "pywrapfst.pyx":3623
- * _get_compose_filter(tostring(compose_filter))))
- * fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3650
+ * new fst.ComposeOptions(connect,
+ * _get_compose_filter(tostring(compose_filter))))
+ * fst.Difference(deref(ifst1._fst), # <<<<<<<<<<<<<<
+ * deref(ifst2._fst),
+ * _tfst.get(),
+ */
+ fst::script::Difference((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
+
+ /* "pywrapfst.pyx":3654
+ * _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, 3623, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3589
+ /* "pywrapfst.pyx":3617
*
*
* cpdef MutableFst difference(Fst ifst1, # <<<<<<<<<<<<<<
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
*/
/* function exit code */
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
PyObject *__pyx_v_compose_filter = 0;
bool __pyx_v_connect;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("difference (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_compose_filter,&__pyx_n_s_connect,0};
PyObject* values[4] = {0,0,0,0};
- values[2] = ((PyObject *)__pyx_n_b_auto);
+ values[2] = ((PyObject *)__pyx_n_u_auto);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
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, 3589, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, 1); __PYX_ERR(0, 3617, __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, 3589, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(0, 3617, __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, 3592, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3620, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3592
+ /* "pywrapfst.pyx":3620
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
* bool connect=True): # <<<<<<<<<<<<<<
* """
* difference(ifst1, ifst2, compose_filter="auto", 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, 3589, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3617, __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, 3589, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3590, __pyx_L1_error)
+ 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)
__pyx_r = __pyx_pf_9pywrapfst_28difference(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);
- /* "pywrapfst.pyx":3589
+ /* "pywrapfst.pyx":3617
*
*
* cpdef MutableFst difference(Fst ifst1, # <<<<<<<<<<<<<<
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
*/
/* function exit code */
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_difference __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("difference", 0);
__Pyx_XDECREF(__pyx_r);
__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, 3589, __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, 3617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3626
+/* "pywrapfst.pyx":3657
*
*
* cpdef MutableFst disambiguate(Fst ifst, # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_31disambiguate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_disambiguate(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_disambiguate *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__34;
- int64 __pyx_v_nstate = __pyx_k__35;
+ float __pyx_v_delta = __pyx_k__36;
+ int64 __pyx_v_nstate = __pyx_k__37;
int64 __pyx_v_subsequential_label = ((int64)0);
- /* "pywrapfst.pyx":3630
+ /* "pywrapfst.pyx":3661
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
* weight=None): # <<<<<<<<<<<<<<
* disambiguate(ifst, delta=0.0009765625, nstate=NO_STATE_ID,
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- fst::script::WeightClass __pyx_v_wc;
- std::unique_ptr<fst::script::DisambiguateOptions> __pyx_v_opts;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
+ fst::script::WeightClass __pyx_v__weight;
+ std::unique_ptr<fst::script::DisambiguateOptions> __pyx_v__opts;
struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
fst::script::WeightClass __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("disambiguate", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3655
+ /* "pywrapfst.pyx":3686
* """
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
+ * 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 wc = _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, 3655, __pyx_L1_error)
+ __PYX_ERR(0, 3686, __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)));
+ __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":3657
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
+ /* "pywrapfst.pyx":3688
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), # <<<<<<<<<<<<<<
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(ifst.weight_type(), # <<<<<<<<<<<<<<
* weight)
- * cdef unique_ptr[fst.DisambiguateOptions] opts
+ * 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, 3657, __pyx_L1_error)
+ __PYX_ERR(0, 3688, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3658
+ /* "pywrapfst.pyx":3689
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass wc = _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(new fst.DisambiguateOptions(delta,
+ * 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, 3657, __pyx_L1_error)
- __pyx_v_wc = __pyx_t_1;
+ __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3688, __pyx_L1_error)
+ __pyx_v__weight = __pyx_t_1;
- /* "pywrapfst.pyx":3660
+ /* "pywrapfst.pyx":3691
* weight)
- * cdef unique_ptr[fst.DisambiguateOptions] opts
- * opts.reset(new fst.DisambiguateOptions(delta, # <<<<<<<<<<<<<<
- * wc,
- * nstate,
+ * cdef unique_ptr[fst.DisambiguateOptions] _opts
+ * _opts.reset( # <<<<<<<<<<<<<<
+ * new fst.DisambiguateOptions(delta,
+ * _weight,
*/
- __pyx_v_opts.reset(new fst::script::DisambiguateOptions(__pyx_v_delta, __pyx_v_wc, __pyx_v_nstate, __pyx_v_subsequential_label));
+ __pyx_v__opts.reset(new fst::script::DisambiguateOptions(__pyx_v_delta, __pyx_v__weight, __pyx_v_nstate, __pyx_v_subsequential_label));
- /* "pywrapfst.pyx":3664
- * nstate,
- * subsequential_label))
- * fst.Disambiguate(deref(ifst._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
+ /* "pywrapfst.pyx":3696
+ * nstate,
+ * subsequential_label))
+ * fst.Disambiguate(deref(ifst._fst), _tfst.get(), deref(_opts)) # <<<<<<<<<<<<<<
+ * return _init_MutableFst(_tfst.release())
*
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3664, __pyx_L1_error)
+ __PYX_ERR(0, 3696, __pyx_L1_error)
}
- fst::script::Disambiguate((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
+ fst::script::Disambiguate((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":3665
- * subsequential_label))
- * fst.Disambiguate(deref(ifst._fst), tfst.get(), deref(opts))
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3697
+ * 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, 3665, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3626
+ /* "pywrapfst.pyx":3657
*
*
* cpdef MutableFst disambiguate(Fst ifst, # <<<<<<<<<<<<<<
int64 __pyx_v_nstate;
int64 __pyx_v_subsequential_label;
PyObject *__pyx_v_weight = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("disambiguate (wrapper)", 0);
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":3630
+ /* "pywrapfst.pyx":3661
* 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, 3626, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "disambiguate") < 0)) __PYX_ERR(0, 3657, __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, 3627, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3658, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__34;
+ __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, 3628, __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, 3659, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__35;
+ __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, 3629, __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, 3660, __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, 3626, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("disambiguate", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3657, __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, 3626, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3657, __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":3626
+ /* "pywrapfst.pyx":3657
*
*
* cpdef MutableFst disambiguate(Fst ifst, # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_disambiguate __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("disambiguate", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 4;
__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, 3626, __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, 3657, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3668
+/* "pywrapfst.pyx":3700
*
*
* cpdef MutableFst epsnormalize(Fst ifst, bool eps_norm_output=False): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_33epsnormalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_epsnormalize(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_epsnormalize *__pyx_optional_args) {
bool __pyx_v_eps_norm_output = ((bool)0);
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
enum fst::EpsNormalizeType __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("epsnormalize", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3689
+ /* "pywrapfst.pyx":3721
* """
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _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'", "arc_type");
- __PYX_ERR(0, 3689, __pyx_L1_error)
+ __PYX_ERR(0, 3721, __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)));
+ __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));
- /* "pywrapfst.pyx":3691
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
+ /* "pywrapfst.pyx":3723
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.EpsNormalize(
* deref(ifst._fst), # <<<<<<<<<<<<<<
- * tfst.get(),
+ * _tfst.get(),
* fst.EPS_NORM_OUTPUT if eps_norm_output else fst.EPS_NORM_INPUT)
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3691, __pyx_L1_error)
+ __PYX_ERR(0, 3723, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3693
+ /* "pywrapfst.pyx":3725
* deref(ifst._fst),
- * tfst.get(),
+ * _tfst.get(),
* fst.EPS_NORM_OUTPUT if eps_norm_output else fst.EPS_NORM_INPUT) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
+ * return _init_MutableFst(_tfst.release())
*
*/
if ((__pyx_v_eps_norm_output != 0)) {
__pyx_t_1 = fst::EPS_NORM_INPUT;
}
- /* "pywrapfst.pyx":3690
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
+ /* "pywrapfst.pyx":3722
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* fst.EpsNormalize( # <<<<<<<<<<<<<<
* deref(ifst._fst),
- * tfst.get(),
+ * _tfst.get(),
*/
- fst::script::EpsNormalize((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_t_1);
+ fst::script::EpsNormalize((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_t_1);
- /* "pywrapfst.pyx":3694
- * tfst.get(),
+ /* "pywrapfst.pyx":3726
+ * _tfst.get(),
* fst.EPS_NORM_OUTPUT if eps_norm_output else fst.EPS_NORM_INPUT)
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ * 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, 3694, __pyx_L1_error)
+ __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3726, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3668
+ /* "pywrapfst.pyx":3700
*
*
* cpdef MutableFst epsnormalize(Fst ifst, bool eps_norm_output=False): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_33epsnormalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
bool __pyx_v_eps_norm_output;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("epsnormalize (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "epsnormalize") < 0)) __PYX_ERR(0, 3668, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "epsnormalize") < 0)) __PYX_ERR(0, 3700, __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, 3668, __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, 3700, __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, 3668, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("epsnormalize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3700, __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, 3668, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3700, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_32epsnormalize(__pyx_self, __pyx_v_ifst, __pyx_v_eps_norm_output);
/* function exit code */
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_epsnormalize __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("epsnormalize", 0);
__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, 3668, __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, 3700, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3697
+/* "pywrapfst.pyx":3729
*
*
* cpdef bool equal(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_35equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_9pywrapfst_equal(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_equal *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__36;
+ float __pyx_v_delta = __pyx_k__38;
bool __pyx_r;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("equal", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3715
+ /* "pywrapfst.pyx":3747
* 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, 3715, __pyx_L1_error)
+ __PYX_ERR(0, 3747, __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, 3715, __pyx_L1_error)
+ __PYX_ERR(0, 3747, __pyx_L1_error)
}
__pyx_r = fst::script::Equal((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3697
+ /* "pywrapfst.pyx":3729
*
*
* cpdef bool equal(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
float __pyx_v_delta;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("equal (wrapper)", 0);
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, 3697, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, 1); __PYX_ERR(0, 3729, __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, 3697, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(0, 3729, __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, 3697, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3729, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__36;
+ __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, 3697, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3729, __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, 3697, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3697, __pyx_L1_error)
+ 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)
__pyx_r = __pyx_pf_9pywrapfst_34equal(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);
/* function exit code */
bool __pyx_t_1;
struct __pyx_opt_args_9pywrapfst_equal __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("equal", 0);
__Pyx_XDECREF(__pyx_r);
__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, 3697, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3729, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3718
+/* "pywrapfst.pyx":3750
*
*
* cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_37equivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_9pywrapfst_equivalent(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_equivalent *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__37;
+ float __pyx_v_delta = __pyx_k__39;
bool __pyx_r;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("equivalent", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3736
+ /* "pywrapfst.pyx":3768
* 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, 3736, __pyx_L1_error)
+ __PYX_ERR(0, 3768, __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, 3736, __pyx_L1_error)
+ __PYX_ERR(0, 3768, __pyx_L1_error)
}
__pyx_r = fst::script::Equivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3718
+ /* "pywrapfst.pyx":3750
*
*
* cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
float __pyx_v_delta;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("equivalent (wrapper)", 0);
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, 3718, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, 1); __PYX_ERR(0, 3750, __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, 3718, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equivalent") < 0)) __PYX_ERR(0, 3750, __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, 3718, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3750, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__37;
+ __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, 3718, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3750, __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, 3718, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3718, __pyx_L1_error)
+ 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)
__pyx_r = __pyx_pf_9pywrapfst_36equivalent(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);
/* function exit code */
bool __pyx_t_1;
struct __pyx_opt_args_9pywrapfst_equivalent __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("equivalent", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.delta = __pyx_v_delta;
__pyx_t_1 = __pyx_f_9pywrapfst_equivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2);
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3718, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3750, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3739
+/* "pywrapfst.pyx":3771
*
*
* cpdef MutableFst intersect(Fst ifst1, # <<<<<<<<<<<<<<
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
*/
static PyObject *__pyx_pw_9pywrapfst_39intersect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_intersect(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_intersect *__pyx_optional_args) {
- PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);
+ PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":3742
+ /* "pywrapfst.pyx":3774
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
* bool connect=True): # <<<<<<<<<<<<<<
* """
* intersect(ifst1, ifst2, compose_filter="auto", connect=True)
*/
bool __pyx_v_connect = ((bool)1);
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- std::unique_ptr<fst::ComposeOptions> __pyx_v_opts;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
+ std::unique_ptr<fst::ComposeOptions> __pyx_v__opts;
struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
enum fst::ComposeFilter __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("intersect", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3765
+ /* "pywrapfst.pyx":3797
* """
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions(
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst1.arc_type())) # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.ComposeOptions] _opts
+ * _opts.reset(
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3765, __pyx_L1_error)
+ __PYX_ERR(0, 3797, __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)));
+ __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":3769
- * 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())
+ /* "pywrapfst.pyx":3801
+ * _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, 3769, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3769, __pyx_L1_error)
+ __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)
- /* "pywrapfst.pyx":3767
- * tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
- * cdef unique_ptr[fst.ComposeOptions] opts
- * opts.reset(new fst.ComposeOptions( # <<<<<<<<<<<<<<
- * connect,
- * _get_compose_filter(tostring(compose_filter))))
+ /* "pywrapfst.pyx":3799
+ * _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
+ * cdef unique_ptr[fst.ComposeOptions] _opts
+ * _opts.reset( # <<<<<<<<<<<<<<
+ * new fst.ComposeOptions(connect,
+ * _get_compose_filter(tostring(compose_filter))))
*/
- __pyx_v_opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
+ __pyx_v__opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));
- /* "pywrapfst.pyx":3770
- * connect,
- * _get_compose_filter(tostring(compose_filter))))
- * fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
+ /* "pywrapfst.pyx":3802
+ * 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())
*
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3770, __pyx_L1_error)
+ __PYX_ERR(0, 3802, __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, 3770, __pyx_L1_error)
+ __PYX_ERR(0, 3802, __pyx_L1_error)
}
- fst::script::Intersect((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
+ fst::script::Intersect((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":3771
- * _get_compose_filter(tostring(compose_filter))))
- * fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3803
+ * _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, 3771, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_3);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3739
+ /* "pywrapfst.pyx":3771
*
*
* cpdef MutableFst intersect(Fst ifst1, # <<<<<<<<<<<<<<
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
*/
/* function exit code */
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
PyObject *__pyx_v_compose_filter = 0;
bool __pyx_v_connect;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("intersect (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_compose_filter,&__pyx_n_s_connect,0};
PyObject* values[4] = {0,0,0,0};
- values[2] = ((PyObject *)__pyx_n_b_auto);
+ values[2] = ((PyObject *)__pyx_n_u_auto);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
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, 3739, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, 1); __PYX_ERR(0, 3771, __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, 3739, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersect") < 0)) __PYX_ERR(0, 3771, __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, 3742, __pyx_L3_error)
+ __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3774, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3742
+ /* "pywrapfst.pyx":3774
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
* bool connect=True): # <<<<<<<<<<<<<<
* """
* intersect(ifst1, ifst2, compose_filter="auto", 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, 3739, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3771, __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, 3739, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3740, __pyx_L1_error)
+ 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)
__pyx_r = __pyx_pf_9pywrapfst_38intersect(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);
- /* "pywrapfst.pyx":3739
+ /* "pywrapfst.pyx":3771
*
*
* cpdef MutableFst intersect(Fst ifst1, # <<<<<<<<<<<<<<
* Fst ifst2,
- * compose_filter=b"auto",
+ * compose_filter="auto",
*/
/* function exit code */
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_intersect __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("intersect", 0);
__Pyx_XDECREF(__pyx_r);
__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, 3739, __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, 3771, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3774
+/* "pywrapfst.pyx":3806
*
*
* cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_41isomorphic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_9pywrapfst_isomorphic(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_isomorphic *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__38;
+ float __pyx_v_delta = __pyx_k__40;
bool __pyx_r;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("isomorphic", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3795
+ /* "pywrapfst.pyx":3827
* 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, 3795, __pyx_L1_error)
+ __PYX_ERR(0, 3827, __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, 3795, __pyx_L1_error)
+ __PYX_ERR(0, 3827, __pyx_L1_error)
}
__pyx_r = fst::script::Isomorphic((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
goto __pyx_L0;
- /* "pywrapfst.pyx":3774
+ /* "pywrapfst.pyx":3806
*
*
* cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
float __pyx_v_delta;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isomorphic (wrapper)", 0);
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, 3774, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, 1); __PYX_ERR(0, 3806, __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, 3774, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isomorphic") < 0)) __PYX_ERR(0, 3806, __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, 3774, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__38;
+ __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, 3774, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3806, __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, 3774, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3774, __pyx_L1_error)
+ 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)
__pyx_r = __pyx_pf_9pywrapfst_40isomorphic(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);
/* function exit code */
bool __pyx_t_1;
struct __pyx_opt_args_9pywrapfst_isomorphic __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("isomorphic", 0);
__Pyx_XDECREF(__pyx_r);
__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, 3774, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3806, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3798
+/* "pywrapfst.pyx":3830
*
*
* cpdef MutableFst prune(Fst ifst, # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_43prune(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_prune(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_prune *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__39;
- int64 __pyx_v_nstate = __pyx_k__40;
+ float __pyx_v_delta = __pyx_k__41;
+ int64 __pyx_v_nstate = __pyx_k__42;
- /* "pywrapfst.pyx":3801
+ /* "pywrapfst.pyx":3833
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId,
* weight=None): # <<<<<<<<<<<<<<
* prune(ifst, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- fst::script::WeightClass __pyx_v_wc;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
+ fst::script::WeightClass __pyx_v__weight;
struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
fst::script::WeightClass __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("prune", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3823
+ /* "pywrapfst.pyx":3855
* """
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
- * fst.Prune(deref(ifst._fst), tfst.get(), wc, nstate, delta)
+ * 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(),
+ * weight)
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3823, __pyx_L1_error)
+ __PYX_ERR(0, 3855, __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)));
+ __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":3824
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
- * fst.Prune(deref(ifst._fst), tfst.get(), wc, nstate, delta)
- * return _init_MutableFst(tfst.release())
+ /* "pywrapfst.pyx":3856
+ * 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(), # <<<<<<<<<<<<<<
+ * 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, 3824, __pyx_L1_error)
+ __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, 3824, __pyx_L1_error)
- __pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":3825
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
- * fst.Prune(deref(ifst._fst), tfst.get(), wc, nstate, delta) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
+ /* "pywrapfst.pyx":3857
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_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_v__weight = __pyx_t_1;
+
+ /* "pywrapfst.pyx":3858
+ * 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, 3825, __pyx_L1_error)
+ __PYX_ERR(0, 3858, __pyx_L1_error)
}
- fst::script::Prune((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
+ fst::script::Prune((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_v__weight, __pyx_v_nstate, __pyx_v_delta);
- /* "pywrapfst.pyx":3826
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
- * fst.Prune(deref(ifst._fst), tfst.get(), wc, nstate, delta)
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3859
+ * 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, 3826, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3798
+ /* "pywrapfst.pyx":3830
*
*
* cpdef MutableFst prune(Fst ifst, # <<<<<<<<<<<<<<
float __pyx_v_delta;
int64 __pyx_v_nstate;
PyObject *__pyx_v_weight = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("prune (wrapper)", 0);
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":3801
+ /* "pywrapfst.pyx":3833
* 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, 3798, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 3830, __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, 3799, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3831, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__39;
+ __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, 3800, __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, 3832, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__40;
+ __pyx_v_nstate = __pyx_k__42;
}
__pyx_v_weight = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3798, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3830, __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, 3798, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3830, __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":3798
+ /* "pywrapfst.pyx":3830
*
*
* cpdef MutableFst prune(Fst ifst, # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_prune __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("prune", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 3;
__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, 3798, __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, 3830, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3829
+/* "pywrapfst.pyx":3862
*
*
* cpdef MutableFst push(Fst ifst, # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_45push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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__41;
+ float __pyx_v_delta = __pyx_k__43;
- /* "pywrapfst.pyx":3831
+ /* "pywrapfst.pyx":3864
* cpdef MutableFst push(Fst ifst,
* float delta=fst.kDelta,
* bool push_weights=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_push_weights = ((bool)0);
- /* "pywrapfst.pyx":3832
+ /* "pywrapfst.pyx":3865
* float delta=fst.kDelta,
* bool push_weights=False,
* bool push_labels=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_push_labels = ((bool)0);
- /* "pywrapfst.pyx":3833
+ /* "pywrapfst.pyx":3866
* bool push_weights=False,
* bool push_labels=False,
* bool remove_common_affix=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_common_affix = ((bool)0);
- /* "pywrapfst.pyx":3834
+ /* "pywrapfst.pyx":3867
* bool push_labels=False,
* bool remove_common_affix=False,
* bool remove_total_weight=False, # <<<<<<<<<<<<<<
*/
bool __pyx_v_remove_total_weight = ((bool)0);
- /* "pywrapfst.pyx":3835
+ /* "pywrapfst.pyx":3868
* bool remove_common_affix=False,
* bool remove_total_weight=False,
* bool to_final=False): # <<<<<<<<<<<<<<
* push(ifst, delta=0.0009765625, push_weights=False, push_labels=False,
*/
bool __pyx_v_to_final = ((bool)0);
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
uint8 __pyx_v_flags;
struct __pyx_obj_9pywrapfst_MutableFst *__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("push", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":3872
+ /* "pywrapfst.pyx":3905
* """
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
* cdef uint8 flags = fst.GetPushFlags(push_weights,
* push_labels,
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3872, __pyx_L1_error)
+ __PYX_ERR(0, 3905, __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)));
+ __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":3873
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
+ /* "pywrapfst.pyx":3906
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* cdef uint8 flags = fst.GetPushFlags(push_weights, # <<<<<<<<<<<<<<
* push_labels,
* remove_common_affix,
*/
__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":3877
+ /* "pywrapfst.pyx":3910
* remove_common_affix,
* remove_total_weight)
* fst.Push(deref(ifst._fst), # <<<<<<<<<<<<<<
- * tfst.get(),
+ * _tfst.get(),
* flags,
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3877, __pyx_L1_error)
+ __PYX_ERR(0, 3910, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3881
+ /* "pywrapfst.pyx":3914
* flags,
* fst.GetReweightType(to_final),
* delta) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
+ * return _init_MutableFst(_tfst.release())
*
*/
- fst::script::Push((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_flags, fst::script::GetReweightType(__pyx_v_to_final), __pyx_v_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":3882
+ /* "pywrapfst.pyx":3915
* fst.GetReweightType(to_final),
* delta)
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ * 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, 3882, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3829
+ /* "pywrapfst.pyx":3862
*
*
* cpdef MutableFst push(Fst ifst, # <<<<<<<<<<<<<<
bool __pyx_v_remove_common_affix;
bool __pyx_v_remove_total_weight;
bool __pyx_v_to_final;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("push (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 3829, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 3862, __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, 3830, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3863, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__41;
+ __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, 3831, __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, 3864, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3831
+ /* "pywrapfst.pyx":3864
* 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, 3832, __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, 3865, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3832
+ /* "pywrapfst.pyx":3865
* 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, 3833, __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, 3866, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3833
+ /* "pywrapfst.pyx":3866
* 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, 3834, __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, 3867, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3834
+ /* "pywrapfst.pyx":3867
* 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, 3835, __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, 3868, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3835
+ /* "pywrapfst.pyx":3868
* 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, 3829, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("push", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3862, __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, 3829, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3862, __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":3829
+ /* "pywrapfst.pyx":3862
*
*
* cpdef MutableFst push(Fst ifst, # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_push __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("push", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 6;
__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, 3829, __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, 3862, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3885
+/* "pywrapfst.pyx":3918
*
*
* cpdef bool randequivalent(Fst ifst1, # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_47randequivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_9pywrapfst_randequivalent(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_randequivalent *__pyx_optional_args) {
int32 __pyx_v_npath = ((int32)1);
- float __pyx_v_delta = __pyx_k__42;
- time_t __pyx_v_seed = ((time_t)0);
- PyObject *__pyx_v_select = ((PyObject *)__pyx_n_b_uniform);
- int32 __pyx_v_max_length = __pyx_k__43;
- enum fst::script::RandArcSelection __pyx_v_ras;
- std::unique_ptr<fst::RandGenOptions<enum fst::script::RandArcSelection> > __pyx_v_opts;
+ float __pyx_v_delta = __pyx_k__44;
+ PyObject *__pyx_v_select = ((PyObject *)__pyx_n_u_uniform);
+ int32 __pyx_v_max_length = __pyx_k__45;
+ uint64 __pyx_v_seed = ((uint64)0);
+ enum fst::script::RandArcSelection __pyx_v__select;
+ std::unique_ptr<fst::RandGenOptions<enum fst::script::RandArcSelection> > __pyx_v__opts;
bool __pyx_r;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
enum fst::script::RandArcSelection __pyx_t_2;
int __pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("randequivalent", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
if (__pyx_optional_args->__pyx_n > 1) {
__pyx_v_delta = __pyx_optional_args->delta;
if (__pyx_optional_args->__pyx_n > 2) {
- __pyx_v_seed = __pyx_optional_args->seed;
+ __pyx_v_select = __pyx_optional_args->select;
if (__pyx_optional_args->__pyx_n > 3) {
- __pyx_v_select = __pyx_optional_args->select;
+ __pyx_v_max_length = __pyx_optional_args->max_length;
if (__pyx_optional_args->__pyx_n > 4) {
- __pyx_v_max_length = __pyx_optional_args->max_length;
+ __pyx_v_seed = __pyx_optional_args->seed;
}
}
}
}
}
- /* "pywrapfst.pyx":3918
+ /* "pywrapfst.pyx":3951
* True if the two transducers satisfy the above condition, else False.
* """
- * cdef fst.RandArcSelection ras = _get_rand_arc_selection(tostring(select)) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
+ * 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, 3918, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3918, __pyx_L1_error)
- __pyx_v_ras = __pyx_t_2;
+ __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_v__select = __pyx_t_2;
- /* "pywrapfst.pyx":3921
- * cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
+ /* "pywrapfst.pyx":3954
+ * cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
* # The three trailing options will be ignored by RandEquivalent.
- * opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, # <<<<<<<<<<<<<<
- * max_length,
- * 1,
+ * _opts.reset( # <<<<<<<<<<<<<<
+ * new fst.RandGenOptions[fst.RandArcSelection](_select,
+ * max_length,
*/
- __pyx_v_opts.reset(new fst::RandGenOptions<enum fst::script::RandArcSelection> (__pyx_v_ras, __pyx_v_max_length, 1, 0, 0));
+ __pyx_v__opts.reset(new fst::RandGenOptions<enum fst::script::RandArcSelection> (__pyx_v__select, __pyx_v_max_length, 1, 0, 0));
- /* "pywrapfst.pyx":3926
- * False,
- * False))
+ /* "pywrapfst.pyx":3960
+ * False,
+ * False))
* if seed == 0: # <<<<<<<<<<<<<<
- * seed = time(NULL) + getpid()
+ * seed = time(NULL)
* return fst.RandEquivalent(deref(ifst1._fst),
*/
__pyx_t_3 = ((__pyx_v_seed == 0) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":3927
- * False))
+ /* "pywrapfst.pyx":3961
+ * False))
* if seed == 0:
- * seed = time(NULL) + getpid() # <<<<<<<<<<<<<<
+ * seed = time(NULL) # <<<<<<<<<<<<<<
* return fst.RandEquivalent(deref(ifst1._fst),
* deref(ifst2._fst),
*/
- __pyx_v_seed = (time(NULL) + getpid());
+ __pyx_v_seed = time(NULL);
- /* "pywrapfst.pyx":3926
- * False,
- * False))
+ /* "pywrapfst.pyx":3960
+ * False,
+ * False))
* if seed == 0: # <<<<<<<<<<<<<<
- * seed = time(NULL) + getpid()
+ * seed = time(NULL)
* return fst.RandEquivalent(deref(ifst1._fst),
*/
}
- /* "pywrapfst.pyx":3928
+ /* "pywrapfst.pyx":3962
* if seed == 0:
- * seed = time(NULL) + getpid()
+ * seed = time(NULL)
* return fst.RandEquivalent(deref(ifst1._fst), # <<<<<<<<<<<<<<
* deref(ifst2._fst),
* npath,
*/
if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3928, __pyx_L1_error)
+ __PYX_ERR(0, 3962, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3929
- * seed = time(NULL) + getpid()
+ /* "pywrapfst.pyx":3963
+ * seed = time(NULL)
* return fst.RandEquivalent(deref(ifst1._fst),
* deref(ifst2._fst), # <<<<<<<<<<<<<<
* npath,
- * delta,
+ * deref(_opts),
*/
if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 3929, __pyx_L1_error)
+ __PYX_ERR(0, 3963, __pyx_L1_error)
}
- /* "pywrapfst.pyx":3928
+ /* "pywrapfst.pyx":3962
* if seed == 0:
- * seed = time(NULL) + getpid()
+ * seed = time(NULL)
* return fst.RandEquivalent(deref(ifst1._fst), # <<<<<<<<<<<<<<
* deref(ifst2._fst),
* npath,
*/
- __pyx_r = fst::script::RandEquivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_npath, __pyx_v_delta, __pyx_v_seed, (*__pyx_v_opts));
+ __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":3885
+ /* "pywrapfst.pyx":3918
*
*
* cpdef bool randequivalent(Fst ifst1, # <<<<<<<<<<<<<<
/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_47randequivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_46randequivalent[] = "\n randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, seed=0,\n select=\"uniform\", max_length=2147483647)\n\n Are two acceptors stochastically equivalent?\n\n This operation tests whether two FSTs are equivalent by randomly generating\n paths alternatively in each of the two FSTs. For each randomly generated path,\n the algorithm computes for each of the two FSTs the sum of the weights of all\n the successful paths sharing the same input and output labels as the randomly\n generated path and checks that these two values are within `delta`.\n\n Args:\n ifst1: The first input FST.\n ifst2: The second input FST.\n npath: The number of random paths to generate.\n delta: Comparison/quantization delta.\n seed: An optional seed value for random path generation; if zero, the\n current time and process ID is used.\n select: A string matching a known random arc selection type; one of:\n \"uniform\", \"log_prob\", \"fast_log_prob\".\n max_length: The maximum length of each random path.\n\n Returns:\n True if the two transducers satisfy the above condition, else False.\n ";
+static char __pyx_doc_9pywrapfst_46randequivalent[] = "\n randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, select=\"uniform\",\n max_length=2147483647, seed=0)\n\n Are two acceptors stochastically equivalent?\n\n This operation tests whether two FSTs are equivalent by randomly generating\n paths alternatively in each of the two FSTs. For each randomly generated path,\n the algorithm computes for each of the two FSTs the sum of the weights of all\n the successful paths sharing the same input and output labels as the randomly\n generated path and checks that these two values are within `delta`.\n\n Args:\n ifst1: The first input FST.\n ifst2: The second input FST.\n npath: The number of random paths to generate.\n delta: Comparison/quantization delta.\n seed: An optional seed value for random path generation; if zero, the\n current time and process ID is used.\n select: A string matching a known random arc selection type; one of:\n \"uniform\", \"log_prob\", \"fast_log_prob\".\n max_length: The maximum length of each random path.\n\n Returns:\n True if the two transducers satisfy the above condition, else False.\n ";
static PyObject *__pyx_pw_9pywrapfst_47randequivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
int32 __pyx_v_npath;
float __pyx_v_delta;
- time_t __pyx_v_seed;
PyObject *__pyx_v_select = 0;
int32 __pyx_v_max_length;
+ uint64 __pyx_v_seed;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("randequivalent (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_npath,&__pyx_n_s_delta,&__pyx_n_s_seed,&__pyx_n_s_select,&__pyx_n_s_max_length,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_npath,&__pyx_n_s_delta,&__pyx_n_s_select,&__pyx_n_s_max_length,&__pyx_n_s_seed,0};
PyObject* values[7] = {0,0,0,0,0,0,0};
- values[5] = ((PyObject *)__pyx_n_b_uniform);
+ values[4] = ((PyObject *)__pyx_n_u_uniform);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
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, 3885, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, 1); __PYX_ERR(0, 3918, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seed);
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_select);
if (value) { values[4] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 5:
if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_select);
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_length);
if (value) { values[5] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 6:
if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_length);
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seed);
if (value) { values[6] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randequivalent") < 0)) __PYX_ERR(0, 3885, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randequivalent") < 0)) __PYX_ERR(0, 3918, __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, 3887, __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, 3920, __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, 3888, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3921, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__42;
+ __pyx_v_delta = __pyx_k__44;
}
- if (values[4]) {
- __pyx_v_seed = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_seed == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3889, __pyx_L3_error)
+ __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)
} else {
- __pyx_v_seed = ((time_t)0);
+ __pyx_v_max_length = __pyx_k__45;
}
- __pyx_v_select = values[5];
if (values[6]) {
- __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[6]); if (unlikely((__pyx_v_max_length == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3891, __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, 3924, __pyx_L3_error)
} else {
- __pyx_v_max_length = __pyx_k__43;
+ __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, 3885, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3918, __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, 3885, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3886, __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_seed, __pyx_v_select, __pyx_v_max_length);
+ 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)
+ __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 */
goto __pyx_L0;
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_46randequivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2, int32 __pyx_v_npath, float __pyx_v_delta, time_t __pyx_v_seed, PyObject *__pyx_v_select, int32 __pyx_v_max_length) {
+static PyObject *__pyx_pf_9pywrapfst_46randequivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2, int32 __pyx_v_npath, float __pyx_v_delta, PyObject *__pyx_v_select, int32 __pyx_v_max_length, uint64 __pyx_v_seed) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
bool __pyx_t_1;
struct __pyx_opt_args_9pywrapfst_randequivalent __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("randequivalent", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 5;
__pyx_t_2.npath = __pyx_v_npath;
__pyx_t_2.delta = __pyx_v_delta;
- __pyx_t_2.seed = __pyx_v_seed;
__pyx_t_2.select = __pyx_v_select;
__pyx_t_2.max_length = __pyx_v_max_length;
- __pyx_t_1 = __pyx_f_9pywrapfst_randequivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 3885, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3885, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3936
+/* "pywrapfst.pyx":3970
*
*
* cpdef MutableFst randgen(Fst ifst, # <<<<<<<<<<<<<<
* int32 npath=1,
- * time_t seed=0,
+ * select="uniform",
*/
static PyObject *__pyx_pw_9pywrapfst_49randgen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_randgen(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_randgen *__pyx_optional_args) {
int32 __pyx_v_npath = ((int32)1);
- time_t __pyx_v_seed = ((time_t)0);
- PyObject *__pyx_v_select = ((PyObject *)__pyx_n_b_uniform);
- int32 __pyx_v_max_length = __pyx_k__44;
+ PyObject *__pyx_v_select = ((PyObject *)__pyx_n_u_uniform);
+ int32 __pyx_v_max_length = __pyx_k__46;
- /* "pywrapfst.pyx":3941
- * select=b"uniform",
+ /* "pywrapfst.pyx":3974
+ * select="uniform",
* int32 max_length=INT32_MAX,
* bool weighted=False, # <<<<<<<<<<<<<<
- * bool remove_total_weight=False):
- * """
+ * bool remove_total_weight=False,
+ * uint64 seed=0):
*/
bool __pyx_v_weighted = ((bool)0);
- /* "pywrapfst.pyx":3942
+ /* "pywrapfst.pyx":3975
* int32 max_length=INT32_MAX,
* bool weighted=False,
- * bool remove_total_weight=False): # <<<<<<<<<<<<<<
+ * bool remove_total_weight=False, # <<<<<<<<<<<<<<
+ * uint64 seed=0):
* """
- * randgen(ifst, npath=1, seed=0, select="uniform", max_length=2147483647,
*/
bool __pyx_v_remove_total_weight = ((bool)0);
- enum fst::script::RandArcSelection __pyx_v_ras;
- std::unique_ptr<fst::RandGenOptions<enum fst::script::RandArcSelection> > __pyx_v_opts;
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
+ uint64 __pyx_v_seed = ((uint64)0);
+ enum fst::script::RandArcSelection __pyx_v__select;
+ std::unique_ptr<fst::RandGenOptions<enum fst::script::RandArcSelection> > __pyx_v__opts;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
enum fst::script::RandArcSelection __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("randgen", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_npath = __pyx_optional_args->npath;
if (__pyx_optional_args->__pyx_n > 1) {
- __pyx_v_seed = __pyx_optional_args->seed;
+ __pyx_v_select = __pyx_optional_args->select;
if (__pyx_optional_args->__pyx_n > 2) {
- __pyx_v_select = __pyx_optional_args->select;
+ __pyx_v_max_length = __pyx_optional_args->max_length;
if (__pyx_optional_args->__pyx_n > 3) {
- __pyx_v_max_length = __pyx_optional_args->max_length;
+ __pyx_v_weighted = __pyx_optional_args->weighted;
if (__pyx_optional_args->__pyx_n > 4) {
- __pyx_v_weighted = __pyx_optional_args->weighted;
+ __pyx_v_remove_total_weight = __pyx_optional_args->remove_total_weight;
if (__pyx_optional_args->__pyx_n > 5) {
- __pyx_v_remove_total_weight = __pyx_optional_args->remove_total_weight;
+ __pyx_v_seed = __pyx_optional_args->seed;
}
}
}
}
}
- /* "pywrapfst.pyx":3972
+ /* "pywrapfst.pyx":4006
* An FST containing one or more random paths.
* """
- * cdef fst.RandArcSelection ras = _get_rand_arc_selection(tostring(select)) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
- * opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras,
- */
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3972, __pyx_L1_error)
- __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3972, __pyx_L1_error)
- __pyx_v_ras = __pyx_t_2;
-
- /* "pywrapfst.pyx":3974
- * cdef fst.RandArcSelection ras = _get_rand_arc_selection(tostring(select))
- * cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
- * opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, # <<<<<<<<<<<<<<
- * max_length,
- * npath,
- */
- __pyx_v_opts.reset(new fst::RandGenOptions<enum fst::script::RandArcSelection> (__pyx_v_ras, __pyx_v_max_length, __pyx_v_npath, __pyx_v_weighted, __pyx_v_remove_total_weight));
-
- /* "pywrapfst.pyx":3980
- * remove_total_weight))
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
+ * 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_v__select = __pyx_t_2;
+
+ /* "pywrapfst.pyx":4008
+ * cdef fst.RandArcSelection _select = _get_rand_arc_selection(tostring(select))
+ * cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
+ * _opts.reset( # <<<<<<<<<<<<<<
+ * new fst.RandGenOptions[fst.RandArcSelection](_select,
+ * max_length,
+ */
+ __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
+ * remove_total_weight))
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
* if seed == 0:
- * seed = time(NULL) + getpid()
+ * seed = time(NULL)
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 3980, __pyx_L1_error)
+ __PYX_ERR(0, 4015, __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)));
+ __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":3981
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
+ /* "pywrapfst.pyx":4016
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* if seed == 0: # <<<<<<<<<<<<<<
- * seed = time(NULL) + getpid()
- * fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts))
+ * seed = time(NULL)
+ * fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), seed)
*/
__pyx_t_3 = ((__pyx_v_seed == 0) != 0);
if (__pyx_t_3) {
- /* "pywrapfst.pyx":3982
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
+ /* "pywrapfst.pyx":4017
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* if seed == 0:
- * seed = time(NULL) + getpid() # <<<<<<<<<<<<<<
- * fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts))
- * return _init_MutableFst(tfst.release())
+ * seed = time(NULL) # <<<<<<<<<<<<<<
+ * fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), seed)
+ * return _init_MutableFst(_tfst.release())
*/
- __pyx_v_seed = (time(NULL) + getpid());
+ __pyx_v_seed = time(NULL);
- /* "pywrapfst.pyx":3981
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
+ /* "pywrapfst.pyx":4016
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* if seed == 0: # <<<<<<<<<<<<<<
- * seed = time(NULL) + getpid()
- * fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts))
+ * seed = time(NULL)
+ * fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), seed)
*/
}
- /* "pywrapfst.pyx":3983
+ /* "pywrapfst.pyx":4018
* if seed == 0:
- * seed = time(NULL) + getpid()
- * fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts)) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
+ * seed = time(NULL)
+ * fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), seed) # <<<<<<<<<<<<<<
+ * 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, 3983, __pyx_L1_error)
+ __PYX_ERR(0, 4018, __pyx_L1_error)
}
- fst::script::RandGen((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_seed, (*__pyx_v_opts));
+ fst::script::RandGen((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts), __pyx_v_seed);
- /* "pywrapfst.pyx":3984
- * seed = time(NULL) + getpid()
- * fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts))
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4019
+ * 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, 3984, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_4);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3936
+ /* "pywrapfst.pyx":3970
*
*
* cpdef MutableFst randgen(Fst ifst, # <<<<<<<<<<<<<<
* int32 npath=1,
- * time_t seed=0,
+ * select="uniform",
*/
/* function exit code */
static PyObject *__pyx_pw_9pywrapfst_49randgen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
int32 __pyx_v_npath;
- time_t __pyx_v_seed;
PyObject *__pyx_v_select = 0;
int32 __pyx_v_max_length;
bool __pyx_v_weighted;
bool __pyx_v_remove_total_weight;
+ uint64 __pyx_v_seed;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("randgen (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_npath,&__pyx_n_s_seed,&__pyx_n_s_select,&__pyx_n_s_max_length,&__pyx_n_s_weighted,&__pyx_n_s_remove_total_weight,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_npath,&__pyx_n_s_select,&__pyx_n_s_max_length,&__pyx_n_s_weighted,&__pyx_n_s_remove_total_weight,&__pyx_n_s_seed,0};
PyObject* values[7] = {0,0,0,0,0,0,0};
- values[3] = ((PyObject *)__pyx_n_b_uniform);
+ values[2] = ((PyObject *)__pyx_n_u_uniform);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seed);
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_select);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_select);
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_length);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_length);
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weighted);
if (value) { values[4] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 5:
if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weighted);
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove_total_weight);
if (value) { values[5] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 6:
if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove_total_weight);
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seed);
if (value) { values[6] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randgen") < 0)) __PYX_ERR(0, 3936, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randgen") < 0)) __PYX_ERR(0, 3970, __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, 3937, __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, 3971, __pyx_L3_error)
} else {
__pyx_v_npath = ((int32)1);
}
- if (values[2]) {
- __pyx_v_seed = __Pyx_PyInt_As_time_t(values[2]); if (unlikely((__pyx_v_seed == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3938, __pyx_L3_error)
+ __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)
} else {
- __pyx_v_seed = ((time_t)0);
+ __pyx_v_max_length = __pyx_k__46;
}
- __pyx_v_select = values[3];
if (values[4]) {
- __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[4]); if (unlikely((__pyx_v_max_length == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3940, __pyx_L3_error)
- } else {
- __pyx_v_max_length = __pyx_k__44;
- }
- if (values[5]) {
- __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3941, __pyx_L3_error)
+ __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3974, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3941
- * select=b"uniform",
+ /* "pywrapfst.pyx":3974
+ * select="uniform",
* int32 max_length=INT32_MAX,
* bool weighted=False, # <<<<<<<<<<<<<<
- * bool remove_total_weight=False):
- * """
+ * bool remove_total_weight=False,
+ * uint64 seed=0):
*/
__pyx_v_weighted = ((bool)0);
}
- if (values[6]) {
- __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3942, __pyx_L3_error)
+ 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)
} else {
- /* "pywrapfst.pyx":3942
+ /* "pywrapfst.pyx":3975
* int32 max_length=INT32_MAX,
* bool weighted=False,
- * bool remove_total_weight=False): # <<<<<<<<<<<<<<
+ * bool remove_total_weight=False, # <<<<<<<<<<<<<<
+ * uint64 seed=0):
* """
- * randgen(ifst, npath=1, seed=0, select="uniform", max_length=2147483647,
*/
__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)
+ } 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, 3936, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("randgen", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3970, __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, 3936, __pyx_L1_error)
- __pyx_r = __pyx_pf_9pywrapfst_48randgen(__pyx_self, __pyx_v_ifst, __pyx_v_npath, __pyx_v_seed, __pyx_v_select, __pyx_v_max_length, __pyx_v_weighted, __pyx_v_remove_total_weight);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3970, __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":3936
+ /* "pywrapfst.pyx":3970
*
*
* cpdef MutableFst randgen(Fst ifst, # <<<<<<<<<<<<<<
* int32 npath=1,
- * time_t seed=0,
+ * select="uniform",
*/
/* function exit code */
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_48randgen(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, int32 __pyx_v_npath, time_t __pyx_v_seed, PyObject *__pyx_v_select, int32 __pyx_v_max_length, bool __pyx_v_weighted, bool __pyx_v_remove_total_weight) {
+static PyObject *__pyx_pf_9pywrapfst_48randgen(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, int32 __pyx_v_npath, PyObject *__pyx_v_select, int32 __pyx_v_max_length, bool __pyx_v_weighted, bool __pyx_v_remove_total_weight, uint64 __pyx_v_seed) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_randgen __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("randgen", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 6;
__pyx_t_2.npath = __pyx_v_npath;
- __pyx_t_2.seed = __pyx_v_seed;
__pyx_t_2.select = __pyx_v_select;
__pyx_t_2.max_length = __pyx_v_max_length;
__pyx_t_2.remove_total_weight = __pyx_v_weighted;
__pyx_t_2.weighted = __pyx_v_remove_total_weight;
- __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_randgen(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3936, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":3987
+/* "pywrapfst.pyx":4022
*
*
* cpdef MutableFst replace(pairs, # <<<<<<<<<<<<<<
- * call_arc_labeling=b"input",
- * return_arc_labeling=b"neither",
+ * call_arc_labeling="input",
+ * return_arc_labeling="neither",
*/
static PyObject *__pyx_pw_9pywrapfst_51replace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_replace(PyObject *__pyx_v_pairs, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_replace *__pyx_optional_args) {
- PyObject *__pyx_v_call_arc_labeling = ((PyObject *)__pyx_n_b_input);
- PyObject *__pyx_v_return_arc_labeling = ((PyObject *)__pyx_n_b_neither);
+ PyObject *__pyx_v_call_arc_labeling = ((PyObject *)__pyx_n_u_input);
+ PyObject *__pyx_v_return_arc_labeling = ((PyObject *)__pyx_n_u_neither);
- /* "pywrapfst.pyx":3990
- * call_arc_labeling=b"input",
- * return_arc_labeling=b"neither",
+ /* "pywrapfst.pyx":4025
+ * call_arc_labeling="input",
+ * return_arc_labeling="neither",
* bool epsilon_on_replace=False, # <<<<<<<<<<<<<<
* int64 return_label=0):
* """
*/
bool __pyx_v_epsilon_on_replace = ((bool)0);
int64 __pyx_v_return_label = ((int64)0);
+ int64 __pyx_v__label;
+ struct __pyx_obj_9pywrapfst_Fst *__pyx_v__pfst = 0;
std::vector<__pyx_t_10cpywrapfst_LabelFstClassPair> __pyx_v__pairs;
- int64 __pyx_v_label;
- struct __pyx_obj_9pywrapfst_Fst *__pyx_v_pfst = 0;
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- enum fst::ReplaceLabelType __pyx_v_cal;
- enum fst::ReplaceLabelType __pyx_v_ral;
- std::unique_ptr<fst::script::ReplaceOptions> __pyx_v_opts;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
+ enum fst::ReplaceLabelType __pyx_v__cal;
+ enum fst::ReplaceLabelType __pyx_v__ral;
+ std::unique_ptr<fst::script::ReplaceOptions> __pyx_v__opts;
struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__pyx_t_10cpywrapfst_LabelFstClassPair __pyx_t_10;
std::string __pyx_t_11;
enum fst::ReplaceLabelType __pyx_t_12;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("replace", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":4031
- * cdef int64 label
- * cdef Fst pfst
- * for (label, pfst) in pairs: # <<<<<<<<<<<<<<
- * _pairs.push_back(fst.LabelFstClassPair(label, pfst._fst.get()))
- * cdef unique_ptr[fst.VectorFstClass] tfst
+ /* "pywrapfst.pyx":4066
+ * cdef Fst _pfst
+ * cdef vector[fst.LabelFstClassPair] _pairs
+ * for (_label, _pfst) in pairs: # <<<<<<<<<<<<<<
+ * _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get()))
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
*/
if (likely(PyList_CheckExact(__pyx_v_pairs)) || PyTuple_CheckExact(__pyx_v_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, 4031, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
- __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4031, __pyx_L1_error)
+ __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4066, __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, 4031, __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, 4066, __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, 4031, __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, 4066, __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, 4031, __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, 4066, __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, 4031, __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, 4066, __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, 4031, __pyx_L1_error)
+ else __PYX_ERR(0, 4066, __pyx_L1_error)
}
break;
}
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 4031, __pyx_L1_error)
+ __PYX_ERR(0, 4066, __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, 4031, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4066, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4031, __pyx_L1_error)
+ __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4066, __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, 4031, __pyx_L1_error)
+ __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4066, __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, 4031, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 4066, __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, 4031, __pyx_L1_error)
+ __PYX_ERR(0, 4066, __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, 4031, __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, 4066, __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, 4031, __pyx_L1_error)
- __pyx_v_label = __pyx_t_9;
- __Pyx_XDECREF_SET(__pyx_v_pfst, ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_6));
+ if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 4066, __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":4032
- * cdef Fst pfst
- * for (label, pfst) in pairs:
- * _pairs.push_back(fst.LabelFstClassPair(label, pfst._fst.get())) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))
+ /* "pywrapfst.pyx":4067
+ * cdef vector[fst.LabelFstClassPair] _pairs
+ * for (_label, _pfst) in pairs:
+ * _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get())) # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))
*/
- if (unlikely(((PyObject *)__pyx_v_pfst) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v__pfst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4032, __pyx_L1_error)
+ __PYX_ERR(0, 4067, __pyx_L1_error)
}
try {
- __pyx_t_10 = __pyx_t_10cpywrapfst_LabelFstClassPair(__pyx_v_label, __pyx_v_pfst->_fst.get());
+ __pyx_t_10 = __pyx_t_10cpywrapfst_LabelFstClassPair(__pyx_v__label, __pyx_v__pfst->_fst.get());
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 4032, __pyx_L1_error)
+ __PYX_ERR(0, 4067, __pyx_L1_error)
}
try {
__pyx_v__pairs.push_back(__pyx_t_10);
} catch(...) {
__Pyx_CppExn2PyErr();
- __PYX_ERR(0, 4032, __pyx_L1_error)
+ __PYX_ERR(0, 4067, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4031
- * cdef int64 label
- * cdef Fst pfst
- * for (label, pfst) in pairs: # <<<<<<<<<<<<<<
- * _pairs.push_back(fst.LabelFstClassPair(label, pfst._fst.get()))
- * cdef unique_ptr[fst.VectorFstClass] tfst
+ /* "pywrapfst.pyx":4066
+ * cdef Fst _pfst
+ * cdef vector[fst.LabelFstClassPair] _pairs
+ * for (_label, _pfst) in pairs: # <<<<<<<<<<<<<<
+ * _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get()))
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
*/
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":4034
- * _pairs.push_back(fst.LabelFstClassPair(label, pfst._fst.get()))
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType())) # <<<<<<<<<<<<<<
- * cdef fst.ReplaceLabelType cal = _get_replace_label_type(
+ /* "pywrapfst.pyx":4069
+ * _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get()))
+ * 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),
*/
- __pyx_v_tfst.reset(new fst::script::VectorFstClass((__pyx_v__pairs[0]).second->ArcType()));
+ __pyx_v__tfst.reset(new fst::script::VectorFstClass((__pyx_v__pairs[0]).second->ArcType()));
- /* "pywrapfst.pyx":4036
- * tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))
- * cdef fst.ReplaceLabelType cal = _get_replace_label_type(
+ /* "pywrapfst.pyx":4071
+ * _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(
+ * 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, 4036, __pyx_L1_error)
+ __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_call_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4071, __pyx_L1_error)
- /* "pywrapfst.pyx":4035
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))
- * cdef fst.ReplaceLabelType cal = _get_replace_label_type( # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4070
+ * 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, 4035, __pyx_L1_error)
- __pyx_v_cal = __pyx_t_12;
+ __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_v__cal = __pyx_t_12;
- /* "pywrapfst.pyx":4039
+ /* "pywrapfst.pyx":4074
* epsilon_on_replace)
- * cdef fst.ReplaceLabelType ral = _get_replace_label_type(
+ * cdef fst.ReplaceLabelType _ral = _get_replace_label_type(
* tostring(return_arc_labeling), # <<<<<<<<<<<<<<
* epsilon_on_replace)
- * cdef unique_ptr[fst.ReplaceOptions] opts
+ * 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, 4039, __pyx_L1_error)
+ __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_return_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4074, __pyx_L1_error)
- /* "pywrapfst.pyx":4038
+ /* "pywrapfst.pyx":4073
* tostring(call_arc_labeling),
* epsilon_on_replace)
- * cdef fst.ReplaceLabelType ral = _get_replace_label_type( # <<<<<<<<<<<<<<
+ * 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, 4038, __pyx_L1_error)
- __pyx_v_ral = __pyx_t_12;
+ __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_v__ral = __pyx_t_12;
- /* "pywrapfst.pyx":4042
+ /* "pywrapfst.pyx":4077
* epsilon_on_replace)
- * 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))
- * return _init_MutableFst(tfst.release())
+ * 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))
+ * return _init_MutableFst(_tfst.release())
*/
- __pyx_v_opts.reset(new fst::script::ReplaceOptions((__pyx_v__pairs[0]).first, __pyx_v_cal, __pyx_v_ral, __pyx_v_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":4043
- * 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)) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
+ /* "pywrapfst.pyx":4078
+ * 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)) # <<<<<<<<<<<<<<
+ * return _init_MutableFst(_tfst.release())
*
*/
- fst::script::Replace(__pyx_v__pairs, __pyx_v_tfst.get(), (*__pyx_v_opts));
+ fst::script::Replace(__pyx_v__pairs, __pyx_v__tfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":4044
- * opts.reset(new fst.ReplaceOptions(_pairs[0].first, cal, ral, return_label))
- * fst.Replace(_pairs, tfst.get(), deref(opts))
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4079
+ * _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, 4044, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":3987
+ /* "pywrapfst.pyx":4022
*
*
* cpdef MutableFst replace(pairs, # <<<<<<<<<<<<<<
- * call_arc_labeling=b"input",
- * return_arc_labeling=b"neither",
+ * call_arc_labeling="input",
+ * return_arc_labeling="neither",
*/
/* function exit code */
__Pyx_AddTraceback("pywrapfst.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_pfst);
+ __Pyx_XDECREF((PyObject *)__pyx_v__pfst);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
PyObject *__pyx_v_return_arc_labeling = 0;
bool __pyx_v_epsilon_on_replace;
int64 __pyx_v_return_label;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("replace (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pairs,&__pyx_n_s_call_arc_labeling,&__pyx_n_s_return_arc_labeling,&__pyx_n_s_epsilon_on_replace,&__pyx_n_s_return_label,0};
PyObject* values[5] = {0,0,0,0,0};
- values[1] = ((PyObject *)__pyx_n_b_input);
- values[2] = ((PyObject *)__pyx_n_b_neither);
+ values[1] = ((PyObject *)__pyx_n_u_input);
+ values[2] = ((PyObject *)__pyx_n_u_neither);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(0, 3987, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(0, 4022, __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, 3990, __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, 4025, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":3990
- * call_arc_labeling=b"input",
- * return_arc_labeling=b"neither",
+ /* "pywrapfst.pyx":4025
+ * call_arc_labeling="input",
+ * return_arc_labeling="neither",
* bool epsilon_on_replace=False, # <<<<<<<<<<<<<<
* int64 return_label=0):
* """
__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, 3991, __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, 4026, __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, 3987, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("replace", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4022, __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":3987
+ /* "pywrapfst.pyx":4022
*
*
* cpdef MutableFst replace(pairs, # <<<<<<<<<<<<<<
- * call_arc_labeling=b"input",
- * return_arc_labeling=b"neither",
+ * call_arc_labeling="input",
+ * return_arc_labeling="neither",
*/
/* function exit code */
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_replace __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("replace", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 4;
__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, 3987, __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, 4022, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4047
+/* "pywrapfst.pyx":4082
*
*
* cpdef MutableFst reverse(Fst ifst, bool require_superinitial=True): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_53reverse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_reverse(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_reverse *__pyx_optional_args) {
bool __pyx_v_require_superinitial = ((bool)1);
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
struct __pyx_obj_9pywrapfst_MutableFst *__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("reverse", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":4067
+ /* "pywrapfst.pyx":4102
* """
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
- * fst.Reverse(deref(ifst._fst), tfst.get(), require_superinitial)
- * return _init_MutableFst(tfst.release())
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
+ * fst.Reverse(deref(ifst._fst), _tfst.get(), require_superinitial)
+ * return _init_MutableFst(_tfst.release())
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 4067, __pyx_L1_error)
+ __PYX_ERR(0, 4102, __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)));
+ __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":4068
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
- * fst.Reverse(deref(ifst._fst), tfst.get(), require_superinitial) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
+ /* "pywrapfst.pyx":4103
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
+ * fst.Reverse(deref(ifst._fst), _tfst.get(), require_superinitial) # <<<<<<<<<<<<<<
+ * 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, 4068, __pyx_L1_error)
+ __PYX_ERR(0, 4103, __pyx_L1_error)
}
- fst::script::Reverse((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_require_superinitial);
+ fst::script::Reverse((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_v_require_superinitial);
- /* "pywrapfst.pyx":4069
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
- * fst.Reverse(deref(ifst._fst), tfst.get(), require_superinitial)
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4104
+ * _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, 4069, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4047
+ /* "pywrapfst.pyx":4082
*
*
* cpdef MutableFst reverse(Fst ifst, bool require_superinitial=True): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_53reverse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
bool __pyx_v_require_superinitial;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reverse (wrapper)", 0);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reverse") < 0)) __PYX_ERR(0, 4047, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reverse") < 0)) __PYX_ERR(0, 4082, __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, 4047, __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, 4082, __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, 4047, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("reverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4082, __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, 4047, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4082, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_52reverse(__pyx_self, __pyx_v_ifst, __pyx_v_require_superinitial);
/* function exit code */
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_reverse __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reverse", 0);
__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, 4047, __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, 4082, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4075
+/* "pywrapfst.pyx":4110
*
*
- * cdef vector[fst.WeightClass] *_shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
- * float delta=fst.kShortestDelta,
- * int64 nstate=fst.kNoStateId,
+ * cdef void _shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
+ * vector[fst.WeightClass] *distance,
+ * float delta=fst.kShortestDelta,
*/
-static std::vector<fst::script::WeightClass> *__pyx_f_9pywrapfst__shortestdistance(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__45;
- int64 __pyx_v_nstate = __pyx_k__46;
- PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);
+static void __pyx_f_9pywrapfst__shortestdistance(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, std::vector<fst::script::WeightClass> *__pyx_v_distance, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args) {
+ float __pyx_v_delta = __pyx_k__47;
+ int64 __pyx_v_nstate = __pyx_k__48;
+ PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":4079
- * int64 nstate=fst.kNoStateId,
- * queue_type=b"auto",
- * bool reverse=False) except *: # <<<<<<<<<<<<<<
- * cdef unique_ptr[vector[fst.WeightClass]] distance
- * distance.reset(new vector[fst.WeightClass]())
+ /* "pywrapfst.pyx":4115
+ * int64 nstate=fst.kNoStateId,
+ * queue_type="auto",
+ * bool reverse=False) except *: # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.ShortestDistanceOptions] _opts
+ * if reverse:
*/
bool __pyx_v_reverse = ((bool)0);
- std::unique_ptr<std::vector<fst::script::WeightClass> > __pyx_v_distance;
- std::unique_ptr<fst::script::ShortestDistanceOptions> __pyx_v_opts;
- std::vector<fst::script::WeightClass> *__pyx_r;
+ std::unique_ptr<fst::script::ShortestDistanceOptions> __pyx_v__opts;
__Pyx_RefNannyDeclarations
- std::vector<fst::script::WeightClass> *__pyx_t_1;
- int __pyx_t_2;
- std::string __pyx_t_3;
- enum fst::QueueType __pyx_t_4;
+ int __pyx_t_1;
+ std::string __pyx_t_2;
+ enum fst::QueueType __pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_shortestdistance", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":4081
- * bool reverse=False) except *:
- * cdef unique_ptr[vector[fst.WeightClass]] distance
- * distance.reset(new vector[fst.WeightClass]()) # <<<<<<<<<<<<<<
- * # For scoping reasons, these have to be declared here even though they may
- * # not be used in all cases.
- */
- try {
- __pyx_t_1 = new std::vector<fst::script::WeightClass> ();
- } catch(...) {
- __Pyx_CppExn2PyErr();
- __PYX_ERR(0, 4081, __pyx_L1_error)
- }
- __pyx_v_distance.reset(__pyx_t_1);
-
- /* "pywrapfst.pyx":4085
- * # not be used in all cases.
- * cdef unique_ptr[fst.ShortestDistanceOptions] opts
+ /* "pywrapfst.pyx":4117
+ * bool reverse=False) except *:
+ * cdef unique_ptr[fst.ShortestDistanceOptions] _opts
* if reverse: # <<<<<<<<<<<<<<
* # Only the simpler signature supports shortest distance to final states;
* # `nstate` and `queue_type` arguments are ignored.
*/
- __pyx_t_2 = (__pyx_v_reverse != 0);
- if (__pyx_t_2) {
+ __pyx_t_1 = (__pyx_v_reverse != 0);
+ if (__pyx_t_1) {
- /* "pywrapfst.pyx":4088
+ /* "pywrapfst.pyx":4120
* # Only the simpler signature supports shortest distance to final states;
* # `nstate` and `queue_type` arguments are ignored.
- * fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta) # <<<<<<<<<<<<<<
+ * fst.ShortestDistance(deref(ifst._fst), distance, True, delta) # <<<<<<<<<<<<<<
* else:
- * opts.reset(new fst.ShortestDistanceOptions(
+ * _opts.reset(
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4088, __pyx_L1_error)
+ __PYX_ERR(0, 4120, __pyx_L1_error)
}
- fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance.get(), 1, __pyx_v_delta);
+ fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance, 1, __pyx_v_delta);
- /* "pywrapfst.pyx":4085
- * # not be used in all cases.
- * cdef unique_ptr[fst.ShortestDistanceOptions] opts
+ /* "pywrapfst.pyx":4117
+ * bool reverse=False) except *:
+ * cdef unique_ptr[fst.ShortestDistanceOptions] _opts
* if reverse: # <<<<<<<<<<<<<<
* # Only the simpler signature supports shortest distance to final states;
* # `nstate` and `queue_type` arguments are ignored.
goto __pyx_L3;
}
- /* "pywrapfst.pyx":4090
- * fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta)
+ /* "pywrapfst.pyx":4122
+ * fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
* else:
- * opts.reset(new fst.ShortestDistanceOptions( # <<<<<<<<<<<<<<
- * _get_queue_type(tostring(queue_type)),
- * fst.ANY_ARC_FILTER,
+ * _opts.reset( # <<<<<<<<<<<<<<
+ * new fst.ShortestDistanceOptions(_get_queue_type(tostring(queue_type)),
+ * fst.ANY_ARC_FILTER,
*/
/*else*/ {
- /* "pywrapfst.pyx":4091
+ /* "pywrapfst.pyx":4123
* else:
- * opts.reset(new fst.ShortestDistanceOptions(
- * _get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
- * fst.ANY_ARC_FILTER,
- * nstate,
+ * _opts.reset(
+ * new fst.ShortestDistanceOptions(_get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
+ * fst.ANY_ARC_FILTER,
+ * nstate,
*/
- __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4091, __pyx_L1_error)
- __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4091, __pyx_L1_error)
+ __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)
- /* "pywrapfst.pyx":4090
- * fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta)
+ /* "pywrapfst.pyx":4122
+ * fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
* else:
- * opts.reset(new fst.ShortestDistanceOptions( # <<<<<<<<<<<<<<
- * _get_queue_type(tostring(queue_type)),
- * fst.ANY_ARC_FILTER,
+ * _opts.reset( # <<<<<<<<<<<<<<
+ * new fst.ShortestDistanceOptions(_get_queue_type(tostring(queue_type)),
+ * fst.ANY_ARC_FILTER,
*/
- __pyx_v_opts.reset(new fst::script::ShortestDistanceOptions(__pyx_t_4, fst::script::ANY_ARC_FILTER, __pyx_v_nstate, __pyx_v_delta));
+ __pyx_v__opts.reset(new fst::script::ShortestDistanceOptions(__pyx_t_3, fst::script::ANY_ARC_FILTER, __pyx_v_nstate, __pyx_v_delta));
- /* "pywrapfst.pyx":4095
- * nstate,
- * delta))
- * fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts)) # <<<<<<<<<<<<<<
- * return distance.release()
+ /* "pywrapfst.pyx":4127
+ * 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, 4095, __pyx_L1_error)
+ __PYX_ERR(0, 4127, __pyx_L1_error)
}
- fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance.get(), (*__pyx_v_opts));
+ fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance, (*__pyx_v__opts));
}
__pyx_L3:;
- /* "pywrapfst.pyx":4096
- * delta))
- * fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts))
- * return distance.release() # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4110
*
*
- */
- __pyx_r = __pyx_v_distance.release();
- goto __pyx_L0;
-
- /* "pywrapfst.pyx":4075
- *
- *
- * cdef vector[fst.WeightClass] *_shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
- * float delta=fst.kShortestDelta,
- * int64 nstate=fst.kNoStateId,
+ * cdef void _shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
+ * vector[fst.WeightClass] *distance,
+ * float delta=fst.kShortestDelta,
*/
/* function exit code */
+ goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("pywrapfst._shortestdistance", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
- return __pyx_r;
}
-/* "pywrapfst.pyx":4099
+/* "pywrapfst.pyx":4130
*
*
* def shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
int64 __pyx_v_nstate;
PyObject *__pyx_v_queue_type = 0;
bool __pyx_v_reverse;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("shortestdistance (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_queue_type,&__pyx_n_s_reverse,0};
PyObject* values[5] = {0,0,0,0,0};
- values[3] = ((PyObject *)__pyx_n_b_auto);
+ values[3] = ((PyObject *)__pyx_n_u_auto);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 4099, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 4130, __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, 4100, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 4131, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__47;
+ __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, 4101, __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, 4132, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__48;
+ __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, 4103, __pyx_L3_error)
+ __pyx_v_reverse = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_reverse == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4134, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4103
+ /* "pywrapfst.pyx":4134
* int64 nstate=fst.kNoStateId,
- * queue_type=b"auto",
+ * queue_type="auto",
* bool reverse=False): # <<<<<<<<<<<<<<
* """
* shortestdistance(ifst, delta=1e-6, nstate=NO_STATE_ID,
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4099, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4130, __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, 4099, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4130, __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":4099
+ /* "pywrapfst.pyx":4130
*
*
* def shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
}
static PyObject *__pyx_pf_9pywrapfst_54shortestdistance(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_reverse) {
- std::unique_ptr<std::vector<fst::script::WeightClass> > __pyx_v_distance;
- std::string __pyx_v_weight_type;
+ std::vector<fst::script::WeightClass> __pyx_v__distance;
fst::script::WeightClass __pyx_7genexpr__pyx_v_weight;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- std::vector<fst::script::WeightClass> *__pyx_t_1;
- struct __pyx_opt_args_9pywrapfst__shortestdistance __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- std::vector<fst::script::WeightClass> ::iterator __pyx_t_4;
- fst::script::WeightClass __pyx_t_5;
+ struct __pyx_opt_args_9pywrapfst__shortestdistance __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ std::vector<fst::script::WeightClass> ::iterator __pyx_t_3;
+ fst::script::WeightClass __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("shortestdistance", 0);
- /* "pywrapfst.pyx":4131
+ /* "pywrapfst.pyx":4162
* """
- * cdef unique_ptr[vector[fst.WeightClass]] distance
- * distance.reset(_shortestdistance(ifst, delta, nstate, queue_type, reverse)) # <<<<<<<<<<<<<<
- * cdef string weight_type = ifst.weight_type()
- * return [Weight(weight_type, weight.ToString()) for weight in deref(distance)]
+ * cdef vector[fst.WeightClass] _distance
+ * _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse) # <<<<<<<<<<<<<<
+ * return [Weight(ifst._fst.get().WeightType(), weight.ToString())
+ * for weight in _distance]
*/
- __pyx_t_2.__pyx_n = 4;
- __pyx_t_2.delta = __pyx_v_delta;
- __pyx_t_2.nstate = __pyx_v_nstate;
- __pyx_t_2.queue_type = __pyx_v_queue_type;
- __pyx_t_2.reverse = __pyx_v_reverse;
- __pyx_t_1 = __pyx_f_9pywrapfst__shortestdistance(__pyx_v_ifst, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4131, __pyx_L1_error)
- __pyx_v_distance.reset(__pyx_t_1);
+ __pyx_t_1.__pyx_n = 4;
+ __pyx_t_1.delta = __pyx_v_delta;
+ __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)
- /* "pywrapfst.pyx":4132
- * cdef unique_ptr[vector[fst.WeightClass]] distance
- * distance.reset(_shortestdistance(ifst, delta, nstate, queue_type, reverse))
- * cdef string weight_type = ifst.weight_type() # <<<<<<<<<<<<<<
- * return [Weight(weight_type, weight.ToString()) for weight in deref(distance)]
+ /* "pywrapfst.pyx":4163
+ * cdef vector[fst.WeightClass] _distance
+ * _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
+ * return [Weight(ifst._fst.get().WeightType(), weight.ToString()) # <<<<<<<<<<<<<<
+ * for weight in _distance]
*
*/
- if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
- PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
- __PYX_ERR(0, 4132, __pyx_L1_error)
- }
- __pyx_v_weight_type = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0);
+ __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_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4133
- * distance.reset(_shortestdistance(ifst, delta, nstate, queue_type, reverse))
- * cdef string weight_type = ifst.weight_type()
- * return [Weight(weight_type, weight.ToString()) for weight in deref(distance)] # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4164
+ * _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
+ * return [Weight(ifst._fst.get().WeightType(), weight.ToString())
+ * for weight in _distance] # <<<<<<<<<<<<<<
*
*
*/
- __Pyx_XDECREF(__pyx_r);
- { /* enter inner scope */
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4133, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = &(*__pyx_v_distance);
- __pyx_t_4 = __pyx_t_1->begin();
+ __pyx_t_3 = __pyx_v__distance.begin();
for (;;) {
- if (!(__pyx_t_4 != __pyx_t_1->end())) break;
- __pyx_t_5 = *__pyx_t_4;
- ++__pyx_t_4;
- __pyx_7genexpr__pyx_v_weight = __pyx_t_5;
- __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_weight_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4133, __pyx_L1_error)
+ if (!(__pyx_t_3 != __pyx_v__distance.end())) break;
+ __pyx_t_4 = *__pyx_t_3;
+ ++__pyx_t_3;
+ __pyx_7genexpr__pyx_v_weight = __pyx_t_4;
+
+ /* "pywrapfst.pyx":4163
+ * cdef vector[fst.WeightClass] _distance
+ * _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
+ * return [Weight(ifst._fst.get().WeightType(), weight.ToString()) # <<<<<<<<<<<<<<
+ * for weight in _distance]
+ *
+ */
+ 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_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_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_GOTREF(__pyx_t_6);
- __pyx_t_7 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_7genexpr__pyx_v_weight.ToString()); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4133, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4133, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
+ __pyx_t_5 = 0;
__pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4133, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 4133, __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, 4163, __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)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "pywrapfst.pyx":4164
+ * _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
+ * return [Weight(ifst._fst.get().WeightType(), weight.ToString())
+ * for weight in _distance] # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
} /* exit inner scope */
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4099
+ /* "pywrapfst.pyx":4130
*
*
* def shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
/* function exit code */
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("pywrapfst.shortestdistance", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":4136
+/* "pywrapfst.pyx":4167
*
*
* cpdef MutableFst shortestpath(Fst ifst, # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_57shortestpath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_shortestpath(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_shortestpath *__pyx_optional_args) {
- float __pyx_v_delta = __pyx_k__49;
+ float __pyx_v_delta = __pyx_k__51;
int32 __pyx_v_nshortest = ((int32)1);
- int64 __pyx_v_nstate = __pyx_k__50;
- PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);
+ int64 __pyx_v_nstate = __pyx_k__52;
+ PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":4141
+ /* "pywrapfst.pyx":4172
* int64 nstate=fst.kNoStateId,
- * queue_type=b"auto",
+ * queue_type="auto",
* bool unique=False, # <<<<<<<<<<<<<<
* weight=None):
* """
*/
bool __pyx_v_unique = ((bool)0);
- /* "pywrapfst.pyx":4142
- * queue_type=b"auto",
+ /* "pywrapfst.pyx":4173
+ * queue_type="auto",
* bool unique=False,
* weight=None): # <<<<<<<<<<<<<<
* """
* shortestpath(ifst, delta=1e-6, nshortest=1, nstate=NO_STATE_ID,
*/
PyObject *__pyx_v_weight = ((PyObject *)Py_None);
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
- fst::script::WeightClass __pyx_v_wc;
- std::unique_ptr<fst::script::ShortestPathOptions> __pyx_v_opts;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
+ fst::script::WeightClass __pyx_v__weight;
+ std::unique_ptr<fst::script::ShortestPathOptions> __pyx_v__opts;
struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
fst::script::WeightClass __pyx_t_1;
std::string __pyx_t_2;
enum fst::QueueType __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("shortestpath", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
}
}
- /* "pywrapfst.pyx":4174
+ /* "pywrapfst.pyx":4205
* """
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
+ * 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 wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
+ * 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, 4174, __pyx_L1_error)
+ __PYX_ERR(0, 4205, __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)));
+ __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":4176
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
+ /* "pywrapfst.pyx":4207
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.ShortestPathOptions] opts
- * opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_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, 4176, __pyx_L1_error)
+ __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, 4176, __pyx_L1_error)
- __pyx_v_wc = __pyx_t_1;
- /* "pywrapfst.pyx":4178
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
- * cdef unique_ptr[fst.ShortestPathOptions] opts
- * opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)), # <<<<<<<<<<<<<<
- * nshortest,
- * unique,
+ /* "pywrapfst.pyx":4208
+ * # Threshold is set to semiring Zero (no pruning) if no weight is specified.
+ * 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_v__weight = __pyx_t_1;
+
+ /* "pywrapfst.pyx":4211
+ * 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, 4178, __pyx_L1_error)
- __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4178, __pyx_L1_error)
+ __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)
- /* "pywrapfst.pyx":4183
- * delta,
- * wc,
- * nstate)) # <<<<<<<<<<<<<<
- * fst.ShortestPath(deref(ifst._fst), tfst.get(), deref(opts))
- * return _init_MutableFst(tfst.release())
+ /* "pywrapfst.pyx":4210
+ * weight)
+ * cdef unique_ptr[fst.ShortestPathOptions] _opts
+ * _opts.reset( # <<<<<<<<<<<<<<
+ * new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),
+ * nshortest,
*/
- __pyx_v_opts.reset(new fst::script::ShortestPathOptions(__pyx_t_3, __pyx_v_nshortest, __pyx_v_unique, __pyx_v_delta, __pyx_v_wc, __pyx_v_nstate));
+ __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":4184
- * wc,
- * nstate))
- * fst.ShortestPath(deref(ifst._fst), tfst.get(), deref(opts)) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
+ /* "pywrapfst.pyx":4217
+ * _weight,
+ * nstate))
+ * fst.ShortestPath(deref(ifst._fst), _tfst.get(), deref(_opts)) # <<<<<<<<<<<<<<
+ * return _init_MutableFst(_tfst.release())
*
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
- __PYX_ERR(0, 4184, __pyx_L1_error)
+ __PYX_ERR(0, 4217, __pyx_L1_error)
}
- fst::script::ShortestPath((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));
+ fst::script::ShortestPath((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
- /* "pywrapfst.pyx":4185
- * nstate))
- * fst.ShortestPath(deref(ifst._fst), tfst.get(), deref(opts))
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4218
+ * 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, 4185, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_4);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4136
+ /* "pywrapfst.pyx":4167
*
*
* cpdef MutableFst shortestpath(Fst ifst, # <<<<<<<<<<<<<<
PyObject *__pyx_v_queue_type = 0;
bool __pyx_v_unique;
PyObject *__pyx_v_weight = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("shortestpath (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nshortest,&__pyx_n_s_nstate,&__pyx_n_s_queue_type,&__pyx_n_s_unique,&__pyx_n_s_weight,0};
PyObject* values[7] = {0,0,0,0,0,0,0};
- values[4] = ((PyObject *)__pyx_n_b_auto);
+ values[4] = ((PyObject *)__pyx_n_u_auto);
- /* "pywrapfst.pyx":4142
- * queue_type=b"auto",
+ /* "pywrapfst.pyx":4173
+ * 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, 4136, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestpath") < 0)) __PYX_ERR(0, 4167, __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, 4137, __pyx_L3_error)
+ __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 4168, __pyx_L3_error)
} else {
- __pyx_v_delta = __pyx_k__49;
+ __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, 4138, __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, 4169, __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, 4139, __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, 4170, __pyx_L3_error)
} else {
- __pyx_v_nstate = __pyx_k__50;
+ __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, 4141, __pyx_L3_error)
+ __pyx_v_unique = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_unique == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4172, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4141
+ /* "pywrapfst.pyx":4172
* int64 nstate=fst.kNoStateId,
- * queue_type=b"auto",
+ * queue_type="auto",
* bool unique=False, # <<<<<<<<<<<<<<
* weight=None):
* """
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4136, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4167, __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, 4136, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4167, __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":4136
+ /* "pywrapfst.pyx":4167
*
*
* cpdef MutableFst shortestpath(Fst ifst, # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst_shortestpath __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("shortestpath", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 6;
__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, 4136, __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, 4167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4188
+/* "pywrapfst.pyx":4221
*
*
* cpdef Fst statemap(Fst ifst, map_type): # <<<<<<<<<<<<<<
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_9pywrapfst__map __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("statemap", 0);
- /* "pywrapfst.pyx":4211
+ /* "pywrapfst.pyx":4244
* 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, 4211, __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, 4244, __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":4188
+ /* "pywrapfst.pyx":4221
*
*
* cpdef Fst statemap(Fst ifst, map_type): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_59statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
PyObject *__pyx_v_map_type = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("statemap (wrapper)", 0);
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_map_type)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4188, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4221, __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, 4188, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "statemap") < 0)) __PYX_ERR(0, 4221, __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, 4188, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4221, __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, 4188, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4221, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_58statemap(__pyx_self, __pyx_v_ifst, __pyx_v_map_type);
/* function exit code */
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("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, 4188, __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, 4221, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4214
+/* "pywrapfst.pyx":4247
*
*
* cpdef MutableFst synchronize(Fst ifst): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_61synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableFst *__pyx_f_9pywrapfst_synchronize(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch) {
- std::unique_ptr<fst::script::VectorFstClass> __pyx_v_tfst;
+ std::unique_ptr<fst::script::VectorFstClass> __pyx_v__tfst;
struct __pyx_obj_9pywrapfst_MutableFst *__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("synchronize", 0);
- /* "pywrapfst.pyx":4234
+ /* "pywrapfst.pyx":4267
* """
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
- * fst.Synchronize(deref(ifst._fst), tfst.get())
- * return _init_MutableFst(tfst.release())
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type())) # <<<<<<<<<<<<<<
+ * fst.Synchronize(deref(ifst._fst), _tfst.get())
+ * return _init_MutableFst(_tfst.release())
*/
if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
- __PYX_ERR(0, 4234, __pyx_L1_error)
+ __PYX_ERR(0, 4267, __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)));
+ __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":4235
- * cdef unique_ptr[fst.VectorFstClass] tfst
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
- * fst.Synchronize(deref(ifst._fst), tfst.get()) # <<<<<<<<<<<<<<
- * return _init_MutableFst(tfst.release())
+ /* "pywrapfst.pyx":4268
+ * cdef unique_ptr[fst.VectorFstClass] _tfst
+ * _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
+ * fst.Synchronize(deref(ifst._fst), _tfst.get()) # <<<<<<<<<<<<<<
+ * 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, 4235, __pyx_L1_error)
+ __PYX_ERR(0, 4268, __pyx_L1_error)
}
- fst::script::Synchronize((*__pyx_v_ifst->_fst), __pyx_v_tfst.get());
+ fst::script::Synchronize((*__pyx_v_ifst->_fst), __pyx_v__tfst.get());
- /* "pywrapfst.pyx":4236
- * tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
- * fst.Synchronize(deref(ifst._fst), tfst.get())
- * return _init_MutableFst(tfst.release()) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4269
+ * _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, 4236, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4214
+ /* "pywrapfst.pyx":4247
*
*
* cpdef MutableFst synchronize(Fst ifst): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_61synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst); /*proto*/
static char __pyx_doc_9pywrapfst_60synchronize[] = "\n synchronize(ifst)\n\n Constructively synchronizes an FST.\n\n This operation synchronizes a transducer. The result will be an equivalent\n FST that has the property that during the traversal of a path, the delay is\n either zero or strictly increasing, where the delay is the difference between\n the number of non-epsilon output labels and input labels along the path. For\n the algorithm to terminate, the input transducer must have bounded delay,\n i.e., the delay of every cycle must be zero.\n\n Args:\n ifst: The input FST.\n\n Returns:\n An equivalent synchronized FST.\n ";
static PyObject *__pyx_pw_9pywrapfst_61synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
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, 4214, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4247, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_60synchronize(__pyx_self, ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_ifst));
/* function exit code */
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("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, 4214, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4293
+/* "pywrapfst.pyx":4326
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
- * string fst_type=b"vector",
- * string arc_type=b"standard",
+ * str fst_type="vector",
+ * str arc_type="standard",
*/
/* Python wrapper */
static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- std::string __pyx_v_fst_type;
- std::string __pyx_v_arc_type;
+ PyObject *__pyx_v_fst_type = 0;
+ PyObject *__pyx_v_arc_type = 0;
struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_isymbols = 0;
struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_osymbols = 0;
struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_ssymbols = 0;
bool __pyx_v_keep_osymbols;
bool __pyx_v_keep_state_numbering;
bool __pyx_v_allow_negative_labels;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fst_type,&__pyx_n_s_arc_type,&__pyx_n_s_isymbols,&__pyx_n_s_osymbols,&__pyx_n_s_ssymbols,&__pyx_n_s_acceptor,&__pyx_n_s_keep_isymbols,&__pyx_n_s_keep_osymbols,&__pyx_n_s_keep_state_numbering,&__pyx_n_s_allow_negative_labels,0};
PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
+ values[0] = ((PyObject*)__pyx_n_u_vector);
+ values[1] = ((PyObject*)__pyx_n_u_standard);
- /* "pywrapfst.pyx":4296
- * string fst_type=b"vector",
- * string arc_type=b"standard",
+ /* "pywrapfst.pyx":4329
+ * str fst_type="vector",
+ * str arc_type="standard",
* SymbolTable isymbols=None, # <<<<<<<<<<<<<<
* SymbolTable osymbols=None,
* SymbolTable ssymbols=None,
*/
values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
- /* "pywrapfst.pyx":4297
- * string arc_type=b"standard",
+ /* "pywrapfst.pyx":4330
+ * str arc_type="standard",
* SymbolTable isymbols=None,
* SymbolTable osymbols=None, # <<<<<<<<<<<<<<
* SymbolTable ssymbols=None,
*/
values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
- /* "pywrapfst.pyx":4298
+ /* "pywrapfst.pyx":4331
* 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, 4293, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 4326, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
default: goto __pyx_L5_argtuple_error;
}
}
- if (values[0]) {
- __pyx_v_fst_type = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4294, __pyx_L3_error)
- } else {
- __pyx_v_fst_type = __pyx_k__51;
- }
- if (values[1]) {
- __pyx_v_arc_type = __pyx_convert_string_from_py_std__in_string(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4295, __pyx_L3_error)
- } else {
- __pyx_v_arc_type = __pyx_k__52;
- }
+ __pyx_v_fst_type = ((PyObject*)values[0]);
+ __pyx_v_arc_type = ((PyObject*)values[1]);
__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)values[2]);
__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)values[3]);
__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)values[4]);
if (values[5]) {
- __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4299, __pyx_L3_error)
+ __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4332, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4299
+ /* "pywrapfst.pyx":4332
* 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, 4300, __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, 4333, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4300
+ /* "pywrapfst.pyx":4333
* 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, 4301, __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, 4334, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4301
+ /* "pywrapfst.pyx":4334
* 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, 4302, __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, 4335, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4302
+ /* "pywrapfst.pyx":4335
* 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, 4303, __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, 4336, __pyx_L3_error)
} else {
- /* "pywrapfst.pyx":4303
+ /* "pywrapfst.pyx":4336
* 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, 4293, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4326, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.Compiler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 4296, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4297, __pyx_L1_error)
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4298, __pyx_L1_error)
+ 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)
__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":4293
+ /* "pywrapfst.pyx":4326
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
- * string fst_type=b"vector",
- * string arc_type=b"standard",
+ * str fst_type="vector",
+ * str arc_type="standard",
*/
/* function exit code */
return __pyx_r;
}
-static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, std::string __pyx_v_fst_type, std::string __pyx_v_arc_type, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_keep_isymbols, bool __pyx_v_keep_osymbols, bool __pyx_v_keep_state_numbering, bool __pyx_v_allow_negative_labels) {
+static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_fst_type, PyObject *__pyx_v_arc_type, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_keep_isymbols, bool __pyx_v_keep_osymbols, bool __pyx_v_keep_state_numbering, bool __pyx_v_allow_negative_labels) {
int __pyx_r;
__Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- std::string __pyx_t_2;
+ std::string __pyx_t_1;
+ int __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
- fst::SymbolTable const *__pyx_t_5;
+ fst::SymbolTable const *__pyx_t_4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "pywrapfst.pyx":4304
+ /* "pywrapfst.pyx":4337
* 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, 4304, __pyx_L1_error)
+ __PYX_ERR(0, 4337, __pyx_L1_error)
}
__pyx_v_self->_sstrm.reset(new std::stringstream());
- /* "pywrapfst.pyx":4305
+ /* "pywrapfst.pyx":4338
* bool allow_negative_labels=False):
* self._sstrm.reset(new stringstream())
* self._fst_type = tostring(fst_type) # <<<<<<<<<<<<<<
* self._arc_type = tostring(arc_type)
* self._isymbols = NULL
*/
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4305, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4305, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4338, __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, 4305, __pyx_L1_error)
+ __PYX_ERR(0, 4338, __pyx_L1_error)
}
- __pyx_v_self->_fst_type = __pyx_t_2;
+ __pyx_v_self->_fst_type = __pyx_t_1;
- /* "pywrapfst.pyx":4306
+ /* "pywrapfst.pyx":4339
* self._sstrm.reset(new stringstream())
* self._fst_type = tostring(fst_type)
* self._arc_type = tostring(arc_type) # <<<<<<<<<<<<<<
* self._isymbols = NULL
* if isymbols is not None:
*/
- __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4306, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4306, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4339, __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, 4306, __pyx_L1_error)
+ __PYX_ERR(0, 4339, __pyx_L1_error)
}
- __pyx_v_self->_arc_type = __pyx_t_2;
+ __pyx_v_self->_arc_type = __pyx_t_1;
- /* "pywrapfst.pyx":4307
+ /* "pywrapfst.pyx":4340
* 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, 4307, __pyx_L1_error)
+ __PYX_ERR(0, 4340, __pyx_L1_error)
}
__pyx_v_self->_isymbols = NULL;
- /* "pywrapfst.pyx":4308
+ /* "pywrapfst.pyx":4341
* self._arc_type = tostring(arc_type)
* self._isymbols = NULL
* if isymbols is not None: # <<<<<<<<<<<<<<
* self._isymbols = isymbols._raw_ptr_or_raise()
* self._osymbols = NULL
*/
- __pyx_t_3 = (((PyObject *)__pyx_v_isymbols) != Py_None);
- __pyx_t_4 = (__pyx_t_3 != 0);
- if (__pyx_t_4) {
+ __pyx_t_2 = (((PyObject *)__pyx_v_isymbols) != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
- /* "pywrapfst.pyx":4309
+ /* "pywrapfst.pyx":4342
* 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, 4309, __pyx_L1_error)
+ __PYX_ERR(0, 4342, __pyx_L1_error)
}
- __pyx_t_5 = ((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__SymbolTable *)__pyx_v_isymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4309, __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)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
- __PYX_ERR(0, 4309, __pyx_L1_error)
+ __PYX_ERR(0, 4342, __pyx_L1_error)
}
- __pyx_v_self->_isymbols = __pyx_t_5;
+ __pyx_v_self->_isymbols = __pyx_t_4;
- /* "pywrapfst.pyx":4308
+ /* "pywrapfst.pyx":4341
* self._arc_type = tostring(arc_type)
* self._isymbols = NULL
* if isymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4310
+ /* "pywrapfst.pyx":4343
* 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, 4310, __pyx_L1_error)
+ __PYX_ERR(0, 4343, __pyx_L1_error)
}
__pyx_v_self->_osymbols = NULL;
- /* "pywrapfst.pyx":4311
+ /* "pywrapfst.pyx":4344
* self._isymbols = isymbols._raw_ptr_or_raise()
* self._osymbols = NULL
* if osymbols is not None: # <<<<<<<<<<<<<<
* self._osymbols = osymbols._raw_ptr_or_raise()
* self._ssymbols = NULL
*/
- __pyx_t_4 = (((PyObject *)__pyx_v_osymbols) != Py_None);
- __pyx_t_3 = (__pyx_t_4 != 0);
- if (__pyx_t_3) {
+ __pyx_t_3 = (((PyObject *)__pyx_v_osymbols) != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
- /* "pywrapfst.pyx":4312
+ /* "pywrapfst.pyx":4345
* 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, 4312, __pyx_L1_error)
+ __PYX_ERR(0, 4345, __pyx_L1_error)
}
- __pyx_t_5 = ((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__SymbolTable *)__pyx_v_osymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4312, __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)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
- __PYX_ERR(0, 4312, __pyx_L1_error)
+ __PYX_ERR(0, 4345, __pyx_L1_error)
}
- __pyx_v_self->_osymbols = __pyx_t_5;
+ __pyx_v_self->_osymbols = __pyx_t_4;
- /* "pywrapfst.pyx":4311
+ /* "pywrapfst.pyx":4344
* self._isymbols = isymbols._raw_ptr_or_raise()
* self._osymbols = NULL
* if osymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4313
+ /* "pywrapfst.pyx":4346
* 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, 4313, __pyx_L1_error)
+ __PYX_ERR(0, 4346, __pyx_L1_error)
}
__pyx_v_self->_ssymbols = NULL;
- /* "pywrapfst.pyx":4314
+ /* "pywrapfst.pyx":4347
* self._osymbols = osymbols._raw_ptr_or_raise()
* self._ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
* self._ssymbols = ssymbols._raw_ptr_or_raise()
* self._acceptor = acceptor
*/
- __pyx_t_3 = (((PyObject *)__pyx_v_ssymbols) != Py_None);
- __pyx_t_4 = (__pyx_t_3 != 0);
- if (__pyx_t_4) {
+ __pyx_t_2 = (((PyObject *)__pyx_v_ssymbols) != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
- /* "pywrapfst.pyx":4315
+ /* "pywrapfst.pyx":4348
* 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, 4315, __pyx_L1_error)
+ __PYX_ERR(0, 4348, __pyx_L1_error)
}
- __pyx_t_5 = ((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__SymbolTable *)__pyx_v_ssymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4315, __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)
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
- __PYX_ERR(0, 4315, __pyx_L1_error)
+ __PYX_ERR(0, 4348, __pyx_L1_error)
}
- __pyx_v_self->_ssymbols = __pyx_t_5;
+ __pyx_v_self->_ssymbols = __pyx_t_4;
- /* "pywrapfst.pyx":4314
+ /* "pywrapfst.pyx":4347
* self._osymbols = osymbols._raw_ptr_or_raise()
* self._ssymbols = NULL
* if ssymbols is not None: # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4316
+ /* "pywrapfst.pyx":4349
* 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, 4316, __pyx_L1_error)
+ __PYX_ERR(0, 4349, __pyx_L1_error)
}
__pyx_v_self->_acceptor = __pyx_v_acceptor;
- /* "pywrapfst.pyx":4317
+ /* "pywrapfst.pyx":4350
* 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, 4317, __pyx_L1_error)
+ __PYX_ERR(0, 4350, __pyx_L1_error)
}
__pyx_v_self->_keep_isymbols = __pyx_v_keep_isymbols;
- /* "pywrapfst.pyx":4318
+ /* "pywrapfst.pyx":4351
* 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, 4318, __pyx_L1_error)
+ __PYX_ERR(0, 4351, __pyx_L1_error)
}
__pyx_v_self->_keep_osymbols = __pyx_v_keep_osymbols;
- /* "pywrapfst.pyx":4319
+ /* "pywrapfst.pyx":4352
* 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, 4319, __pyx_L1_error)
+ __PYX_ERR(0, 4352, __pyx_L1_error)
}
__pyx_v_self->_keep_state_numbering = __pyx_v_keep_state_numbering;
- /* "pywrapfst.pyx":4320
+ /* "pywrapfst.pyx":4353
* 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, 4320, __pyx_L1_error)
+ __PYX_ERR(0, 4353, __pyx_L1_error)
}
__pyx_v_self->_allow_negative_labels = __pyx_v_allow_negative_labels;
- /* "pywrapfst.pyx":4293
+ /* "pywrapfst.pyx":4326
* """
*
* def __cinit__(self, # <<<<<<<<<<<<<<
- * string fst_type=b"vector",
- * string arc_type=b"standard",
+ * str fst_type="vector",
+ * str arc_type="standard",
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("pywrapfst.Compiler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":4322
+/* "pywrapfst.pyx":4355
* self._allow_negative_labels = allow_negative_labels
*
* cpdef Fst compile(self): # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_8Compiler_3compile(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst_8Compiler_compile(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, int __pyx_skip_dispatch) {
- std::unique_ptr<fst::script::FstClass> __pyx_v_tfst;
+ std::unique_ptr<fst::script::FstClass> __pyx_v__tfst;
struct __pyx_obj_9pywrapfst_Fst *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("compile", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4322, __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, 4355, __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, 4322, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 4322, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 4355, __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":4337
+ /* "pywrapfst.pyx":4370
* """
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.CompileFstInternal(deref(self._sstrm), # <<<<<<<<<<<<<<
- * b"<pywrapfst>",
- * self._fst_type,
+ * cdef unique_ptr[fst.FstClass] _tfst
+ * _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'", "_sstrm");
- __PYX_ERR(0, 4337, __pyx_L1_error)
+ __PYX_ERR(0, 4370, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4339
- * tfst.reset(fst.CompileFstInternal(deref(self._sstrm),
- * b"<pywrapfst>",
- * self._fst_type, # <<<<<<<<<<<<<<
- * self._arc_type,
- * self._isymbols,
+ /* "pywrapfst.pyx":4372
+ * _tfst.reset(fst.CompileFstInternal(deref(self._sstrm),
+ * b"<pywrapfst>",
+ * self._fst_type, # <<<<<<<<<<<<<<
+ * self._arc_type,
+ * self._isymbols,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst_type");
- __PYX_ERR(0, 4339, __pyx_L1_error)
+ __PYX_ERR(0, 4372, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4340
- * b"<pywrapfst>",
- * self._fst_type,
- * self._arc_type, # <<<<<<<<<<<<<<
- * self._isymbols,
- * self._osymbols,
+ /* "pywrapfst.pyx":4373
+ * b"<pywrapfst>",
+ * self._fst_type,
+ * 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'", "_arc_type");
- __PYX_ERR(0, 4340, __pyx_L1_error)
+ __PYX_ERR(0, 4373, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4341
- * self._fst_type,
- * self._arc_type,
- * self._isymbols, # <<<<<<<<<<<<<<
- * self._osymbols,
- * self._ssymbols,
+ /* "pywrapfst.pyx":4374
+ * self._fst_type,
+ * self._arc_type,
+ * self._isymbols, # <<<<<<<<<<<<<<
+ * self._osymbols,
+ * self._ssymbols,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
- __PYX_ERR(0, 4341, __pyx_L1_error)
+ __PYX_ERR(0, 4374, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4342
- * self._arc_type,
- * self._isymbols,
- * self._osymbols, # <<<<<<<<<<<<<<
- * self._ssymbols,
- * self._acceptor,
+ /* "pywrapfst.pyx":4375
+ * self._arc_type,
+ * self._isymbols,
+ * self._osymbols, # <<<<<<<<<<<<<<
+ * self._ssymbols,
+ * self._acceptor,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
- __PYX_ERR(0, 4342, __pyx_L1_error)
+ __PYX_ERR(0, 4375, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4343
- * self._isymbols,
- * self._osymbols,
- * self._ssymbols, # <<<<<<<<<<<<<<
- * self._acceptor,
- * self._keep_isymbols,
+ /* "pywrapfst.pyx":4376
+ * self._isymbols,
+ * self._osymbols,
+ * self._ssymbols, # <<<<<<<<<<<<<<
+ * self._acceptor,
+ * self._keep_isymbols,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
- __PYX_ERR(0, 4343, __pyx_L1_error)
+ __PYX_ERR(0, 4376, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4344
- * self._osymbols,
- * self._ssymbols,
- * self._acceptor, # <<<<<<<<<<<<<<
- * self._keep_isymbols,
- * self._keep_osymbols,
+ /* "pywrapfst.pyx":4377
+ * self._osymbols,
+ * self._ssymbols,
+ * 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'", "_acceptor");
- __PYX_ERR(0, 4344, __pyx_L1_error)
+ __PYX_ERR(0, 4377, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4345
- * self._ssymbols,
- * self._acceptor,
- * self._keep_isymbols, # <<<<<<<<<<<<<<
- * self._keep_osymbols,
- * self._keep_state_numbering,
+ /* "pywrapfst.pyx":4378
+ * self._ssymbols,
+ * self._acceptor,
+ * self._keep_isymbols, # <<<<<<<<<<<<<<
+ * self._keep_osymbols,
+ * self._keep_state_numbering,
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_isymbols");
- __PYX_ERR(0, 4345, __pyx_L1_error)
+ __PYX_ERR(0, 4378, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4346
- * self._acceptor,
- * self._keep_isymbols,
- * self._keep_osymbols, # <<<<<<<<<<<<<<
- * self._keep_state_numbering,
- * self._allow_negative_labels))
+ /* "pywrapfst.pyx":4379
+ * self._acceptor,
+ * self._keep_isymbols,
+ * self._keep_osymbols, # <<<<<<<<<<<<<<
+ * self._keep_state_numbering,
+ * self._allow_negative_labels))
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_osymbols");
- __PYX_ERR(0, 4346, __pyx_L1_error)
+ __PYX_ERR(0, 4379, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4347
- * self._keep_isymbols,
- * self._keep_osymbols,
- * self._keep_state_numbering, # <<<<<<<<<<<<<<
- * self._allow_negative_labels))
+ /* "pywrapfst.pyx":4380
+ * self._keep_isymbols,
+ * self._keep_osymbols,
+ * self._keep_state_numbering, # <<<<<<<<<<<<<<
+ * self._allow_negative_labels))
* self._sstrm.reset(new stringstream())
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_state_numbering");
- __PYX_ERR(0, 4347, __pyx_L1_error)
+ __PYX_ERR(0, 4380, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4348
- * self._keep_osymbols,
- * self._keep_state_numbering,
- * self._allow_negative_labels)) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4381
+ * self._keep_osymbols,
+ * self._keep_state_numbering,
+ * self._allow_negative_labels)) # <<<<<<<<<<<<<<
* self._sstrm.reset(new stringstream())
- * if tfst.get() == NULL:
+ * if _tfst.get() == NULL:
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_allow_negative_labels");
- __PYX_ERR(0, 4348, __pyx_L1_error)
+ __PYX_ERR(0, 4381, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4337
+ /* "pywrapfst.pyx":4370
* """
- * cdef unique_ptr[fst.FstClass] tfst
- * tfst.reset(fst.CompileFstInternal(deref(self._sstrm), # <<<<<<<<<<<<<<
- * b"<pywrapfst>",
- * self._fst_type,
+ * cdef unique_ptr[fst.FstClass] _tfst
+ * _tfst.reset(fst.CompileFstInternal(deref(self._sstrm), # <<<<<<<<<<<<<<
+ * b"<pywrapfst>",
+ * self._fst_type,
*/
- __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));
+ __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":4349
- * self._keep_state_numbering,
- * self._allow_negative_labels))
+ /* "pywrapfst.pyx":4382
+ * self._keep_state_numbering,
+ * self._allow_negative_labels))
* self._sstrm.reset(new stringstream()) # <<<<<<<<<<<<<<
- * if tfst.get() == NULL:
+ * if _tfst.get() == NULL:
* raise FstOpError("Compilation failed")
*/
if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
- __PYX_ERR(0, 4349, __pyx_L1_error)
+ __PYX_ERR(0, 4382, __pyx_L1_error)
}
__pyx_v_self->_sstrm.reset(new std::stringstream());
- /* "pywrapfst.pyx":4350
- * self._allow_negative_labels))
+ /* "pywrapfst.pyx":4383
+ * self._allow_negative_labels))
* self._sstrm.reset(new stringstream())
- * if tfst.get() == NULL: # <<<<<<<<<<<<<<
+ * if _tfst.get() == NULL: # <<<<<<<<<<<<<<
* raise FstOpError("Compilation failed")
- * return _init_XFst(tfst.release())
+ * return _init_XFst(_tfst.release())
*/
- __pyx_t_5 = ((__pyx_v_tfst.get() == NULL) != 0);
+ __pyx_t_5 = ((__pyx_v__tfst.get() == NULL) != 0);
if (unlikely(__pyx_t_5)) {
- /* "pywrapfst.pyx":4351
+ /* "pywrapfst.pyx":4384
* self._sstrm.reset(new stringstream())
- * if tfst.get() == NULL:
+ * if _tfst.get() == NULL:
* raise FstOpError("Compilation failed") # <<<<<<<<<<<<<<
- * return _init_XFst(tfst.release())
+ * return _init_XFst(_tfst.release())
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4351, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4384, __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, 4351, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4384, __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, 4351, __pyx_L1_error)
+ __PYX_ERR(0, 4384, __pyx_L1_error)
- /* "pywrapfst.pyx":4350
- * self._allow_negative_labels))
+ /* "pywrapfst.pyx":4383
+ * self._allow_negative_labels))
* self._sstrm.reset(new stringstream())
- * if tfst.get() == NULL: # <<<<<<<<<<<<<<
+ * if _tfst.get() == NULL: # <<<<<<<<<<<<<<
* raise FstOpError("Compilation failed")
- * return _init_XFst(tfst.release())
+ * return _init_XFst(_tfst.release())
*/
}
- /* "pywrapfst.pyx":4352
- * if tfst.get() == NULL:
+ /* "pywrapfst.pyx":4385
+ * if _tfst.get() == NULL:
* raise FstOpError("Compilation failed")
- * return _init_XFst(tfst.release()) # <<<<<<<<<<<<<<
+ * 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, 4352, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4322
+ /* "pywrapfst.pyx":4355
* self._allow_negative_labels = allow_negative_labels
*
* cpdef Fst compile(self): # <<<<<<<<<<<<<<
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("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, 4322, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4354
- * return _init_XFst(tfst.release())
+/* "pywrapfst.pyx":4387
+ * return _init_XFst(_tfst.release())
*
* cpdef void write(self, expression): # <<<<<<<<<<<<<<
* """
static PyObject *__pyx_pw_9pywrapfst_8Compiler_5write(PyObject *__pyx_v_self, PyObject *__pyx_v_expression); /*proto*/
static void __pyx_f_9pywrapfst_8Compiler_write(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_expression, int __pyx_skip_dispatch) {
- std::string __pyx_v_line;
+ std::string __pyx_v__line;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
std::string __pyx_t_5;
int __pyx_t_6;
int __pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4354, __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, 4387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9pywrapfst_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, 4354, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif
}
- /* "pywrapfst.pyx":4370
+ /* "pywrapfst.pyx":4403
* 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')
+ * 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, 4370, __pyx_L1_error)
- __pyx_v_line = __pyx_t_5;
+ __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4403, __pyx_L1_error)
+ __pyx_v__line = __pyx_t_5;
- /* "pywrapfst.pyx":4371
+ /* "pywrapfst.pyx":4404
* """
- * cdef string line = tostring(expression)
- * if not line.empty() and line.back() != b'\n': # <<<<<<<<<<<<<<
- * line.append(b'\n')
- * deref(self._sstrm) << line
+ * cdef string _line = tostring(expression)
+ * if not _line.empty() and _line.back() != b'\n': # <<<<<<<<<<<<<<
+ * _line.append(b'\n')
+ * deref(self._sstrm) << _line
*/
- __pyx_t_7 = ((!(__pyx_v_line.empty() != 0)) != 0);
+ __pyx_t_7 = ((!(__pyx_v__line.empty() != 0)) != 0);
if (__pyx_t_7) {
} else {
__pyx_t_6 = __pyx_t_7;
goto __pyx_L4_bool_binop_done;
}
- __pyx_t_7 = ((__pyx_v_line.back() != '\n') != 0);
+ __pyx_t_7 = ((__pyx_v__line.back() != '\n') != 0);
__pyx_t_6 = __pyx_t_7;
__pyx_L4_bool_binop_done:;
if (__pyx_t_6) {
- /* "pywrapfst.pyx":4372
- * cdef string line = tostring(expression)
- * if not line.empty() and line.back() != b'\n':
- * line.append(b'\n') # <<<<<<<<<<<<<<
- * deref(self._sstrm) << line
+ /* "pywrapfst.pyx":4405
+ * cdef string _line = tostring(expression)
+ * if not _line.empty() and _line.back() != b'\n':
+ * _line.append(b'\n') # <<<<<<<<<<<<<<
+ * deref(self._sstrm) << _line
*
*/
- (void)(__pyx_v_line.append(((char const *)"\n")));
+ (void)(__pyx_v__line.append(((char const *)"\n")));
- /* "pywrapfst.pyx":4371
+ /* "pywrapfst.pyx":4404
* """
- * cdef string line = tostring(expression)
- * if not line.empty() and line.back() != b'\n': # <<<<<<<<<<<<<<
- * line.append(b'\n')
- * deref(self._sstrm) << line
+ * cdef string _line = tostring(expression)
+ * if not _line.empty() and _line.back() != b'\n': # <<<<<<<<<<<<<<
+ * _line.append(b'\n')
+ * deref(self._sstrm) << _line
*/
}
- /* "pywrapfst.pyx":4373
- * if not line.empty() and line.back() != b'\n':
- * line.append(b'\n')
- * deref(self._sstrm) << line # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4406
+ * 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, 4373, __pyx_L1_error)
+ __PYX_ERR(0, 4406, __pyx_L1_error)
}
- (void)(((*__pyx_v_self->_sstrm) << __pyx_v_line));
+ (void)(((*__pyx_v_self->_sstrm) << __pyx_v__line));
- /* "pywrapfst.pyx":4354
- * return _init_XFst(tfst.release())
+ /* "pywrapfst.pyx":4387
+ * return _init_XFst(_tfst.release())
*
* cpdef void write(self, expression): # <<<<<<<<<<<<<<
* """
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("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, 4354, __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, 4387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
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("__reduce_cython__", 0);
/* "(tree fragment)":2
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("__setstate_cython__", 0);
/* "(tree fragment)":4
return __pyx_r;
}
-/* "pywrapfst.pyx":4395
+/* "pywrapfst.pyx":4428
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
- * raise FstDeletedConstructorError(
- * "Cannot construct {}".format(self.__class__.__name__))
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
+ *
*/
/* Python wrapper */
__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_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":4396
- *
- * def __init__(self):
- * raise FstDeletedConstructorError( # <<<<<<<<<<<<<<
- * "Cannot construct {}".format(self.__class__.__name__))
+ /* "pywrapfst.pyx":4429
*
- */
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4396, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
-
- /* "pywrapfst.pyx":4397
* def __init__(self):
- * raise FstDeletedConstructorError(
- * "Cannot construct {}".format(self.__class__.__name__)) # <<<<<<<<<<<<<<
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}") # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4397, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4397, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4397, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(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_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, 4397, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- }
- }
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4396, __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, 4429, __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_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_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_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_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, 4396, __pyx_L1_error)
+ __PYX_ERR(0, 4429, __pyx_L1_error)
- /* "pywrapfst.pyx":4395
+ /* "pywrapfst.pyx":4428
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
- * raise FstDeletedConstructorError(
- * "Cannot construct {}".format(self.__class__.__name__))
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("pywrapfst.FarReader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":4399
- * "Cannot construct {}".format(self.__class__.__name__))
+/* "pywrapfst.pyx":4431
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self))
+ * return f"<{self.far_type()} FarReader at 0x{id(self):x}>"
*
*/
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- int __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":4400
+ /* "pywrapfst.pyx":4432
*
* def __repr__(self):
- * return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self)) # <<<<<<<<<<<<<<
+ * return f"<{self.far_type()} FarReader at 0x{id(self):x}>" # <<<<<<<<<<<<<<
*
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_FarReader_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4400, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4432, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u__2);
+ __pyx_t_2 += 1;
+ __Pyx_GIVEREF(__pyx_kp_u__2);
+ 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, 4400, __pyx_L1_error)
+ __PYX_ERR(0, 4432, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4400, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4400, __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_GOTREF(__pyx_t_4);
- __pyx_t_5 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && likely(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_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4400, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4400, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4400, __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, 0+__pyx_t_6, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4400, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
+ __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_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __Pyx_INCREF(__pyx_kp_u_FarReader_at_0x);
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__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_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":4399
- * "Cannot construct {}".format(self.__class__.__name__))
+ /* "pywrapfst.pyx":4431
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self))
+ * return f"<{self.far_type()} FarReader at 0x{id(self):x}>"
*
*/
/* 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_7);
__Pyx_AddTraceback("pywrapfst.FarReader.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":4403
+/* "pywrapfst.pyx":4435
*
* @classmethod
* def open(cls, *sources): # <<<<<<<<<<<<<<
}
static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_sources) {
- std::vector<std::string> __pyx_v_source_strings;
- PyObject *__pyx_v_source = NULL;
- std::unique_ptr<fst::script::FarReaderClass> __pyx_v_tfar;
- struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_result = 0;
+ std::vector<std::string> __pyx_v__sources;
+ std::unique_ptr<fst::script::FarReaderClass> __pyx_v__tfar;
+ struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_reader = 0;
+ PyObject *__pyx_8genexpr1__pyx_v_source = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- Py_ssize_t __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- std::string __pyx_t_4;
- int __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ Py_ssize_t __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ std::string __pyx_t_5;
+ std::vector<std::string> __pyx_t_6;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("open", 0);
- /* "pywrapfst.pyx":4422
+ /* "pywrapfst.pyx":4453
+ * FstIOError: Read failed.
* """
- * cdef vector[string] source_strings
- * for source in sources: # <<<<<<<<<<<<<<
- * source_strings.push_back(tostring(source))
- * cdef unique_ptr[fst.FarReaderClass] tfar
- */
- __pyx_t_1 = __pyx_v_sources; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
- 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, 4422, __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, 4422, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __Pyx_XDECREF_SET(__pyx_v_source, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "pywrapfst.pyx":4423
- * cdef vector[string] source_strings
- * for source in sources:
- * source_strings.push_back(tostring(source)) # <<<<<<<<<<<<<<
- * cdef unique_ptr[fst.FarReaderClass] tfar
- * tfar.reset(fst.FarReaderClass.Open(source_strings))
+ * cdef vector[string] _sources = [path_tostring(source) for source in sources] # <<<<<<<<<<<<<<
+ * cdef unique_ptr[fst.FarReaderClass] _tfar
+ * _tfar.reset(fst.FarReaderClass.Open(_sources))
*/
- __pyx_t_4 = __pyx_f_9pywrapfst_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4423, __pyx_L1_error)
- try {
- __pyx_v_source_strings.push_back(__pyx_t_4);
- } catch(...) {
- __Pyx_CppExn2PyErr();
- __PYX_ERR(0, 4423, __pyx_L1_error)
+ { /* enter inner scope */
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4453, __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)
+ #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_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_GOTREF(__pyx_t_4);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4453, __pyx_L5_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
-
- /* "pywrapfst.pyx":4422
- * """
- * cdef vector[string] source_strings
- * for source in sources: # <<<<<<<<<<<<<<
- * source_strings.push_back(tostring(source))
- * cdef unique_ptr[fst.FarReaderClass] tfar
- */
- }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_source); __pyx_8genexpr1__pyx_v_source = 0;
+ goto __pyx_L8_exit_scope;
+ __pyx_L5_error:;
+ __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_source); __pyx_8genexpr1__pyx_v_source = 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v__sources = __pyx_t_6;
- /* "pywrapfst.pyx":4425
- * source_strings.push_back(tostring(source))
- * cdef unique_ptr[fst.FarReaderClass] tfar
- * tfar.reset(fst.FarReaderClass.Open(source_strings)) # <<<<<<<<<<<<<<
- * if tfar.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(sources))
+ /* "pywrapfst.pyx":4455
+ * cdef vector[string] _sources = [path_tostring(source) for source in sources]
+ * cdef unique_ptr[fst.FarReaderClass] _tfar
+ * _tfar.reset(fst.FarReaderClass.Open(_sources)) # <<<<<<<<<<<<<<
+ * if _tfar.get() == NULL:
+ * raise FstIOError(f"Read failed: {sources!r}")
*/
- __pyx_v_tfar.reset(fst::script::FarReaderClass::Open(__pyx_v_source_strings));
+ __pyx_v__tfar.reset(fst::script::FarReaderClass::Open(__pyx_v__sources));
- /* "pywrapfst.pyx":4426
- * cdef unique_ptr[fst.FarReaderClass] tfar
- * tfar.reset(fst.FarReaderClass.Open(source_strings))
- * if tfar.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed: {!r}".format(sources))
- * cdef FarReader result = FarReader.__new__(FarReader)
+ /* "pywrapfst.pyx":4456
+ * cdef unique_ptr[fst.FarReaderClass] _tfar
+ * _tfar.reset(fst.FarReaderClass.Open(_sources))
+ * if _tfar.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Read failed: {sources!r}")
+ * cdef FarReader reader = FarReader.__new__(FarReader)
*/
- __pyx_t_5 = ((__pyx_v_tfar.get() == NULL) != 0);
- if (unlikely(__pyx_t_5)) {
+ __pyx_t_7 = ((__pyx_v__tfar.get() == NULL) != 0);
+ if (unlikely(__pyx_t_7)) {
- /* "pywrapfst.pyx":4427
- * tfar.reset(fst.FarReaderClass.Open(source_strings))
- * if tfar.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(sources)) # <<<<<<<<<<<<<<
- * cdef FarReader result = FarReader.__new__(FarReader)
- * result._reader.reset(tfar.release())
+ /* "pywrapfst.pyx":4457
+ * _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_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4427, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4427, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
- }
- }
- __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_sources) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_sources);
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4427, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4457, __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_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_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
}
}
- __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4427, __pyx_L1_error)
+ __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)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 4427, __pyx_L1_error)
+ __PYX_ERR(0, 4457, __pyx_L1_error)
- /* "pywrapfst.pyx":4426
- * cdef unique_ptr[fst.FarReaderClass] tfar
- * tfar.reset(fst.FarReaderClass.Open(source_strings))
- * if tfar.get() == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Read failed: {!r}".format(sources))
- * cdef FarReader result = FarReader.__new__(FarReader)
+ /* "pywrapfst.pyx":4456
+ * cdef unique_ptr[fst.FarReaderClass] _tfar
+ * _tfar.reset(fst.FarReaderClass.Open(_sources))
+ * if _tfar.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Read failed: {sources!r}")
+ * cdef FarReader reader = FarReader.__new__(FarReader)
*/
}
- /* "pywrapfst.pyx":4428
- * if tfar.get() == NULL:
- * raise FstIOError("Read failed: {!r}".format(sources))
- * cdef FarReader result = FarReader.__new__(FarReader) # <<<<<<<<<<<<<<
- * result._reader.reset(tfar.release())
- * return result
+ /* "pywrapfst.pyx":4458
+ * 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, 4428, __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, 4458, __pyx_L1_error)
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_t_1);
+ __pyx_v_reader = ((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "pywrapfst.pyx":4429
- * raise FstIOError("Read failed: {!r}".format(sources))
- * cdef FarReader result = FarReader.__new__(FarReader)
- * result._reader.reset(tfar.release()) # <<<<<<<<<<<<<<
- * return result
+ /* "pywrapfst.pyx":4459
+ * raise FstIOError(f"Read failed: {sources!r}")
+ * cdef FarReader reader = FarReader.__new__(FarReader)
+ * reader._reader.reset(_tfar.release()) # <<<<<<<<<<<<<<
+ * return reader
*
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v_reader) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
- __PYX_ERR(0, 4429, __pyx_L1_error)
+ __PYX_ERR(0, 4459, __pyx_L1_error)
}
- __pyx_v_result->_reader.reset(__pyx_v_tfar.release());
+ __pyx_v_reader->_reader.reset(__pyx_v__tfar.release());
- /* "pywrapfst.pyx":4430
- * cdef FarReader result = FarReader.__new__(FarReader)
- * result._reader.reset(tfar.release())
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4460
+ * cdef FarReader reader = FarReader.__new__(FarReader)
+ * reader._reader.reset(_tfar.release())
+ * return reader # <<<<<<<<<<<<<<
*
* cpdef string arc_type(self):
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = ((PyObject *)__pyx_v_result);
+ __Pyx_INCREF(((PyObject *)__pyx_v_reader));
+ __pyx_r = ((PyObject *)__pyx_v_reader);
goto __pyx_L0;
- /* "pywrapfst.pyx":4403
+ /* "pywrapfst.pyx":4435
*
* @classmethod
* def open(cls, *sources): # <<<<<<<<<<<<<<
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("pywrapfst.FarReader.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
- __Pyx_XDECREF(__pyx_v_source);
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v_reader);
+ __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_source);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":4432
- * return result
+/* "pywrapfst.pyx":4462
+ * return reader
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
* """
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arc_type", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4432, __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, 4462, __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, 4432, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4462, __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, 4432, __pyx_L1_error)
+ __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_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":4438
+ /* "pywrapfst.pyx":4468
* 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, 4438, __pyx_L1_error)
+ __PYX_ERR(0, 4468, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":4432
- * return result
+ /* "pywrapfst.pyx":4462
+ * return reader
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
* """
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("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, 4432, __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, 4462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4440
+/* "pywrapfst.pyx":4470
* return self._reader.get().ArcType()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
bool __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("done", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4440, __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, 4470, __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, 4440, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4470, __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, 4440, __pyx_L1_error)
+ __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_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":4449
+ /* "pywrapfst.pyx":4479
* 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, 4449, __pyx_L1_error)
+ __PYX_ERR(0, 4479, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->Done();
goto __pyx_L0;
- /* "pywrapfst.pyx":4440
+ /* "pywrapfst.pyx":4470
* return self._reader.get().ArcType()
*
* cpdef bool done(self): # <<<<<<<<<<<<<<
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("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, 4440, __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, 4470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4451
+/* "pywrapfst.pyx":4481
* return self._reader.get().Done()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
bool __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("error", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4451, __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, 4481, __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, 4451, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4481, __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, 4451, __pyx_L1_error)
+ __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_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":4460
+ /* "pywrapfst.pyx":4490
* 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, 4460, __pyx_L1_error)
+ __PYX_ERR(0, 4490, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->Error();
goto __pyx_L0;
- /* "pywrapfst.pyx":4451
+ /* "pywrapfst.pyx":4481
* return self._reader.get().Done()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
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("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, 4451, __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, 4481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4462
+/* "pywrapfst.pyx":4492
* return self._reader.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("far_type", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4462, __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, 4492, __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, 4462, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4492, __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, 4492, __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":4463
+ /* "pywrapfst.pyx":4493
*
* 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, 4463, __pyx_L1_error)
+ __PYX_ERR(0, 4493, __pyx_L1_error)
}
__pyx_r = fst::GetFarTypeString(__pyx_v_self->_reader.get()->Type());
goto __pyx_L0;
- /* "pywrapfst.pyx":4462
+ /* "pywrapfst.pyx":4492
* return self._reader.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
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("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, 4462, __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, 4492, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4465
+/* "pywrapfst.pyx":4495
* return fst.GetFarTypeString(self._reader.get().Type())
*
* cpdef bool find(self, key): # <<<<<<<<<<<<<<
PyObject *__pyx_t_4 = NULL;
bool __pyx_t_5;
std::string __pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("find", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4465, __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, 4495, __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, 4465, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4495, __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, 4465, __pyx_L1_error)
+ __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_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":4478
+ /* "pywrapfst.pyx":4508
* 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, 4478, __pyx_L1_error)
+ __PYX_ERR(0, 4508, __pyx_L1_error)
}
- __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4478, __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_r = __pyx_v_self->_reader.get()->Find(__pyx_t_6);
goto __pyx_L0;
- /* "pywrapfst.pyx":4465
+ /* "pywrapfst.pyx":4495
* return fst.GetFarTypeString(self._reader.get().Type())
*
* cpdef bool find(self, key): # <<<<<<<<<<<<<<
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("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, 4465, __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, 4495, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4480
+/* "pywrapfst.pyx":4510
* return self._reader.get().Find(tostring(key))
*
* cpdef Fst get_fst(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_fst", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4480, __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, 4510, __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, 4480, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4510, __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, 4480, __pyx_L1_error)
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 4510, __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":4489
+ /* "pywrapfst.pyx":4519
* 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, 4489, __pyx_L1_error)
+ __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, 4489, __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_GOTREF(__pyx_t_1);
__pyx_r = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4480
+ /* "pywrapfst.pyx":4510
* return self._reader.get().Find(tostring(key))
*
* cpdef Fst get_fst(self): # <<<<<<<<<<<<<<
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("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, 4480, __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, 4510, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4491
+/* "pywrapfst.pyx":4521
* return _init_XFst(new fst.FstClass(deref(self._reader.get().GetFstClass())))
*
* cpdef string get_key(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_key", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4491, __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, 4521, __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, 4491, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4521, __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, 4491, __pyx_L1_error)
+ __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_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":4500
+ /* "pywrapfst.pyx":4530
* 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, 4500, __pyx_L1_error)
+ __PYX_ERR(0, 4530, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_reader.get()->GetKey();
goto __pyx_L0;
- /* "pywrapfst.pyx":4491
+ /* "pywrapfst.pyx":4521
* return _init_XFst(new fst.FstClass(deref(self._reader.get().GetFstClass())))
*
* cpdef string get_key(self): # <<<<<<<<<<<<<<
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("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, 4491, __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, 4521, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4502
+/* "pywrapfst.pyx":4532
* return self._reader.get().GetKey()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("next", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4502, __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, 4532, __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, 4502, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4532, __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":4508
+ /* "pywrapfst.pyx":4538
* 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, 4508, __pyx_L1_error)
+ __PYX_ERR(0, 4538, __pyx_L1_error)
}
__pyx_v_self->_reader.get()->Next();
- /* "pywrapfst.pyx":4502
+ /* "pywrapfst.pyx":4532
* return self._reader.get().GetKey()
*
* cpdef void next(self): # <<<<<<<<<<<<<<
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("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, 4502, __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, 4532, __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":4540
* self._reader.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reset", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4510, __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, 4540, __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, 4510, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4540, __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":4516
+ /* "pywrapfst.pyx":4546
* 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, 4516, __pyx_L1_error)
+ __PYX_ERR(0, 4546, __pyx_L1_error)
}
__pyx_v_self->_reader.get()->Reset();
- /* "pywrapfst.pyx":4510
+ /* "pywrapfst.pyx":4540
* self._reader.get().Next()
*
* cpdef void reset(self): # <<<<<<<<<<<<<<
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("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, 4510, __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, 4540, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4518
+/* "pywrapfst.pyx":4548
* self._reader.get().Reset()
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
std::string __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "pywrapfst.pyx":4519
+ /* "pywrapfst.pyx":4549
*
* 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, 4519, __pyx_L1_error)
+ __PYX_ERR(0, 4549, __pyx_L1_error)
}
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4519, __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_2 = (__pyx_v_self->_reader.get()->Find(__pyx_t_1) != 0);
if (likely(__pyx_t_2)) {
- /* "pywrapfst.pyx":4520
+ /* "pywrapfst.pyx":4550
* 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, 4520, __pyx_L1_error)
+ __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, 4520, __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_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "pywrapfst.pyx":4519
+ /* "pywrapfst.pyx":4549
*
* def __getitem__(self, key):
* if self._reader.get().Find(tostring(key)): # <<<<<<<<<<<<<<
*/
}
- /* "pywrapfst.pyx":4522
+ /* "pywrapfst.pyx":4552
* 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, 4522, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 4522, __pyx_L1_error)
+ __PYX_ERR(0, 4552, __pyx_L1_error)
}
- /* "pywrapfst.pyx":4518
+ /* "pywrapfst.pyx":4548
* self._reader.get().Reset()
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
return __pyx_r;
}
+/* "pywrapfst.pyx":4554
+ * raise KeyError(key)
+ *
+ * def __next__(self): # <<<<<<<<<<<<<<
+ * if self.done():
+ * raise StopIteration
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_9pywrapfst_9FarReader_27__next__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_9FarReader_27__next__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_9pywrapfst_9FarReader_26__next__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_9pywrapfst_9FarReader_26__next__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
+ std::string __pyx_v__key;
+ struct __pyx_obj_9pywrapfst_Fst *__pyx_v__fst = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__next__", 0);
+
+ /* "pywrapfst.pyx":4555
+ *
+ * def __next__(self):
+ * 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'", "done");
+ __PYX_ERR(0, 4555, __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
+ * def __next__(self):
+ * if self.done():
+ * raise StopIteration # <<<<<<<<<<<<<<
+ * cdef string _key = self.get_key()
+ * cdef Fst _fst = self.get_fst()
+ */
+ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
+ __PYX_ERR(0, 4556, __pyx_L1_error)
+
+ /* "pywrapfst.pyx":4555
+ *
+ * def __next__(self):
+ * if self.done(): # <<<<<<<<<<<<<<
+ * raise StopIteration
+ * cdef string _key = self.get_key()
+ */
+ }
+
+ /* "pywrapfst.pyx":4557
+ * if self.done():
+ * raise StopIteration
+ * 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'", "get_key");
+ __PYX_ERR(0, 4557, __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
+ * raise StopIteration
+ * cdef string _key = self.get_key()
+ * cdef Fst _fst = self.get_fst() # <<<<<<<<<<<<<<
+ * self.next()
+ * return (_key, _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_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_GOTREF(__pyx_t_2);
+ __pyx_v__fst = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "pywrapfst.pyx":4559
+ * cdef string _key = self.get_key()
+ * cdef Fst _fst = self.get_fst()
+ * self.next() # <<<<<<<<<<<<<<
+ * return (_key, _fst)
+ *
+ */
+ 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)
+ }
+ ((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
+
+ /* "pywrapfst.pyx":4560
+ * 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_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4560, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+ __Pyx_INCREF(((PyObject *)__pyx_v__fst));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v__fst));
+ PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v__fst));
+ __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "pywrapfst.pyx":4554
+ * raise KeyError(key)
+ *
+ * def __next__(self): # <<<<<<<<<<<<<<
+ * if self.done():
+ * raise StopIteration
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("pywrapfst.FarReader.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v__fst);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "pywrapfst.pyx":4563
+ *
+ * # This just registers this class as a possible iterator.
+ * def __iter__(self): # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_9pywrapfst_9FarReader_29__iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_9FarReader_29__iter__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_9pywrapfst_9FarReader_28__iter__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_9pywrapfst_9FarReader_28__iter__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__iter__", 0);
+
+ /* "pywrapfst.pyx":4564
+ * # This just registers this class as a possible iterator.
+ * def __iter__(self):
+ * return self # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __pyx_r = ((PyObject *)__pyx_v_self);
+ goto __pyx_L0;
+
+ /* "pywrapfst.pyx":4563
+ *
+ * # This just registers this class as a possible iterator.
+ * def __iter__(self): # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* raise TypeError("self._reader cannot be converted to a Python object for pickling")
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_9FarReader_27__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_9pywrapfst_9FarReader_27__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_9pywrapfst_9FarReader_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_9FarReader_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_9FarReader_26__reduce_cython__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));
+ __pyx_r = __pyx_pf_9pywrapfst_9FarReader_30__reduce_cython__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_9FarReader_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
+static PyObject *__pyx_pf_9pywrapfst_9FarReader_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
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("__reduce_cython__", 0);
/* "(tree fragment)":2
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9pywrapfst_9FarReader_29__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
-static PyObject *__pyx_pw_9pywrapfst_9FarReader_29__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+static PyObject *__pyx_pw_9pywrapfst_9FarReader_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw_9pywrapfst_9FarReader_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
- __pyx_r = __pyx_pf_9pywrapfst_9FarReader_28__setstate_cython__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+ __pyx_r = __pyx_pf_9pywrapfst_9FarReader_32__setstate_cython__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9pywrapfst_9FarReader_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
+static PyObject *__pyx_pf_9pywrapfst_9FarReader_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
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("__setstate_cython__", 0);
/* "(tree fragment)":4
return __pyx_r;
}
-/* "pywrapfst.pyx":4545
+/* "pywrapfst.pyx":4587
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
- * raise FstDeletedConstructorError(
- * "Cannot construct {}".format(self.__class__.__name__))
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
+ *
*/
/* Python wrapper */
__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_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "pywrapfst.pyx":4546
- *
- * def __init__(self):
- * raise FstDeletedConstructorError( # <<<<<<<<<<<<<<
- * "Cannot construct {}".format(self.__class__.__name__))
+ /* "pywrapfst.pyx":4588
*
- */
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4546, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
-
- /* "pywrapfst.pyx":4547
* def __init__(self):
- * raise FstDeletedConstructorError(
- * "Cannot construct {}".format(self.__class__.__name__)) # <<<<<<<<<<<<<<
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}") # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(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_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, 4547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- }
- }
- __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4546, __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, 4588, __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_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_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_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_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, 4546, __pyx_L1_error)
+ __PYX_ERR(0, 4588, __pyx_L1_error)
- /* "pywrapfst.pyx":4545
+ /* "pywrapfst.pyx":4587
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
- * raise FstDeletedConstructorError(
- * "Cannot construct {}".format(self.__class__.__name__))
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("pywrapfst.FarWriter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":4549
- * "Cannot construct {}".format(self.__class__.__name__))
+/* "pywrapfst.pyx":4590
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(self))
+ * return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
*
*/
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- int __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "pywrapfst.pyx":4550
+ /* "pywrapfst.pyx":4591
*
* def __repr__(self):
- * return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(self)) # <<<<<<<<<<<<<<
+ * return f"<{self.far_type()} FarWriter at 0x{id(self):x}>" # <<<<<<<<<<<<<<
*
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_FarWriter_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4550, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4591, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 127;
+ __Pyx_INCREF(__pyx_kp_u__2);
+ __pyx_t_2 += 1;
+ __Pyx_GIVEREF(__pyx_kp_u__2);
+ 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, 4550, __pyx_L1_error)
+ __PYX_ERR(0, 4591, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4550, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4550, __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_GOTREF(__pyx_t_4);
- __pyx_t_5 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && likely(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_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4550, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4550, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4550, __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, 0+__pyx_t_6, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4550, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
+ __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_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __Pyx_INCREF(__pyx_kp_u_FarWriter_at_0x);
+ __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_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_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 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_INCREF(__pyx_kp_u__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_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":4549
- * "Cannot construct {}".format(self.__class__.__name__))
+ /* "pywrapfst.pyx":4590
+ * raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
*
* def __repr__(self): # <<<<<<<<<<<<<<
- * return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(self))
+ * return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
*
*/
/* 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_7);
__Pyx_AddTraceback("pywrapfst.FarWriter.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}
-/* "pywrapfst.pyx":4553
+/* "pywrapfst.pyx":4594
*
* @classmethod
- * def create(cls, source, arc_type=b"standard", far_type=b"default"): # <<<<<<<<<<<<<<
+ * def create(cls, source, arc_type="standard", far_type="default"): # <<<<<<<<<<<<<<
* """
* FarWriter.
*/
PyObject *__pyx_v_source = 0;
PyObject *__pyx_v_arc_type = 0;
PyObject *__pyx_v_far_type = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("create (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_arc_type,&__pyx_n_s_far_type,0};
PyObject* values[3] = {0,0,0};
- values[1] = ((PyObject *)__pyx_n_b_standard);
- values[2] = ((PyObject *)__pyx_n_b_default);
+ values[1] = ((PyObject *)__pyx_n_u_standard);
+ values[2] = ((PyObject *)__pyx_n_u_default);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 4553, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 4594, __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, 4553, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4594, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("pywrapfst.FarWriter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
}
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, PyObject *__pyx_v_arc_type, PyObject *__pyx_v_far_type) {
- enum fst::FarType __pyx_v_ft;
- fst::script::FarWriterClass *__pyx_v_tfar;
- struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_result = 0;
+ std::unique_ptr<fst::script::FarWriterClass> __pyx_v__tfar;
+ struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_writer = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
std::string __pyx_t_1;
std::string __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
+ std::string __pyx_t_3;
+ fst::FarType __pyx_t_4;
+ int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create", 0);
- /* "pywrapfst.pyx":4574
- * FstIOError: Read failed.
- * """
- * cdef fst.FarType ft = fst.GetFarType(tostring(far_type)) # <<<<<<<<<<<<<<
- * cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
- * tostring(source),
- */
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_far_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4574, __pyx_L1_error)
- __pyx_v_ft = fst::script::GetFarType(__pyx_t_1);
-
- /* "pywrapfst.pyx":4576
- * cdef fst.FarType ft = fst.GetFarType(tostring(far_type))
- * cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
- * tostring(source), # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4617
+ * cdef unique_ptr[fst.FarWriterClass] _tfar
+ * _tfar.reset(fst.FarWriterClass.Create(
+ * path_tostring(source), # <<<<<<<<<<<<<<
* tostring(arc_type),
- * ft)
+ * _get_far_type(tostring(far_type))))
*/
- __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4576, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4617, __pyx_L1_error)
- /* "pywrapfst.pyx":4577
- * cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
- * tostring(source),
+ /* "pywrapfst.pyx":4618
+ * _tfar.reset(fst.FarWriterClass.Create(
+ * path_tostring(source),
* tostring(arc_type), # <<<<<<<<<<<<<<
- * ft)
- * if tfar == NULL:
+ * _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, 4577, __pyx_L1_error)
+ __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4618, __pyx_L1_error)
- /* "pywrapfst.pyx":4575
+ /* "pywrapfst.pyx":4619
+ * 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)
+
+ /* "pywrapfst.pyx":4616
* """
- * cdef fst.FarType ft = fst.GetFarType(tostring(far_type))
- * cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create( # <<<<<<<<<<<<<<
- * tostring(source),
+ * cdef unique_ptr[fst.FarWriterClass] _tfar
+ * _tfar.reset(fst.FarWriterClass.Create( # <<<<<<<<<<<<<<
+ * path_tostring(source),
* tostring(arc_type),
*/
- __pyx_v_tfar = fst::script::FarWriterClass::Create(__pyx_t_1, __pyx_t_2, __pyx_v_ft);
+ __pyx_v__tfar.reset(fst::script::FarWriterClass::Create(__pyx_t_1, __pyx_t_2, __pyx_t_4));
- /* "pywrapfst.pyx":4579
+ /* "pywrapfst.pyx":4620
* tostring(arc_type),
- * ft)
- * if tfar == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Open failed: {!r}".format(source))
- * cdef FarWriter result = FarWriter.__new__(FarWriter)
+ * _get_far_type(tostring(far_type))))
+ * if _tfar.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Open failed: {source!r}")
+ * cdef FarWriter writer = FarWriter.__new__(FarWriter)
*/
- __pyx_t_3 = ((__pyx_v_tfar == NULL) != 0);
- if (unlikely(__pyx_t_3)) {
+ __pyx_t_5 = ((__pyx_v__tfar.get() == NULL) != 0);
+ if (unlikely(__pyx_t_5)) {
- /* "pywrapfst.pyx":4580
- * ft)
- * if tfar == NULL:
- * raise FstIOError("Open failed: {!r}".format(source)) # <<<<<<<<<<<<<<
- * cdef FarWriter result = FarWriter.__new__(FarWriter)
- * result._writer.reset(tfar)
+ /* "pywrapfst.pyx":4621
+ * _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_5, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4580, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Open_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4580, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4621, __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_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_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
- __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_source);
+ __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;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4580, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- }
- }
- __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_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4580, __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, 4580, __pyx_L1_error)
+ __PYX_ERR(0, 4621, __pyx_L1_error)
- /* "pywrapfst.pyx":4579
+ /* "pywrapfst.pyx":4620
* tostring(arc_type),
- * ft)
- * if tfar == NULL: # <<<<<<<<<<<<<<
- * raise FstIOError("Open failed: {!r}".format(source))
- * cdef FarWriter result = FarWriter.__new__(FarWriter)
+ * _get_far_type(tostring(far_type))))
+ * if _tfar.get() == NULL: # <<<<<<<<<<<<<<
+ * raise FstIOError(f"Open failed: {source!r}")
+ * cdef FarWriter writer = FarWriter.__new__(FarWriter)
*/
}
- /* "pywrapfst.pyx":4581
- * if tfar == NULL:
- * raise FstIOError("Open failed: {!r}".format(source))
- * cdef FarWriter result = FarWriter.__new__(FarWriter) # <<<<<<<<<<<<<<
- * result._writer.reset(tfar)
- * return result
+ /* "pywrapfst.pyx":4622
+ * 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_4 = ((PyObject *)__pyx_tp_new_9pywrapfst_FarWriter(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarWriter), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4581, __pyx_L1_error)
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_v_result = ((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_t_4);
- __pyx_t_4 = 0;
+ __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_GOTREF(((PyObject *)__pyx_t_6));
+ __pyx_v_writer = ((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_t_6);
+ __pyx_t_6 = 0;
- /* "pywrapfst.pyx":4582
- * raise FstIOError("Open failed: {!r}".format(source))
- * cdef FarWriter result = FarWriter.__new__(FarWriter)
- * result._writer.reset(tfar) # <<<<<<<<<<<<<<
- * return result
+ /* "pywrapfst.pyx":4623
+ * raise FstIOError(f"Open failed: {source!r}")
+ * cdef FarWriter writer = FarWriter.__new__(FarWriter)
+ * writer._writer = move(_tfar) # <<<<<<<<<<<<<<
+ * return writer
*
*/
- if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
+ if (unlikely(((PyObject *)__pyx_v_writer) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
- __PYX_ERR(0, 4582, __pyx_L1_error)
+ __PYX_ERR(0, 4623, __pyx_L1_error)
}
- __pyx_v_result->_writer.reset(__pyx_v_tfar);
+ __pyx_v_writer->_writer = fst::move<std::unique_ptr<fst::script::FarWriterClass> >(__pyx_v__tfar);
- /* "pywrapfst.pyx":4583
- * cdef FarWriter result = FarWriter.__new__(FarWriter)
- * result._writer.reset(tfar)
- * return result # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":4624
+ * cdef FarWriter writer = FarWriter.__new__(FarWriter)
+ * writer._writer = move(_tfar)
+ * return writer # <<<<<<<<<<<<<<
*
* # NB: Invoking this method may be dangerous: calling any other method on the
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = ((PyObject *)__pyx_v_result);
+ __Pyx_INCREF(((PyObject *)__pyx_v_writer));
+ __pyx_r = ((PyObject *)__pyx_v_writer);
goto __pyx_L0;
- /* "pywrapfst.pyx":4553
+ /* "pywrapfst.pyx":4594
*
* @classmethod
- * def create(cls, source, arc_type=b"standard", far_type=b"default"): # <<<<<<<<<<<<<<
+ * def create(cls, source, arc_type="standard", far_type="default"): # <<<<<<<<<<<<<<
* """
* FarWriter.
*/
/* function exit code */
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("pywrapfst.FarWriter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF((PyObject *)__pyx_v_writer);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "pywrapfst.pyx":4587
+/* "pywrapfst.pyx":4628
* # 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): # <<<<<<<<<<<<<<
static void __pyx_f_9pywrapfst_9FarWriter_close(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self) {
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("close", 0);
- /* "pywrapfst.pyx":4588
+ /* "pywrapfst.pyx":4629
* # 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, 4588, __pyx_L1_error)
+ __PYX_ERR(0, 4629, __pyx_L1_error)
}
__pyx_v_self->_writer.reset();
- /* "pywrapfst.pyx":4587
+ /* "pywrapfst.pyx":4628
* # 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":4590
+/* "pywrapfst.pyx":4631
* self._writer.reset()
*
* cpdef void add(self, key, Fst ifst) except *: # <<<<<<<<<<<<<<
PyObject *__pyx_t_6 = NULL;
std::string __pyx_t_7;
int __pyx_t_8;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4590, __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, 4631, __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, 4590, __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, 4631, __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, 4590, __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, 4631, __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, 4590, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4631, __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, 4590, __pyx_L1_error)
+ __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_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
#endif
}
- /* "pywrapfst.pyx":4608
+ /* "pywrapfst.pyx":4649
* # 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, 4608, __pyx_L1_error)
+ __PYX_ERR(0, 4649, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4608, __pyx_L1_error)
+ __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4649, __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, 4608, __pyx_L1_error)
+ __PYX_ERR(0, 4649, __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":4609
+ /* "pywrapfst.pyx":4650
* # 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, 4609, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4650, __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, 4609, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4650, __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, 4609, __pyx_L1_error)
+ __PYX_ERR(0, 4650, __pyx_L1_error)
- /* "pywrapfst.pyx":4608
+ /* "pywrapfst.pyx":4649
* # 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":4590
+ /* "pywrapfst.pyx":4631
* self._writer.reset()
*
* cpdef void add(self, key, Fst ifst) except *: # <<<<<<<<<<<<<<
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_7add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_key = 0;
struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add (wrapper)", 0);
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, 4590, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 4631, __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, 4590, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 4631, __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, 4590, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4631, __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, 4590, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4631, __pyx_L1_error)
__pyx_r = __pyx_pf_9pywrapfst_9FarWriter_6add(((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_v_self), __pyx_v_key, __pyx_v_ifst);
/* function exit code */
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ 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, 4590, __pyx_L1_error)
- __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4590, __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, 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_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4611
+/* "pywrapfst.pyx":4652
* raise FstOpError("Incompatible or invalid arc type")
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arc_type", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4611, __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, 4652, __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, 4611, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4652, __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, 4611, __pyx_L1_error)
+ __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_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":4617
+ /* "pywrapfst.pyx":4658
* 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, 4617, __pyx_L1_error)
+ __PYX_ERR(0, 4658, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_writer.get()->ArcType();
goto __pyx_L0;
- /* "pywrapfst.pyx":4611
+ /* "pywrapfst.pyx":4652
* raise FstOpError("Incompatible or invalid arc type")
*
* cpdef string arc_type(self): # <<<<<<<<<<<<<<
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("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, 4611, __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, 4652, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4619
+/* "pywrapfst.pyx":4660
* return self._writer.get().ArcType()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
bool __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("error", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4619, __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, 4660, __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, 4619, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4660, __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, 4619, __pyx_L1_error)
+ __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_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":4628
+ /* "pywrapfst.pyx":4669
* 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, 4628, __pyx_L1_error)
+ __PYX_ERR(0, 4669, __pyx_L1_error)
}
__pyx_r = __pyx_v_self->_writer.get()->Error();
goto __pyx_L0;
- /* "pywrapfst.pyx":4619
+ /* "pywrapfst.pyx":4660
* return self._writer.get().ArcType()
*
* cpdef bool error(self): # <<<<<<<<<<<<<<
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("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, 4619, __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, 4660, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4630
+/* "pywrapfst.pyx":4671
* return self._writer.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("far_type", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
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, 4630, __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, 4671, __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, 4630, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4671, __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, 4630, __pyx_L1_error)
+ __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_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":4636
+ /* "pywrapfst.pyx":4677
* 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, 4636, __pyx_L1_error)
+ __PYX_ERR(0, 4677, __pyx_L1_error)
}
__pyx_r = fst::GetFarTypeString(__pyx_v_self->_writer.get()->Type());
goto __pyx_L0;
- /* "pywrapfst.pyx":4630
+ /* "pywrapfst.pyx":4671
* return self._writer.get().Error()
*
* cpdef string far_type(self): # <<<<<<<<<<<<<<
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("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, 4630, __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, 4671, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
return __pyx_r;
}
-/* "pywrapfst.pyx":4639
+/* "pywrapfst.pyx":4680
*
* # Dictionary-like assignment.
* def __setitem__(self, key, Fst fst): # <<<<<<<<<<<<<<
/* Python wrapper */
static int __pyx_pw_9pywrapfst_9FarWriter_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_fst); /*proto*/
static int __pyx_pw_9pywrapfst_9FarWriter_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_fst) {
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
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, 4639, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst), __pyx_ptype_9pywrapfst_Fst, 1, "fst", 0))) __PYX_ERR(0, 4680, __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 */
static int __pyx_pf_9pywrapfst_9FarWriter_14__setitem__(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_fst) {
int __pyx_r;
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "pywrapfst.pyx":4640
+ /* "pywrapfst.pyx":4681
* # 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, 4640, __pyx_L1_error)
+ __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, 4640, __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)
- /* "pywrapfst.pyx":4639
+ /* "pywrapfst.pyx":4680
*
* # Dictionary-like assignment.
* def __setitem__(self, key, Fst fst): # <<<<<<<<<<<<<<
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("__reduce_cython__", 0);
/* "(tree fragment)":2
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("__setstate_cython__", 0);
/* "(tree fragment)":4
std::string __pyx_r;
__Pyx_RefNannyDeclarations
char const *__pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);
/* "string.from_py":14
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("__pyx_convert_PyObject_string_to_py_std__in_string", 0);
/* "string.to_py":32
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("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);
/* "string.to_py":38
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("__pyx_convert_PyStr_string_to_py_std__in_string", 0);
/* "string.to_py":44
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("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);
/* "string.to_py":50
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("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);
/* "string.to_py":56
PyObject *(*__pyx_t_3)(PyObject *);
PyObject *__pyx_t_4 = NULL;
int64 __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_int64", 0);
/* "vector.from_py":47
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+
+static std::vector<std::string> __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *__pyx_v_o) {
+ std::vector<std::string> __pyx_v_v;
+ PyObject *__pyx_v_item = NULL;
+ std::vector<std::string> __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ PyObject *(*__pyx_t_3)(PyObject *);
+ PyObject *__pyx_t_4 = NULL;
+ std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_string", 0);
+
+ /* "vector.from_py":47
+ * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
+ * cdef vector[X] v
+ * for item in o: # <<<<<<<<<<<<<<
+ * v.push_back(<X>item)
+ * return v
+ */
+ if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
+ __pyx_t_1 = __pyx_v_o; __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_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __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(1, 47, __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(1, 47, __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(1, 47, __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(1, 47, __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(1, 47, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ #endif
+ }
+ } else {
+ __pyx_t_4 = __pyx_t_3(__pyx_t_1);
+ if (unlikely(!__pyx_t_4)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else __PYX_ERR(1, 47, __pyx_L1_error)
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_4);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "vector.from_py":48
+ * cdef vector[X] v
+ * for item in o:
+ * v.push_back(<X>item) # <<<<<<<<<<<<<<
+ * return v
+ *
+ */
+ __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
+ __pyx_v_v.push_back(((std::string)__pyx_t_5));
+
+ /* "vector.from_py":47
+ * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
+ * cdef vector[X] v
+ * for item in o: # <<<<<<<<<<<<<<
+ * v.push_back(<X>item)
+ * return v
+ */
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "vector.from_py":49
+ * for item in o:
+ * v.push_back(<X>item)
+ * return v # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_v;
+ goto __pyx_L0;
+
+ /* "vector.from_py":45
+ *
+ * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
+ * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *: # <<<<<<<<<<<<<<
+ * cdef vector[X] v
+ * for item in o:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_pretend_to_initialize(&__pyx_r);
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_item);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
static struct __pyx_vtabstruct_9pywrapfst_Weight __pyx_vtable_9pywrapfst_Weight;
static PyObject *__pyx_tp_new_9pywrapfst_Weight(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
0, /*tp_print*/
#endif
};
-static struct __pyx_vtabstruct_9pywrapfst__SymbolTable __pyx_vtable_9pywrapfst__SymbolTable;
+static struct __pyx_vtabstruct_9pywrapfst_SymbolTableView __pyx_vtable_9pywrapfst_SymbolTableView;
-static PyObject *__pyx_tp_new_9pywrapfst__SymbolTable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_9pywrapfst__SymbolTable *p;
+static PyObject *__pyx_tp_new_9pywrapfst_SymbolTableView(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_9pywrapfst_SymbolTableView *p;
PyObject *o;
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
o = (*t->tp_alloc)(t, 0);
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
}
if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_9pywrapfst__SymbolTable *)o);
- p->__pyx_vtab = __pyx_vtabptr_9pywrapfst__SymbolTable;
+ p = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)o);
+ p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_SymbolTableView;
return o;
}
-static void __pyx_tp_dealloc_9pywrapfst__SymbolTable(PyObject *o) {
+static void __pyx_tp_dealloc_9pywrapfst_SymbolTableView(PyObject *o) {
#if CYTHON_USE_TP_FINALIZE
if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
(*Py_TYPE(o)->tp_free)(o);
}
-static PyMethodDef __pyx_methods_9pywrapfst__SymbolTable[] = {
- {"__reduce__", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_5__reduce__, METH_NOARGS, 0},
- {"available_key", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_7available_key, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_6available_key},
- {"checksum", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_9checksum, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_8checksum},
- {"copy", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_11copy, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_10copy},
- {"find", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_13find, METH_O, __pyx_doc_9pywrapfst_12_SymbolTable_12find},
- {"get_nth_key", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_15get_nth_key, METH_O, __pyx_doc_9pywrapfst_12_SymbolTable_14get_nth_key},
- {"labeled_checksum", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_17labeled_checksum, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_16labeled_checksum},
- {"member", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_19member, METH_O, __pyx_doc_9pywrapfst_12_SymbolTable_18member},
- {"name", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_23name, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_22name},
- {"num_symbols", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_25num_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_24num_symbols},
- {"write", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_27write, METH_O, __pyx_doc_9pywrapfst_12_SymbolTable_26write},
- {"write_text", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_29write_text, METH_O, __pyx_doc_9pywrapfst_12_SymbolTable_28write_text},
- {"write_to_string", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_31write_to_string, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_30write_to_string},
+static PyMethodDef __pyx_methods_9pywrapfst_SymbolTableView[] = {
+ {"__reduce__", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_5__reduce__, METH_NOARGS, 0},
+ {"available_key", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_7available_key, METH_NOARGS, __pyx_doc_9pywrapfst_15SymbolTableView_6available_key},
+ {"checksum", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_9checksum, METH_NOARGS, __pyx_doc_9pywrapfst_15SymbolTableView_8checksum},
+ {"copy", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_11copy, METH_NOARGS, __pyx_doc_9pywrapfst_15SymbolTableView_10copy},
+ {"find", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_13find, METH_O, __pyx_doc_9pywrapfst_15SymbolTableView_12find},
+ {"get_nth_key", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_15get_nth_key, METH_O, __pyx_doc_9pywrapfst_15SymbolTableView_14get_nth_key},
+ {"labeled_checksum", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_17labeled_checksum, METH_NOARGS, __pyx_doc_9pywrapfst_15SymbolTableView_16labeled_checksum},
+ {"member", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_19member, METH_O, __pyx_doc_9pywrapfst_15SymbolTableView_18member},
+ {"name", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_21name, METH_NOARGS, __pyx_doc_9pywrapfst_15SymbolTableView_20name},
+ {"num_symbols", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_23num_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_15SymbolTableView_22num_symbols},
+ {"write", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_25write, METH_O, __pyx_doc_9pywrapfst_15SymbolTableView_24write},
+ {"write_text", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_27write_text, METH_O, __pyx_doc_9pywrapfst_15SymbolTableView_26write_text},
+ {"write_to_string", (PyCFunction)__pyx_pw_9pywrapfst_15SymbolTableView_29write_to_string, METH_NOARGS, __pyx_doc_9pywrapfst_15SymbolTableView_28write_to_string},
{0, 0, 0, 0}
};
-static PySequenceMethods __pyx_tp_as_sequence__SymbolTable = {
- 0, /*sq_length*/
- 0, /*sq_concat*/
- 0, /*sq_repeat*/
- 0, /*sq_item*/
- 0, /*sq_slice*/
- 0, /*sq_ass_item*/
- 0, /*sq_ass_slice*/
- __pyx_pw_9pywrapfst_12_SymbolTable_21__contains__, /*sq_contains*/
- 0, /*sq_inplace_concat*/
- 0, /*sq_inplace_repeat*/
-};
-
-static PyTypeObject __pyx_type_9pywrapfst__SymbolTable = {
+static PyTypeObject __pyx_type_9pywrapfst_SymbolTableView = {
PyVarObject_HEAD_INIT(0, 0)
- "pywrapfst._SymbolTable", /*tp_name*/
- sizeof(struct __pyx_obj_9pywrapfst__SymbolTable), /*tp_basicsize*/
+ "pywrapfst.SymbolTableView", /*tp_name*/
+ sizeof(struct __pyx_obj_9pywrapfst_SymbolTableView), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_9pywrapfst__SymbolTable, /*tp_dealloc*/
+ __pyx_tp_dealloc_9pywrapfst_SymbolTableView, /*tp_dealloc*/
#if PY_VERSION_HEX < 0x030800b4
0, /*tp_print*/
#endif
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
- &__pyx_tp_as_sequence__SymbolTable, /*tp_as_sequence*/
+ 0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
- __pyx_pw_9pywrapfst_12_SymbolTable_3__iter__, /*tp_iter*/
+ __pyx_pw_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_9pywrapfst__SymbolTable, /*tp_methods*/
+ __pyx_methods_9pywrapfst_SymbolTableView, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
- __pyx_pw_9pywrapfst_12_SymbolTable_1__init__, /*tp_init*/
+ __pyx_pw_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_9pywrapfst__SymbolTable, /*tp_new*/
+ __pyx_tp_new_9pywrapfst_SymbolTableView, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
static PyObject *__pyx_tp_new_9pywrapfst__EncodeMapperSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *p;
- PyObject *o = __pyx_tp_new_9pywrapfst__SymbolTable(t, a, k);
+ PyObject *o = __pyx_tp_new_9pywrapfst_SymbolTableView(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)o);
- p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst__SymbolTable*)__pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTableView;
+ p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst_SymbolTableView*)__pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTableView;
new((void*)&(p->_mapper)) std::shared_ptr<fst::script::EncodeMapperClass> ();
return o;
}
}
#endif
__Pyx_call_destructor(p->_mapper);
- __pyx_tp_dealloc_9pywrapfst__SymbolTable(o);
+ __pyx_tp_dealloc_9pywrapfst_SymbolTableView(o);
}
static PyMethodDef __pyx_methods_9pywrapfst__EncodeMapperSymbolTableView[] = {
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
#if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_9pywrapfst_12_SymbolTable_3__iter__, /*tp_iter*/
+ __pyx_pw_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
#else
0, /*tp_iter*/
#endif
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_9pywrapfst_12_SymbolTable_1__init__, /*tp_init*/
+ __pyx_pw_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
static PyObject *__pyx_tp_new_9pywrapfst__FstSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_9pywrapfst__FstSymbolTableView *p;
- PyObject *o = __pyx_tp_new_9pywrapfst__SymbolTable(t, a, k);
+ PyObject *o = __pyx_tp_new_9pywrapfst_SymbolTableView(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)o);
- p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst__SymbolTable*)__pyx_vtabptr_9pywrapfst__FstSymbolTableView;
+ p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst_SymbolTableView*)__pyx_vtabptr_9pywrapfst__FstSymbolTableView;
new((void*)&(p->_fst)) std::shared_ptr<fst::script::FstClass> ();
return o;
}
}
#endif
__Pyx_call_destructor(p->_fst);
- __pyx_tp_dealloc_9pywrapfst__SymbolTable(o);
+ __pyx_tp_dealloc_9pywrapfst_SymbolTableView(o);
}
static PyMethodDef __pyx_methods_9pywrapfst__FstSymbolTableView[] = {
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
#if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_9pywrapfst_12_SymbolTable_3__iter__, /*tp_iter*/
+ __pyx_pw_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
#else
0, /*tp_iter*/
#endif
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_9pywrapfst_12_SymbolTable_1__init__, /*tp_init*/
+ __pyx_pw_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
static PyObject *__pyx_tp_new_9pywrapfst__MutableSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_9pywrapfst__MutableSymbolTable *p;
- PyObject *o = __pyx_tp_new_9pywrapfst__SymbolTable(t, a, k);
+ PyObject *o = __pyx_tp_new_9pywrapfst_SymbolTableView(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)o);
- p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst__SymbolTable*)__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
+ p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst_SymbolTableView*)__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
return o;
}
"pywrapfst._MutableSymbolTable", /*tp_name*/
sizeof(struct __pyx_obj_9pywrapfst__MutableSymbolTable), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_9pywrapfst__SymbolTable, /*tp_dealloc*/
+ __pyx_tp_dealloc_9pywrapfst_SymbolTableView, /*tp_dealloc*/
#if PY_VERSION_HEX < 0x030800b4
0, /*tp_print*/
#endif
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
#if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_9pywrapfst_12_SymbolTable_3__iter__, /*tp_iter*/
+ __pyx_pw_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
#else
0, /*tp_iter*/
#endif
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_9pywrapfst_12_SymbolTable_1__init__, /*tp_init*/
+ __pyx_pw_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
PyObject *o = __pyx_tp_new_9pywrapfst__MutableSymbolTable(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *)o);
- p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst__SymbolTable*)__pyx_vtabptr_9pywrapfst__MutableFstSymbolTableView;
+ p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst_SymbolTableView*)__pyx_vtabptr_9pywrapfst__MutableFstSymbolTableView;
new((void*)&(p->_mfst)) std::shared_ptr<fst::script::MutableFstClass> ();
return o;
}
}
#endif
__Pyx_call_destructor(p->_mfst);
- __pyx_tp_dealloc_9pywrapfst__SymbolTable(o);
+ __pyx_tp_dealloc_9pywrapfst_SymbolTableView(o);
}
static PyMethodDef __pyx_methods_9pywrapfst__MutableFstSymbolTableView[] = {
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
#if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_9pywrapfst_12_SymbolTable_3__iter__, /*tp_iter*/
+ __pyx_pw_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
#else
0, /*tp_iter*/
#endif
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_9pywrapfst_12_SymbolTable_1__init__, /*tp_init*/
+ __pyx_pw_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
PyObject *o = __pyx_tp_new_9pywrapfst__MutableSymbolTable(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_9pywrapfst_SymbolTable *)o);
- p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst__SymbolTable*)__pyx_vtabptr_9pywrapfst_SymbolTable;
+ p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst_SymbolTableView*)__pyx_vtabptr_9pywrapfst_SymbolTable;
new((void*)&(p->_smart_table)) std::unique_ptr<fst::SymbolTable> ();
return o;
}
}
#endif
__Pyx_call_destructor(p->_smart_table);
- __pyx_tp_dealloc_9pywrapfst__SymbolTable(o);
+ __pyx_tp_dealloc_9pywrapfst_SymbolTableView(o);
}
static PyMethodDef __pyx_methods_9pywrapfst_SymbolTable[] = {
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
#if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_9pywrapfst_12_SymbolTable_3__iter__, /*tp_iter*/
+ __pyx_pw_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
#else
0, /*tp_iter*/
#endif
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_9pywrapfst__SymbolTableIterator *)o);
new((void*)&(p->_siter)) std::unique_ptr<fst::SymbolTable::iterator> ();
- p->_table = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None); Py_INCREF(Py_None);
+ p->_table = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None); Py_INCREF(Py_None);
return o;
}
PyObject* tmp;
struct __pyx_obj_9pywrapfst__SymbolTableIterator *p = (struct __pyx_obj_9pywrapfst__SymbolTableIterator *)o;
tmp = ((PyObject*)p->_table);
- p->_table = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None); Py_INCREF(Py_None);
+ p->_table = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- "\n _SymbolTableIterator(syms)\n\n This class is used for iterating over a symbol table.\n ", /*tp_doc*/
+ "\n _SymbolTableIterator(symbols)\n\n This class is used for iterating over a symbol table.\n ", /*tp_doc*/
__pyx_tp_traverse_9pywrapfst__SymbolTableIterator, /*tp_traverse*/
__pyx_tp_clear_9pywrapfst__SymbolTableIterator, /*tp_clear*/
0, /*tp_richcompare*/
{"read_from_string", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_39read_from_string, METH_O, __pyx_doc_9pywrapfst_3Fst_38read_from_string},
{"start", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_41start, METH_NOARGS, __pyx_doc_9pywrapfst_3Fst_40start},
{"states", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_43states, METH_NOARGS, __pyx_doc_9pywrapfst_3Fst_42states},
- {"text", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_3Fst_45text, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_44text},
- {"verify", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_47verify, METH_NOARGS, __pyx_doc_9pywrapfst_3Fst_46verify},
- {"weight_type", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_49weight_type, METH_NOARGS, __pyx_doc_9pywrapfst_3Fst_48weight_type},
- {"write", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_51write, METH_O, __pyx_doc_9pywrapfst_3Fst_50write},
- {"write_to_string", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_53write_to_string, METH_NOARGS, __pyx_doc_9pywrapfst_3Fst_52write_to_string},
+ {"verify", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_45verify, METH_NOARGS, __pyx_doc_9pywrapfst_3Fst_44verify},
+ {"weight_type", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_47weight_type, METH_NOARGS, __pyx_doc_9pywrapfst_3Fst_46weight_type},
+ {"write", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_49write, METH_O, __pyx_doc_9pywrapfst_3Fst_48write},
+ {"write_to_string", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_51write_to_string, METH_NOARGS, __pyx_doc_9pywrapfst_3Fst_50write_to_string},
{0, 0, 0, 0}
};
{"mutable_input_symbols", (PyCFunction)__pyx_pw_9pywrapfst_10MutableFst_29mutable_input_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_10MutableFst_28mutable_input_symbols},
{"mutable_output_symbols", (PyCFunction)__pyx_pw_9pywrapfst_10MutableFst_31mutable_output_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_10MutableFst_30mutable_output_symbols},
{"num_states", (PyCFunction)__pyx_pw_9pywrapfst_10MutableFst_33num_states, METH_NOARGS, __pyx_doc_9pywrapfst_10MutableFst_32num_states},
- {"project", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_35project, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_34project},
+ {"project", (PyCFunction)__pyx_pw_9pywrapfst_10MutableFst_35project, METH_O, __pyx_doc_9pywrapfst_10MutableFst_34project},
{"prune", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_37prune, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_36prune},
{"push", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_39push, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_38push},
{"relabel_pairs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_41relabel_pairs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_40relabel_pairs},
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- "\n Compiler(fst_type=\"vector\", arc_type=\"standard\", isymbols=None,\n osymbols=None, ssymbols=None, acceptor=False, keep_isymbols=False,\n keep_osymbols=False, keep_state_numbering=False,\n allow_negative_labels=False)\n\n Class used to compile FSTs from strings.\n\n This class is used to compile FSTs specified using the AT&T FSM library\n format described here:\n\n http://web.eecs.umich.edu/~radev/NLP-fall2015/resources/fsm_archive/fsm.5.html\n\n This is the same format used by the `fstcompile` executable.\n\n Compiler options (symbol tables, etc.) are set at construction time.\n\n compiler = fst.Compiler(isymbols=ascii_syms, osymbols=ascii_syms)\n\n Once constructed, Compiler instances behave like a file handle opened for\n writing:\n\n # /ba+/\n compiler.write(\"0 1 50 50\")\n compiler.write(\"1 2 49 49\")\n compiler.write(\"2 2 49 49\")\n compiler.write(\"2\")\n\n The `compile` method returns an actual FST instance:\n\n sheep_machine = compiler.compile()\n\n Compilation flushes the internal buffer, so the compiler instance can be\n reused to compile new machines with the same symbol tables (etc.)\n\n Args:\n fst_type: A string indicating the container type for the compiled FST.\n arc_type: A string indicating the arc type for the compiled FST.\n isymbols: An optional SymbolTable used to label input symbols.\n osymbols: An optional SymbolTable used to label output symbols.\n ssymbols: An optional SymbolTable used to label states.\n acceptor: Should the FST be rendered in acceptor format if possible?\n keep_isymbols: Should the input symbol table be stored in the FST?\n keep_osymbols: Should the output symbol table be stored in the FST?\n keep_state_numbering: Should the state numbering be preserved?\n allow_negative_labels: Should negative labels be allowed? (Not\n recommended; may cause conflicts).\n ", /*tp_doc*/
+ "\n Compiler(fst_type=\"vector\", arc_type=\"standard\", isymbols=None,\n osymbols=None, ssymbols=None, acceptor=False, keep_isymbols=False,\n keep_osymbols=False, keep_state_numbering=False,\n allow_negative_labels=False)\n\n Class used to compile FSTs from strings.\n\n This class is used to compile FSTs specified using the AT&T FSM library\n format described here:\n\n http://web.eecs.umich.edu/~radev/NLP-fall2015/resources/fsm_archive/fsm.5.html\n\n This is the same format used by the `fstcompile` executable.\n\n Compiler options (symbol tables, etc.) are set at construction time.\n\n compiler = fst.Compiler(isymbols=ascii_symbols, osymbols=ascii_symbols)\n\n Once constructed, Compiler instances behave like a file handle opened for\n writing:\n\n # /ba+/\n compiler.write(\"0 1 50 50\")\n compiler.write(\"1 2 49 49\")\n compiler.write(\"2 2 49 49\")\n compiler.write(\"2\")\n\n The `compile` method returns an actual FST instance:\n\n sheep_machine = compiler.compile()\n\n Compilation flushes the internal buffer, so the compiler instance can be\n reused to compile new machines with the same symbol tables (etc.)\n\n Args:\n fst_type: A string indicating the container type for the compiled FST.\n arc_type: A string indicating the arc type for the compiled FST.\n isymbols: An optional SymbolTable used to label input symbols.\n osymbols: An optional SymbolTable used to label output symbols.\n ssymbols: An optional SymbolTable used to label states.\n acceptor: Should the FST be rendered in acceptor format if possible?\n keep_isymbols: Should the input symbol table be stored in the FST?\n keep_osymbols: Should the output symbol table be stored in the FST?\n keep_state_numbering: Should the state numbering be preserved?\n allow_negative_labels: Should negative labels be allowed? (Not\n recommended; may cause conflicts).\n ", /*tp_doc*/
0, /*tp_traverse*/
0, /*tp_clear*/
0, /*tp_richcompare*/
return r;
}
+static PyObject *__pyx_specialmethod___pyx_pw_9pywrapfst_9FarReader_27__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_9pywrapfst_9FarReader_27__next__(self);}
+
static PyMethodDef __pyx_methods_9pywrapfst_FarReader[] = {
{"open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_9FarReader_5open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarReader_4open},
{"arc_type", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_7arc_type, METH_NOARGS, __pyx_doc_9pywrapfst_9FarReader_6arc_type},
{"get_key", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_19get_key, METH_NOARGS, __pyx_doc_9pywrapfst_9FarReader_18get_key},
{"next", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_21next, METH_NOARGS, __pyx_doc_9pywrapfst_9FarReader_20next},
{"reset", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_23reset, METH_NOARGS, __pyx_doc_9pywrapfst_9FarReader_22reset},
- {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_27__reduce_cython__, METH_NOARGS, 0},
- {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_29__setstate_cython__, METH_O, 0},
+ {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_9pywrapfst_9FarReader_27__next__, METH_NOARGS|METH_COEXIST, 0},
+ {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_31__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_33__setstate_cython__, METH_O, 0},
{0, 0, 0, 0}
};
0, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
+ __pyx_pw_9pywrapfst_9FarReader_29__iter__, /*tp_iter*/
+ __pyx_pw_9pywrapfst_9FarReader_27__next__, /*tp_iternext*/
__pyx_methods_9pywrapfst_FarReader, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
{&__pyx_n_s_ACCEPTOR, __pyx_k_ACCEPTOR, sizeof(__pyx_k_ACCEPTOR), 0, 0, 1, 1},
{&__pyx_n_s_ACCESSIBLE, __pyx_k_ACCESSIBLE, sizeof(__pyx_k_ACCESSIBLE), 0, 0, 1, 1},
{&__pyx_n_s_ACYCLIC, __pyx_k_ACYCLIC, sizeof(__pyx_k_ACYCLIC), 0, 0, 1, 1},
{&__pyx_n_s_ARC_WEIGHT_VALUE, __pyx_k_ARC_WEIGHT_VALUE, sizeof(__pyx_k_ARC_WEIGHT_VALUE), 0, 0, 1, 1},
{&__pyx_n_s_Arc, __pyx_k_Arc, sizeof(__pyx_k_Arc), 0, 0, 1, 1},
{&__pyx_n_s_ArcIterator, __pyx_k_ArcIterator, sizeof(__pyx_k_ArcIterator), 0, 0, 1, 1},
- {&__pyx_kp_u_ArcIterator_at_0x_x, __pyx_k_ArcIterator_at_0x_x, sizeof(__pyx_k_ArcIterator_at_0x_x), 0, 1, 0, 0},
- {&__pyx_kp_u_Arc_at_0x_x, __pyx_k_Arc_at_0x_x, sizeof(__pyx_k_Arc_at_0x_x), 0, 1, 0, 0},
+ {&__pyx_kp_u_ArcIterator_at_0x, __pyx_k_ArcIterator_at_0x, sizeof(__pyx_k_ArcIterator_at_0x), 0, 1, 0, 0},
+ {&__pyx_n_s_ArcMapType, __pyx_k_ArcMapType, sizeof(__pyx_k_ArcMapType), 0, 0, 1, 1},
+ {&__pyx_kp_u_Arc_at_0x, __pyx_k_Arc_at_0x, sizeof(__pyx_k_Arc_at_0x), 0, 1, 0, 0},
{&__pyx_n_s_BINARY_PROPERTIES, __pyx_k_BINARY_PROPERTIES, sizeof(__pyx_k_BINARY_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_COACCESSIBLE, __pyx_k_COACCESSIBLE, sizeof(__pyx_k_COACCESSIBLE), 0, 0, 1, 1},
{&__pyx_n_s_COPY_PROPERTIES, __pyx_k_COPY_PROPERTIES, sizeof(__pyx_k_COPY_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_CYCLIC, __pyx_k_CYCLIC, sizeof(__pyx_k_CYCLIC), 0, 0, 1, 1},
{&__pyx_kp_u_Cannot_construct, __pyx_k_Cannot_construct, sizeof(__pyx_k_Cannot_construct), 0, 1, 0, 0},
- {&__pyx_kp_u_Cannot_encode_as_string_r, __pyx_k_Cannot_encode_as_string_r, sizeof(__pyx_k_Cannot_encode_as_string_r), 0, 1, 0, 0},
{&__pyx_kp_u_Cannot_topsort_cyclic_FST, __pyx_k_Cannot_topsort_cyclic_FST, sizeof(__pyx_k_Cannot_topsort_cyclic_FST), 0, 1, 0, 0},
{&__pyx_kp_u_Compilation_failed, __pyx_k_Compilation_failed, sizeof(__pyx_k_Compilation_failed), 0, 1, 0, 0},
{&__pyx_n_s_Compiler, __pyx_k_Compiler, sizeof(__pyx_k_Compiler), 0, 0, 1, 1},
- {&__pyx_kp_u_Conversion_to_r_failed, __pyx_k_Conversion_to_r_failed, sizeof(__pyx_k_Conversion_to_r_failed), 0, 1, 0, 0},
+ {&__pyx_n_s_ComposeFilter, __pyx_k_ComposeFilter, sizeof(__pyx_k_ComposeFilter), 0, 0, 1, 1},
+ {&__pyx_kp_u_Conversion_to, __pyx_k_Conversion_to, sizeof(__pyx_k_Conversion_to), 0, 1, 0, 0},
{&__pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_k_DELETE_ARC_PROPERTIES, sizeof(__pyx_k_DELETE_ARC_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_k_DELETE_STATE_PROPERTIES, sizeof(__pyx_k_DELETE_STATE_PROPERTIES), 0, 0, 1, 1},
- {&__pyx_n_s_DeprecationWarning, __pyx_k_DeprecationWarning, sizeof(__pyx_k_DeprecationWarning), 0, 0, 1, 1},
+ {&__pyx_n_s_DeterminizeType, __pyx_k_DeterminizeType, sizeof(__pyx_k_DeterminizeType), 0, 0, 1, 1},
{&__pyx_kp_u_Dot_rendering_failed_s, __pyx_k_Dot_rendering_failed_s, sizeof(__pyx_k_Dot_rendering_failed_s), 0, 1, 0, 0},
+ {&__pyx_n_s_DrawFloatFormat, __pyx_k_DrawFloatFormat, sizeof(__pyx_k_DrawFloatFormat), 0, 0, 1, 1},
{&__pyx_n_s_ENCODE_FLAGS, __pyx_k_ENCODE_FLAGS, sizeof(__pyx_k_ENCODE_FLAGS), 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_EXTRINSIC_PROPERTIES, __pyx_k_EXTRINSIC_PROPERTIES, sizeof(__pyx_k_EXTRINSIC_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_EncodeMapper, __pyx_k_EncodeMapper, sizeof(__pyx_k_EncodeMapper), 0, 0, 1, 1},
{&__pyx_n_s_EncodeMapperSymbolTableView, __pyx_k_EncodeMapperSymbolTableView, sizeof(__pyx_k_EncodeMapperSymbolTableView), 0, 0, 1, 1},
- {&__pyx_kp_u_EncodeMapper_at_0x_x, __pyx_k_EncodeMapper_at_0x_x, sizeof(__pyx_k_EncodeMapper_at_0x_x), 0, 1, 0, 0},
+ {&__pyx_kp_u_EncodeMapper_at_0x, __pyx_k_EncodeMapper_at_0x, sizeof(__pyx_k_EncodeMapper_at_0x), 0, 1, 0, 0},
+ {&__pyx_kp_u_Expected, __pyx_k_Expected, sizeof(__pyx_k_Expected), 0, 1, 0, 0},
{&__pyx_n_s_FST_PROPERTIES, __pyx_k_FST_PROPERTIES, sizeof(__pyx_k_FST_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_FarReader, __pyx_k_FarReader, sizeof(__pyx_k_FarReader), 0, 0, 1, 1},
- {&__pyx_kp_u_FarReader_at_0x_x, __pyx_k_FarReader_at_0x_x, sizeof(__pyx_k_FarReader_at_0x_x), 0, 1, 0, 0},
+ {&__pyx_kp_u_FarReader_at_0x, __pyx_k_FarReader_at_0x, sizeof(__pyx_k_FarReader_at_0x), 0, 1, 0, 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_x, __pyx_k_FarWriter_at_0x_x, sizeof(__pyx_k_FarWriter_at_0x_x), 0, 1, 0, 0},
+ {&__pyx_kp_u_FarWriter_at_0x, __pyx_k_FarWriter_at_0x, sizeof(__pyx_k_FarWriter_at_0x), 0, 1, 0, 0},
{&__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_FstDeletedConstructorError, __pyx_k_FstDeletedConstructorError, sizeof(__pyx_k_FstDeletedConstructorError), 0, 0, 1, 1},
{&__pyx_n_s_FstError, __pyx_k_FstError, sizeof(__pyx_k_FstError), 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_FstSymbolTableView, __pyx_k_FstSymbolTableView, sizeof(__pyx_k_FstSymbolTableView), 0, 0, 1, 1},
- {&__pyx_kp_u_Fst_SymbolTableView_r_at_0x_x, __pyx_k_Fst_SymbolTableView_r_at_0x_x, sizeof(__pyx_k_Fst_SymbolTableView_r_at_0x_x), 0, 1, 0, 0},
- {&__pyx_kp_u_Fst_at_0x_x, __pyx_k_Fst_at_0x_x, sizeof(__pyx_k_Fst_at_0x_x), 0, 1, 0, 0},
+ {&__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_INITIAL_ACYCLIC, __pyx_k_INITIAL_ACYCLIC, sizeof(__pyx_k_INITIAL_ACYCLIC), 0, 0, 1, 1},
{&__pyx_n_s_INITIAL_CYCLIC, __pyx_k_INITIAL_CYCLIC, sizeof(__pyx_k_INITIAL_CYCLIC), 0, 0, 1, 1},
{&__pyx_n_s_INTRINSIC_PROPERTIES, __pyx_k_INTRINSIC_PROPERTIES, sizeof(__pyx_k_INTRINSIC_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_MUTABLE, __pyx_k_MUTABLE, sizeof(__pyx_k_MUTABLE), 0, 0, 1, 1},
{&__pyx_n_s_MutableArcIterator, __pyx_k_MutableArcIterator, sizeof(__pyx_k_MutableArcIterator), 0, 0, 1, 1},
{&__pyx_n_s_MutableArcIterator___iter, __pyx_k_MutableArcIterator___iter, sizeof(__pyx_k_MutableArcIterator___iter), 0, 0, 1, 1},
- {&__pyx_kp_u_MutableArcIterator_at_0x_x, __pyx_k_MutableArcIterator_at_0x_x, sizeof(__pyx_k_MutableArcIterator_at_0x_x), 0, 1, 0, 0},
+ {&__pyx_kp_u_MutableArcIterator_at_0x, __pyx_k_MutableArcIterator_at_0x, sizeof(__pyx_k_MutableArcIterator_at_0x), 0, 1, 0, 0},
{&__pyx_n_s_MutableFst, __pyx_k_MutableFst, sizeof(__pyx_k_MutableFst), 0, 0, 1, 1},
{&__pyx_n_s_MutableFstSymbolTableView, __pyx_k_MutableFstSymbolTableView, sizeof(__pyx_k_MutableFstSymbolTableView), 0, 0, 1, 1},
{&__pyx_n_s_MutableSymbolTable, __pyx_k_MutableSymbolTable, sizeof(__pyx_k_MutableSymbolTable), 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_Number, __pyx_k_Number, sizeof(__pyx_k_Number), 0, 0, 1, 1},
{&__pyx_n_s_O_DETERMINISTIC, __pyx_k_O_DETERMINISTIC, sizeof(__pyx_k_O_DETERMINISTIC), 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_r, __pyx_k_Open_failed_r, sizeof(__pyx_k_Open_failed_r), 0, 1, 0, 0},
+ {&__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_n_s_POS_TRINARY_PROPERTIES, __pyx_k_POS_TRINARY_PROPERTIES, sizeof(__pyx_k_POS_TRINARY_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_Popen, __pyx_k_Popen, sizeof(__pyx_k_Popen), 0, 0, 1, 1},
+ {&__pyx_n_s_ProjectType, __pyx_k_ProjectType, sizeof(__pyx_k_ProjectType), 0, 0, 1, 1},
+ {&__pyx_n_s_QueueType, __pyx_k_QueueType, sizeof(__pyx_k_QueueType), 0, 0, 1, 1},
{&__pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_k_RM_SUPERFINAL_PROPERTIES, sizeof(__pyx_k_RM_SUPERFINAL_PROPERTIES), 0, 0, 1, 1},
+ {&__pyx_n_s_RandArcSelection, __pyx_k_RandArcSelection, sizeof(__pyx_k_RandArcSelection), 0, 0, 1, 1},
{&__pyx_kp_u_Read_failed, __pyx_k_Read_failed, sizeof(__pyx_k_Read_failed), 0, 1, 0, 0},
- {&__pyx_kp_u_Read_failed_r, __pyx_k_Read_failed_r, sizeof(__pyx_k_Read_failed_r), 0, 1, 0, 0},
+ {&__pyx_kp_u_Read_from_FST_failed, __pyx_k_Read_from_FST_failed, sizeof(__pyx_k_Read_from_FST_failed), 0, 1, 0, 0},
+ {&__pyx_kp_u_Read_from_string_failed, __pyx_k_Read_from_string_failed, sizeof(__pyx_k_Read_from_string_failed), 0, 1, 0, 0},
+ {&__pyx_n_s_ReplaceLabelType, __pyx_k_ReplaceLabelType, sizeof(__pyx_k_ReplaceLabelType), 0, 0, 1, 1},
{&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
{&__pyx_n_s_SET_ARC_PROPERTIES, __pyx_k_SET_ARC_PROPERTIES, sizeof(__pyx_k_SET_ARC_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_SET_FINAL_PROPERTIES, __pyx_k_SET_FINAL_PROPERTIES, sizeof(__pyx_k_SET_FINAL_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_SET_START_PROPERTIES, __pyx_k_SET_START_PROPERTIES, sizeof(__pyx_k_SET_START_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_STATE_SORT_PROPERTIES, __pyx_k_STATE_SORT_PROPERTIES, sizeof(__pyx_k_STATE_SORT_PROPERTIES), 0, 0, 1, 1},
{&__pyx_n_s_STRING, __pyx_k_STRING, sizeof(__pyx_k_STRING), 0, 0, 1, 1},
+ {&__pyx_n_s_SortType, __pyx_k_SortType, sizeof(__pyx_k_SortType), 0, 0, 1, 1},
{&__pyx_n_s_StateIterator, __pyx_k_StateIterator, sizeof(__pyx_k_StateIterator), 0, 0, 1, 1},
- {&__pyx_kp_u_StateIterator_at_0x_x, __pyx_k_StateIterator_at_0x_x, sizeof(__pyx_k_StateIterator_at_0x_x), 0, 1, 0, 0},
+ {&__pyx_kp_u_StateIterator_at_0x, __pyx_k_StateIterator_at_0x, sizeof(__pyx_k_StateIterator_at_0x), 0, 1, 0, 0},
+ {&__pyx_n_s_StateMapType, __pyx_k_StateMapType, sizeof(__pyx_k_StateMapType), 0, 0, 1, 1},
{&__pyx_kp_u_State_index_out_of_range, __pyx_k_State_index_out_of_range, sizeof(__pyx_k_State_index_out_of_range), 0, 1, 0, 0},
{&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
- {&__pyx_n_s_SymbolTable, __pyx_k_SymbolTable, sizeof(__pyx_k_SymbolTable), 0, 0, 1, 1},
+ {&__pyx_kp_u_SymbolTable, __pyx_k_SymbolTable, sizeof(__pyx_k_SymbolTable), 0, 1, 0, 0},
{&__pyx_n_s_SymbolTableIterator, __pyx_k_SymbolTableIterator, sizeof(__pyx_k_SymbolTableIterator), 0, 0, 1, 1},
- {&__pyx_kp_u_SymbolTableIterator_at_0x_x, __pyx_k_SymbolTableIterator_at_0x_x, sizeof(__pyx_k_SymbolTableIterator_at_0x_x), 0, 1, 0, 0},
+ {&__pyx_kp_u_SymbolTableIterator_at_0x, __pyx_k_SymbolTableIterator_at_0x, sizeof(__pyx_k_SymbolTableIterator_at_0x), 0, 1, 0, 0},
+ {&__pyx_n_s_SymbolTableView, __pyx_k_SymbolTableView, sizeof(__pyx_k_SymbolTableView), 0, 0, 1, 1},
{&__pyx_n_s_SymbolTable_2, __pyx_k_SymbolTable_2, sizeof(__pyx_k_SymbolTable_2), 0, 0, 1, 1},
{&__pyx_kp_u_SymbolTable_no_longer_exists, __pyx_k_SymbolTable_no_longer_exists, sizeof(__pyx_k_SymbolTable_no_longer_exists), 0, 1, 0, 0},
- {&__pyx_kp_u_SymbolTable_r_at_0x_x, __pyx_k_SymbolTable_r_at_0x_x, sizeof(__pyx_k_SymbolTable_r_at_0x_x), 0, 1, 0, 0},
{&__pyx_n_s_TOP_SORTED, __pyx_k_TOP_SORTED, sizeof(__pyx_k_TOP_SORTED), 0, 0, 1, 1},
{&__pyx_n_s_TRINARY_PROPERTIES, __pyx_k_TRINARY_PROPERTIES, sizeof(__pyx_k_TRINARY_PROPERTIES), 0, 0, 1, 1},
{&__pyx_kp_u_Tsvg, __pyx_k_Tsvg, sizeof(__pyx_k_Tsvg), 0, 1, 0, 0},
{&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
{&__pyx_n_s_UNWEIGHTED, __pyx_k_UNWEIGHTED, sizeof(__pyx_k_UNWEIGHTED), 0, 0, 1, 1},
{&__pyx_n_s_UNWEIGHTED_CYCLES, __pyx_k_UNWEIGHTED_CYCLES, sizeof(__pyx_k_UNWEIGHTED_CYCLES), 0, 0, 1, 1},
- {&__pyx_kp_u_Unknown_arc_type_r, __pyx_k_Unknown_arc_type_r, sizeof(__pyx_k_Unknown_arc_type_r), 0, 1, 0, 0},
- {&__pyx_kp_u_Unknown_compose_filter_type_r, __pyx_k_Unknown_compose_filter_type_r, sizeof(__pyx_k_Unknown_compose_filter_type_r), 0, 1, 0, 0},
- {&__pyx_kp_u_Unknown_determinization_type_r, __pyx_k_Unknown_determinization_type_r, sizeof(__pyx_k_Unknown_determinization_type_r), 0, 1, 0, 0},
- {&__pyx_kp_u_Unknown_map_type_r, __pyx_k_Unknown_map_type_r, sizeof(__pyx_k_Unknown_map_type_r), 0, 1, 0, 0},
- {&__pyx_kp_u_Unknown_queue_type_r, __pyx_k_Unknown_queue_type_r, sizeof(__pyx_k_Unknown_queue_type_r), 0, 1, 0, 0},
+ {&__pyx_kp_u_Unknown_FAR_type, __pyx_k_Unknown_FAR_type, sizeof(__pyx_k_Unknown_FAR_type), 0, 1, 0, 0},
+ {&__pyx_kp_u_Unknown_arc_type, __pyx_k_Unknown_arc_type, sizeof(__pyx_k_Unknown_arc_type), 0, 1, 0, 0},
+ {&__pyx_kp_u_Unknown_compose_filter_type, __pyx_k_Unknown_compose_filter_type, sizeof(__pyx_k_Unknown_compose_filter_type), 0, 1, 0, 0},
+ {&__pyx_kp_u_Unknown_determinization_type, __pyx_k_Unknown_determinization_type, sizeof(__pyx_k_Unknown_determinization_type), 0, 1, 0, 0},
+ {&__pyx_kp_u_Unknown_map_type, __pyx_k_Unknown_map_type, sizeof(__pyx_k_Unknown_map_type), 0, 1, 0, 0},
+ {&__pyx_kp_u_Unknown_projection_type, __pyx_k_Unknown_projection_type, sizeof(__pyx_k_Unknown_projection_type), 0, 1, 0, 0},
+ {&__pyx_kp_u_Unknown_queue_type, __pyx_k_Unknown_queue_type, sizeof(__pyx_k_Unknown_queue_type), 0, 1, 0, 0},
{&__pyx_kp_u_Unknown_random_arc_selection_typ, __pyx_k_Unknown_random_arc_selection_typ, sizeof(__pyx_k_Unknown_random_arc_selection_typ), 0, 1, 0, 0},
- {&__pyx_kp_u_Unknown_replace_label_type_r, __pyx_k_Unknown_replace_label_type_r, sizeof(__pyx_k_Unknown_replace_label_type_r), 0, 1, 0, 0},
- {&__pyx_kp_u_Unknown_sort_type_r, __pyx_k_Unknown_sort_type_r, sizeof(__pyx_k_Unknown_sort_type_r), 0, 1, 0, 0},
- {&__pyx_kp_u_Use_print_instead, __pyx_k_Use_print_instead, sizeof(__pyx_k_Use_print_instead), 0, 1, 0, 0},
+ {&__pyx_kp_u_Unknown_replace_label_type, __pyx_k_Unknown_replace_label_type, sizeof(__pyx_k_Unknown_replace_label_type), 0, 1, 0, 0},
+ {&__pyx_kp_u_Unknown_sort_type, __pyx_k_Unknown_sort_type, sizeof(__pyx_k_Unknown_sort_type), 0, 1, 0, 0},
{&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
{&__pyx_n_s_VectorFst, __pyx_k_VectorFst, sizeof(__pyx_k_VectorFst), 0, 0, 1, 1},
{&__pyx_n_s_WEIGHTED, __pyx_k_WEIGHTED, sizeof(__pyx_k_WEIGHTED), 0, 0, 1, 1},
{&__pyx_n_s_WEIGHTED_CYCLES, __pyx_k_WEIGHTED_CYCLES, sizeof(__pyx_k_WEIGHTED_CYCLES), 0, 0, 1, 1},
{&__pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_k_WEIGHT_INVARIANT_PROPERTIES, sizeof(__pyx_k_WEIGHT_INVARIANT_PROPERTIES), 0, 0, 1, 1},
- {&__pyx_n_s_Weight, __pyx_k_Weight, sizeof(__pyx_k_Weight), 0, 0, 1, 1},
- {&__pyx_kp_u_Weight_at_0x_x, __pyx_k_Weight_at_0x_x, sizeof(__pyx_k_Weight_at_0x_x), 0, 1, 0, 0},
+ {&__pyx_kp_u_Weight, __pyx_k_Weight, sizeof(__pyx_k_Weight), 0, 1, 0, 0},
+ {&__pyx_n_s_WeightLike, __pyx_k_WeightLike, sizeof(__pyx_k_WeightLike), 0, 0, 1, 1},
+ {&__pyx_n_s_Weight_2, __pyx_k_Weight_2, sizeof(__pyx_k_Weight_2), 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_r, __pyx_k_Write_failed_r, sizeof(__pyx_k_Write_failed_r), 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_b__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 0, 0},
+ {&__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_acceptor, __pyx_k_acceptor, sizeof(__pyx_k_acceptor), 0, 0, 1, 1},
{&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
{&__pyx_n_s_add_state, __pyx_k_add_state, sizeof(__pyx_k_add_state), 0, 0, 1, 1},
{&__pyx_n_s_add_table, __pyx_k_add_table, sizeof(__pyx_k_add_table), 0, 0, 1, 1},
{&__pyx_n_s_allow_negative_labels, __pyx_k_allow_negative_labels, sizeof(__pyx_k_allow_negative_labels), 0, 0, 1, 1},
{&__pyx_n_s_allow_nondet, __pyx_k_allow_nondet, sizeof(__pyx_k_allow_nondet), 0, 0, 1, 1},
- {&__pyx_n_u_always, __pyx_k_always, sizeof(__pyx_k_always), 0, 1, 0, 1},
{&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1},
{&__pyx_n_s_arc_type, __pyx_k_arc_type, sizeof(__pyx_k_arc_type), 0, 0, 1, 1},
{&__pyx_n_s_arcs, __pyx_k_arcs, sizeof(__pyx_k_arcs), 0, 0, 1, 1},
{&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
+ {&__pyx_kp_u_at_0x, __pyx_k_at_0x, sizeof(__pyx_k_at_0x), 0, 1, 0, 0},
{&__pyx_n_s_attach_new_isymbols, __pyx_k_attach_new_isymbols, sizeof(__pyx_k_attach_new_isymbols), 0, 0, 1, 1},
{&__pyx_n_s_attach_new_osymbols, __pyx_k_attach_new_osymbols, sizeof(__pyx_k_attach_new_osymbols), 0, 0, 1, 1},
- {&__pyx_n_b_auto, __pyx_k_auto, sizeof(__pyx_k_auto), 0, 0, 0, 1},
+ {&__pyx_n_u_auto, __pyx_k_auto, sizeof(__pyx_k_auto), 0, 1, 0, 1},
{&__pyx_n_s_available_key, __pyx_k_available_key, sizeof(__pyx_k_available_key), 0, 0, 1, 1},
+ {&__pyx_kp_u_but_received, __pyx_k_but_received, sizeof(__pyx_k_but_received), 0, 1, 0, 0},
{&__pyx_n_s_call_arc_labeling, __pyx_k_call_arc_labeling, sizeof(__pyx_k_call_arc_labeling), 0, 0, 1, 1},
{&__pyx_n_s_checksum, __pyx_k_checksum, sizeof(__pyx_k_checksum), 0, 0, 1, 1},
{&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
+ {&__pyx_n_s_class_2, __pyx_k_class_2, sizeof(__pyx_k_class_2), 0, 0, 1, 1},
{&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
{&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
{&__pyx_n_s_closure_plus, __pyx_k_closure_plus, sizeof(__pyx_k_closure_plus), 0, 0, 1, 1},
{&__pyx_n_s_compose_filter, __pyx_k_compose_filter, sizeof(__pyx_k_compose_filter), 0, 0, 1, 1},
{&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1},
{&__pyx_kp_u_const_EncodeMapper_SymbolTableV, __pyx_k_const_EncodeMapper_SymbolTableV, sizeof(__pyx_k_const_EncodeMapper_SymbolTableV), 0, 1, 0, 0},
- {&__pyx_kp_u_const_Fst_SymbolTableView_r_at, __pyx_k_const_Fst_SymbolTableView_r_at, sizeof(__pyx_k_const_Fst_SymbolTableView_r_at), 0, 1, 0, 0},
+ {&__pyx_kp_u_const_Fst_SymbolTableView, __pyx_k_const_Fst_SymbolTableView, sizeof(__pyx_k_const_Fst_SymbolTableView), 0, 1, 0, 0},
{&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
{&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1},
- {&__pyx_n_b_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 0, 1},
+ {&__pyx_n_u_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 1, 0, 1},
{&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 0, 0, 1, 1},
{&__pyx_n_s_det_type, __pyx_k_det_type, sizeof(__pyx_k_det_type), 0, 0, 1, 1},
{&__pyx_n_s_distance, __pyx_k_distance, sizeof(__pyx_k_distance), 0, 0, 1, 1},
{&__pyx_n_s_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 0, 1, 1},
{&__pyx_n_u_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 0, 1, 0, 1},
{&__pyx_n_s_draw, __pyx_k_draw, sizeof(__pyx_k_draw), 0, 0, 1, 1},
- {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
{&__pyx_n_s_encode_labels, __pyx_k_encode_labels, sizeof(__pyx_k_encode_labels), 0, 0, 1, 1},
{&__pyx_n_s_encode_weights, __pyx_k_encode_weights, sizeof(__pyx_k_encode_weights), 0, 0, 1, 1},
{&__pyx_n_s_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_kp_u_failed, __pyx_k_failed, sizeof(__pyx_k_failed), 0, 1, 0, 0},
{&__pyx_n_s_far_type, __pyx_k_far_type, sizeof(__pyx_k_far_type), 0, 0, 1, 1},
{&__pyx_n_s_final, __pyx_k_final, sizeof(__pyx_k_final), 0, 0, 1, 1},
{&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
{&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
{&__pyx_n_s_float_format, __pyx_k_float_format, sizeof(__pyx_k_float_format), 0, 0, 1, 1},
{&__pyx_n_s_fontsize, __pyx_k_fontsize, sizeof(__pyx_k_fontsize), 0, 0, 1, 1},
- {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
+ {&__pyx_n_s_fspath, __pyx_k_fspath, sizeof(__pyx_k_fspath), 0, 0, 1, 1},
{&__pyx_n_s_fst_type, __pyx_k_fst_type, sizeof(__pyx_k_fst_type), 0, 0, 1, 1},
- {&__pyx_n_b_functional, __pyx_k_functional, sizeof(__pyx_k_functional), 0, 0, 0, 1},
- {&__pyx_n_b_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 0, 1},
+ {&__pyx_n_u_functional, __pyx_k_functional, sizeof(__pyx_k_functional), 0, 1, 0, 1},
+ {&__pyx_n_u_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 1, 0, 1},
{&__pyx_n_s_get_fst, __pyx_k_get_fst, sizeof(__pyx_k_get_fst), 0, 0, 1, 1},
{&__pyx_n_s_get_key, __pyx_k_get_key, sizeof(__pyx_k_get_key), 0, 0, 1, 1},
{&__pyx_n_s_get_nth_key, __pyx_k_get_nth_key, sizeof(__pyx_k_get_nth_key), 0, 0, 1, 1},
{&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
{&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1},
{&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
- {&__pyx_n_b_identity, __pyx_k_identity, sizeof(__pyx_k_identity), 0, 0, 0, 1},
+ {&__pyx_n_u_identity, __pyx_k_identity, sizeof(__pyx_k_identity), 0, 1, 0, 1},
{&__pyx_n_s_ifst, __pyx_k_ifst, sizeof(__pyx_k_ifst), 0, 0, 1, 1},
{&__pyx_n_s_ifst1, __pyx_k_ifst1, sizeof(__pyx_k_ifst1), 0, 0, 1, 1},
{&__pyx_n_s_ifst2, __pyx_k_ifst2, sizeof(__pyx_k_ifst2), 0, 0, 1, 1},
- {&__pyx_n_b_ilabel, __pyx_k_ilabel, sizeof(__pyx_k_ilabel), 0, 0, 0, 1},
{&__pyx_n_s_ilabel, __pyx_k_ilabel, sizeof(__pyx_k_ilabel), 0, 0, 1, 1},
+ {&__pyx_n_u_ilabel, __pyx_k_ilabel, sizeof(__pyx_k_ilabel), 0, 1, 0, 1},
{&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
{&__pyx_n_s_increment_subsequential_label, __pyx_k_increment_subsequential_label, sizeof(__pyx_k_increment_subsequential_label), 0, 0, 1, 1},
- {&__pyx_n_b_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 0, 0, 1},
+ {&__pyx_n_u_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 1, 0, 1},
{&__pyx_n_s_input_symbols, __pyx_k_input_symbols, sizeof(__pyx_k_input_symbols), 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_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
{&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
{&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
- {&__pyx_n_b_neither, __pyx_k_neither, sizeof(__pyx_k_neither), 0, 0, 0, 1},
+ {&__pyx_n_u_neither, __pyx_k_neither, sizeof(__pyx_k_neither), 0, 1, 0, 1},
{&__pyx_n_s_new_isymbols, __pyx_k_new_isymbols, sizeof(__pyx_k_new_isymbols), 0, 0, 1, 1},
{&__pyx_n_s_new_osymbols, __pyx_k_new_osymbols, sizeof(__pyx_k_new_osymbols), 0, 0, 1, 1},
{&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 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_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_osymbols, __pyx_k_osymbols, sizeof(__pyx_k_osymbols), 0, 0, 1, 1},
{&__pyx_n_s_output_symbols, __pyx_k_output_symbols, sizeof(__pyx_k_output_symbols), 0, 0, 1, 1},
{&__pyx_n_s_pairs, __pyx_k_pairs, sizeof(__pyx_k_pairs), 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_project_output, __pyx_k_project_output, sizeof(__pyx_k_project_output), 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_pywrapfst_2, __pyx_k_pywrapfst_2, sizeof(__pyx_k_pywrapfst_2), 0, 0, 1, 1},
+ {&__pyx_kp_s_pywrapfst_pyx, __pyx_k_pywrapfst_pyx, sizeof(__pyx_k_pywrapfst_pyx), 0, 0, 1, 0},
{&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
{&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
{&__pyx_n_s_queue_type, __pyx_k_queue_type, sizeof(__pyx_k_queue_type), 0, 0, 1, 1},
{&__pyx_n_s_remove_total_weight, __pyx_k_remove_total_weight, sizeof(__pyx_k_remove_total_weight), 0, 0, 1, 1},
{&__pyx_n_s_require_superinitial, __pyx_k_require_superinitial, sizeof(__pyx_k_require_superinitial), 0, 0, 1, 1},
{&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1},
- {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
{&__pyx_n_s_return_arc_labeling, __pyx_k_return_arc_labeling, sizeof(__pyx_k_return_arc_labeling), 0, 0, 1, 1},
{&__pyx_n_s_return_label, __pyx_k_return_label, sizeof(__pyx_k_return_label), 0, 0, 1, 1},
{&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1},
{&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
{&__pyx_n_s_shortestdistance, __pyx_k_shortestdistance, sizeof(__pyx_k_shortestdistance), 0, 0, 1, 1},
{&__pyx_n_s_show_weight_one, __pyx_k_show_weight_one, sizeof(__pyx_k_show_weight_one), 0, 0, 1, 1},
- {&__pyx_n_s_simplefilter, __pyx_k_simplefilter, sizeof(__pyx_k_simplefilter), 0, 0, 1, 1},
{&__pyx_n_s_sort_type, __pyx_k_sort_type, sizeof(__pyx_k_sort_type), 0, 0, 1, 1},
{&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
- {&__pyx_kp_s_src_pywrapfst_pyx, __pyx_k_src_pywrapfst_pyx, sizeof(__pyx_k_src_pywrapfst_pyx), 0, 0, 1, 0},
{&__pyx_n_s_ssymbols, __pyx_k_ssymbols, sizeof(__pyx_k_ssymbols), 0, 0, 1, 1},
- {&__pyx_n_s_stacklevel, __pyx_k_stacklevel, sizeof(__pyx_k_stacklevel), 0, 0, 1, 1},
- {&__pyx_n_b_standard, __pyx_k_standard, sizeof(__pyx_k_standard), 0, 0, 0, 1},
+ {&__pyx_n_u_standard, __pyx_k_standard, sizeof(__pyx_k_standard), 0, 1, 0, 1},
{&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
{&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
{&__pyx_n_s_states, __pyx_k_states, sizeof(__pyx_k_states), 0, 0, 1, 1},
{&__pyx_n_s_subprocess, __pyx_k_subprocess, sizeof(__pyx_k_subprocess), 0, 0, 1, 1},
{&__pyx_n_s_subsequential_label, __pyx_k_subsequential_label, sizeof(__pyx_k_subsequential_label), 0, 0, 1, 1},
{&__pyx_n_s_symbol, __pyx_k_symbol, sizeof(__pyx_k_symbol), 0, 0, 1, 1},
- {&__pyx_n_s_syms, __pyx_k_syms, sizeof(__pyx_k_syms), 0, 0, 1, 1},
+ {&__pyx_n_s_symbols, __pyx_k_symbols, sizeof(__pyx_k_symbols), 0, 0, 1, 1},
+ {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
{&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
{&__pyx_n_s_test_2, __pyx_k_test_2, sizeof(__pyx_k_test_2), 0, 0, 1, 1},
- {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1},
{&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
{&__pyx_n_s_times, __pyx_k_times, sizeof(__pyx_k_times), 0, 0, 1, 1},
{&__pyx_n_s_title, __pyx_k_title, sizeof(__pyx_k_title), 0, 0, 1, 1},
{&__pyx_n_s_to_final, __pyx_k_to_final, sizeof(__pyx_k_to_final), 0, 0, 1, 1},
{&__pyx_n_s_to_string, __pyx_k_to_string, sizeof(__pyx_k_to_string), 0, 0, 1, 1},
{&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
- {&__pyx_n_b_uniform, __pyx_k_uniform, sizeof(__pyx_k_uniform), 0, 0, 0, 1},
+ {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
+ {&__pyx_kp_u_typing_Literal_alt_sequence_auto, __pyx_k_typing_Literal_alt_sequence_auto, sizeof(__pyx_k_typing_Literal_alt_sequence_auto), 0, 1, 0, 0},
+ {&__pyx_kp_u_typing_Literal_arc_sum_arc_uniqu, __pyx_k_typing_Literal_arc_sum_arc_uniqu, sizeof(__pyx_k_typing_Literal_arc_sum_arc_uniqu), 0, 1, 0, 0},
+ {&__pyx_kp_u_typing_Literal_auto_fifo_lifo_sh, __pyx_k_typing_Literal_auto_fifo_lifo_sh, sizeof(__pyx_k_typing_Literal_auto_fifo_lifo_sh), 0, 1, 0, 0},
+ {&__pyx_kp_u_typing_Literal_e_f_g, __pyx_k_typing_Literal_e_f_g, sizeof(__pyx_k_typing_Literal_e_f_g), 0, 1, 0, 0},
+ {&__pyx_kp_u_typing_Literal_fst_stlist_sttabl, __pyx_k_typing_Literal_fst_stlist_sttabl, sizeof(__pyx_k_typing_Literal_fst_stlist_sttabl), 0, 1, 0, 0},
+ {&__pyx_kp_u_typing_Literal_functional_nonfun, __pyx_k_typing_Literal_functional_nonfun, sizeof(__pyx_k_typing_Literal_functional_nonfun), 0, 1, 0, 0},
+ {&__pyx_kp_u_typing_Literal_identity_input_ep, __pyx_k_typing_Literal_identity_input_ep, sizeof(__pyx_k_typing_Literal_identity_input_ep), 0, 1, 0, 0},
+ {&__pyx_kp_u_typing_Literal_ilabel_olabel, __pyx_k_typing_Literal_ilabel_olabel, sizeof(__pyx_k_typing_Literal_ilabel_olabel), 0, 1, 0, 0},
+ {&__pyx_kp_u_typing_Literal_input_output, __pyx_k_typing_Literal_input_output, sizeof(__pyx_k_typing_Literal_input_output), 0, 1, 0, 0},
+ {&__pyx_kp_u_typing_Literal_neither_input_out, __pyx_k_typing_Literal_neither_input_out, sizeof(__pyx_k_typing_Literal_neither_input_out), 0, 1, 0, 0},
+ {&__pyx_kp_u_typing_Literal_uniform_log_prob, __pyx_k_typing_Literal_uniform_log_prob, sizeof(__pyx_k_typing_Literal_uniform_log_prob), 0, 1, 0, 0},
+ {&__pyx_kp_u_typing_Union_Weight_typing_Union, __pyx_k_typing_Union_Weight_typing_Union, sizeof(__pyx_k_typing_Union_Weight_typing_Union), 0, 1, 0, 0},
+ {&__pyx_n_u_uniform, __pyx_k_uniform, sizeof(__pyx_k_uniform), 0, 1, 0, 1},
{&__pyx_n_s_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 0, 0, 1, 1},
{&__pyx_n_s_unknown_isymbol, __pyx_k_unknown_isymbol, sizeof(__pyx_k_unknown_isymbol), 0, 0, 1, 1},
{&__pyx_n_s_unknown_osymbol, __pyx_k_unknown_osymbol, sizeof(__pyx_k_unknown_osymbol), 0, 0, 1, 1},
{&__pyx_kp_u_unspecified, __pyx_k_unspecified, sizeof(__pyx_k_unspecified), 0, 1, 0, 0},
- {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1},
{&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
- {&__pyx_n_b_vector, __pyx_k_vector, sizeof(__pyx_k_vector), 0, 0, 0, 1},
+ {&__pyx_n_u_vector, __pyx_k_vector, sizeof(__pyx_k_vector), 0, 1, 0, 1},
{&__pyx_n_s_verify, __pyx_k_verify, sizeof(__pyx_k_verify), 0, 0, 1, 1},
{&__pyx_n_s_vertical, __pyx_k_vertical, sizeof(__pyx_k_vertical), 0, 0, 1, 1},
{&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
- {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
{&__pyx_n_s_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 0, 1, 1},
- {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
{&__pyx_n_s_weight, __pyx_k_weight, sizeof(__pyx_k_weight), 0, 0, 1, 1},
+ {&__pyx_n_s_weight_2, __pyx_k_weight_2, sizeof(__pyx_k_weight_2), 0, 0, 1, 1},
{&__pyx_n_s_weight_type, __pyx_k_weight_type, sizeof(__pyx_k_weight_type), 0, 0, 1, 1},
{&__pyx_n_s_weighted, __pyx_k_weighted, sizeof(__pyx_k_weighted), 0, 0, 1, 1},
{&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
{&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 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},
{0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_DeprecationWarning = __Pyx_GetBuiltinName(__pyx_n_s_DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) __PYX_ERR(0, 106, __pyx_L1_error)
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 117, __pyx_L1_error)
- __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 127, __pyx_L1_error)
- __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 132, __pyx_L1_error)
- __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 137, __pyx_L1_error)
- __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 1358, __pyx_L1_error)
- __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 361, __pyx_L1_error)
- __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
- __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 1225, __pyx_L1_error)
- __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 4522, __pyx_L1_error)
+ __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)
return 0;
__pyx_L1_error:;
return -1;
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._weight cannot be converted to a Python object for pickling")
*/
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self__weight_cannot_be_converted); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple_);
- __Pyx_GIVEREF(__pyx_tuple_);
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self__weight_cannot_be_converted); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__4);
+ __Pyx_GIVEREF(__pyx_tuple__4);
/* "(tree fragment)":4
* raise TypeError("self._weight cannot be converted to a Python object for pickling")
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._weight cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
*/
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self__weight_cannot_be_converted); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__2);
- __Pyx_GIVEREF(__pyx_tuple__2);
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self__weight_cannot_be_converted); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__5);
+ __Pyx_GIVEREF(__pyx_tuple__5);
/* "(tree fragment)":2
* def __reduce_cython__(self):
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._siter cannot be converted to a Python object for pickling")
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self__siter_cannot_be_converted); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__4);
- __Pyx_GIVEREF(__pyx_tuple__4);
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_self__siter_cannot_be_converted); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
/* "(tree fragment)":4
* raise TypeError("self._siter cannot be converted to a Python object for pickling")
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._siter cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
*/
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self__siter_cannot_be_converted); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__5);
- __Pyx_GIVEREF(__pyx_tuple__5);
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_self__siter_cannot_be_converted); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
- /* "pywrapfst.pyx":1516
+ /* "pywrapfst.pyx":1576
* @staticmethod
* cdef string _local_render_svg(const string &dot):
* proc = subprocess.Popen(("dot", "-Tsvg"), # <<<<<<<<<<<<<<
* stdin=subprocess.PIPE,
* stdout=subprocess.PIPE)
*/
- __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_u_dot, __pyx_kp_u_Tsvg); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1516, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__6);
- __Pyx_GIVEREF(__pyx_tuple__6);
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_tuple__6); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1516, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__7);
- __Pyx_GIVEREF(__pyx_tuple__7);
-
- /* "pywrapfst.pyx":1927
- * A formatted string representing the machine.
- * """
- * warnings.warn("Use `print` instead", DeprecationWarning, stacklevel=2) # <<<<<<<<<<<<<<
- * return self.print(isymbols,
- * osymbols,
- */
- __pyx_tuple__9 = PyTuple_Pack(2, __pyx_kp_u_Use_print_instead, __pyx_builtin_DeprecationWarning); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1927, __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, 1576, __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_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
/* "(tree fragment)":2
* def __reduce_cython__(self):
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._arc cannot be converted to a Python object for pickling")
*/
- __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_self__arc_cannot_be_converted_to); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 2, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__22);
- __Pyx_GIVEREF(__pyx_tuple__22);
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_self__arc_cannot_be_converted_to); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
/* "(tree fragment)":4
* raise TypeError("self._arc cannot be converted to a Python object for pickling")
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._arc cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
*/
- __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_self__arc_cannot_be_converted_to); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 4, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__23);
- __Pyx_GIVEREF(__pyx_tuple__23);
+ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_self__arc_cannot_be_converted_to); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_GIVEREF(__pyx_tuple__25);
/* "(tree fragment)":2
* def __reduce_cython__(self):
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling")
*/
- __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__fst_cannot_be); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 2, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__24);
- __Pyx_GIVEREF(__pyx_tuple__24);
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__fst_cannot_be); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__26);
+ __Pyx_GIVEREF(__pyx_tuple__26);
/* "(tree fragment)":4
* raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling")
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
*/
- __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__fst_cannot_be); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__25);
- __Pyx_GIVEREF(__pyx_tuple__25);
+ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__fst_cannot_be); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__27);
+ __Pyx_GIVEREF(__pyx_tuple__27);
/* "(tree fragment)":2
* def __reduce_cython__(self):
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling")
*/
- __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__mfst_cannot_be); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 2, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__26);
- __Pyx_GIVEREF(__pyx_tuple__26);
+ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__mfst_cannot_be); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__28);
+ __Pyx_GIVEREF(__pyx_tuple__28);
/* "(tree fragment)":4
* raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling")
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
*/
- __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__mfst_cannot_be); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 4, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__27);
- __Pyx_GIVEREF(__pyx_tuple__27);
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__mfst_cannot_be); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
/* "(tree fragment)":2
* def __reduce_cython__(self):
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling")
*/
- __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_self__fst_self__siter_cannot_be); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 2, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__28);
- __Pyx_GIVEREF(__pyx_tuple__28);
+ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_self__fst_self__siter_cannot_be); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__30);
+ __Pyx_GIVEREF(__pyx_tuple__30);
/* "(tree fragment)":4
* raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling")
* def __setstate_cython__(self, __pyx_state):
* raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
*/
- __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_self__fst_self__siter_cannot_be); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 4, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__29);
- __Pyx_GIVEREF(__pyx_tuple__29);
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_self__fst_self__siter_cannot_be); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__31);
+ __Pyx_GIVEREF(__pyx_tuple__31);
/* "(tree fragment)":2
* def __reduce_cython__(self):
__Pyx_GOTREF(__pyx_tuple__58);
__Pyx_GIVEREF(__pyx_tuple__58);
- /* "pywrapfst.pyx":106
- * import warnings
- *
- * warnings.simplefilter("always", DeprecationWarning) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_tuple__59 = PyTuple_Pack(2, __pyx_n_u_always, __pyx_builtin_DeprecationWarning); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 106, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__59);
- __Pyx_GIVEREF(__pyx_tuple__59);
-
- /* "pywrapfst.pyx":450
+ /* "pywrapfst.pyx":513
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* plus(lhs, rhs)
*/
- __pyx_tuple__60 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 450, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__60);
- __Pyx_GIVEREF(__pyx_tuple__60);
- __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pywrapfst_pyx, __pyx_n_s_plus, 450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 450, __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, 513, __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)
- /* "pywrapfst.pyx":482
+ /* "pywrapfst.pyx":545
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* times(lhs, rhs)
*/
- __pyx_tuple__62 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 482, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__62);
- __Pyx_GIVEREF(__pyx_tuple__62);
- __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pywrapfst_pyx, __pyx_n_s_times, 482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 482, __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, 545, __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)
- /* "pywrapfst.pyx":514
+ /* "pywrapfst.pyx":577
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* divide(lhs, rhs)
*/
- __pyx_tuple__64 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 514, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__64);
- __Pyx_GIVEREF(__pyx_tuple__64);
- __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pywrapfst_pyx, __pyx_n_s_divide, 514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 514, __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, 577, __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)
- /* "pywrapfst.pyx":547
+ /* "pywrapfst.pyx":610
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
* """
* power(lhs, rhs)
*/
- __pyx_tuple__66 = PyTuple_Pack(3, __pyx_n_s_w, __pyx_n_s_n, __pyx_n_s_result); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__66);
- __Pyx_GIVEREF(__pyx_tuple__66);
- __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pywrapfst_pyx, __pyx_n_s_power, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 547, __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, 610, __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)
- /* "pywrapfst.pyx":1359
+ /* "pywrapfst.pyx":1419
*
* @staticmethod
* def read_from_string(state): # <<<<<<<<<<<<<<
* """
* read_from_string(state)
*/
- __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__68);
- __Pyx_GIVEREF(__pyx_tuple__68);
- __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pywrapfst_pyx, __pyx_n_s_read_from_string, 1359, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 1359, __pyx_L1_error)
+ __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1419, __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)
- /* "pywrapfst.pyx":4099
+ /* "pywrapfst.pyx":4130
*
*
* def shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kShortestDelta,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_tuple__70 = PyTuple_Pack(8, __pyx_n_s_ifst, __pyx_n_s_delta, __pyx_n_s_nstate, __pyx_n_s_queue_type, __pyx_n_s_reverse, __pyx_n_s_distance, __pyx_n_s_weight_type, __pyx_n_s_weight); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__70);
- __Pyx_GIVEREF(__pyx_tuple__70);
- __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pywrapfst_pyx, __pyx_n_s_shortestdistance, 4099, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 4099, __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, 4130, __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_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
static int __Pyx_modinit_function_export_code(void) {
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
/*--- Function export code ---*/
if (__Pyx_ExportFunction("tostring", (void (*)(void))__pyx_f_9pywrapfst_tostring, "std::string (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("weight_tostring", (void (*)(void))__pyx_f_9pywrapfst_weight_tostring, "std::string (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_ExportFunction("path_tostring", (void (*)(void))__pyx_f_9pywrapfst_path_tostring, "std::string (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_get_compose_filter", (void (*)(void))__pyx_f_9pywrapfst__get_compose_filter, "enum fst::ComposeFilter (std::string const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_get_determinize_type", (void (*)(void))__pyx_f_9pywrapfst__get_determinize_type, "enum fst::DeterminizeType (std::string const &)") < 0) __PYX_ERR(0, 1, __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("_init_FstSymbolTableView", (void (*)(void))__pyx_f_9pywrapfst__init_FstSymbolTableView, "struct __pyx_obj_9pywrapfst__FstSymbolTableView *(std::shared_ptr<fst::script::FstClass> , bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_init_MutableFstSymbolTableView", (void (*)(void))__pyx_f_9pywrapfst__init_MutableFstSymbolTableView, "struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *(std::shared_ptr<fst::script::MutableFstClass> , bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_init_SymbolTable", (void (*)(void))__pyx_f_9pywrapfst__init_SymbolTable, "struct __pyx_obj_9pywrapfst_SymbolTable *(std::unique_ptr<fst::SymbolTable> )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- if (__Pyx_ExportFunction("_read_SymbolTable_from_string", (void (*)(void))__pyx_f_9pywrapfst__read_SymbolTable_from_string, "struct __pyx_obj_9pywrapfst_SymbolTable *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_ExportFunction("_read_SymbolTable_from_string", (void (*)(void))__pyx_f_9pywrapfst__read_SymbolTable_from_string, "struct __pyx_obj_9pywrapfst_SymbolTable *(std::string, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_init_EncodeMapper", (void (*)(void))__pyx_f_9pywrapfst__init_EncodeMapper, "struct __pyx_obj_9pywrapfst_EncodeMapper *(__pyx_t_9pywrapfst_EncodeMapperClass_ptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- if (__Pyx_ExportFunction("_read_EncodeMapper_from_string", (void (*)(void))__pyx_f_9pywrapfst__read_EncodeMapper_from_string, "struct __pyx_obj_9pywrapfst_EncodeMapper *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_ExportFunction("_read_EncodeMapper_from_string", (void (*)(void))__pyx_f_9pywrapfst__read_EncodeMapper_from_string, "struct __pyx_obj_9pywrapfst_EncodeMapper *(std::string, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_init_Fst", (void (*)(void))__pyx_f_9pywrapfst__init_Fst, "struct __pyx_obj_9pywrapfst_Fst *(__pyx_t_9pywrapfst_FstClass_ptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_init_MutableFst", (void (*)(void))__pyx_f_9pywrapfst__init_MutableFst, "struct __pyx_obj_9pywrapfst_MutableFst *(__pyx_t_9pywrapfst_MutableFstClass_ptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_init_XFst", (void (*)(void))__pyx_f_9pywrapfst__init_XFst, "struct __pyx_obj_9pywrapfst_Fst *(__pyx_t_9pywrapfst_FstClass_ptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_read_Fst", (void (*)(void))__pyx_f_9pywrapfst__read_Fst, "struct __pyx_obj_9pywrapfst_Fst *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- if (__Pyx_ExportFunction("_read_Fst_from_string", (void (*)(void))__pyx_f_9pywrapfst__read_Fst_from_string, "struct __pyx_obj_9pywrapfst_Fst *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_ExportFunction("_read_Fst_from_string", (void (*)(void))__pyx_f_9pywrapfst__read_Fst_from_string, "struct __pyx_obj_9pywrapfst_Fst *(std::string, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_init_Arc", (void (*)(void))__pyx_f_9pywrapfst__init_Arc, "struct __pyx_obj_9pywrapfst_Arc *(fst::script::ArcClass const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("_map", (void (*)(void))__pyx_f_9pywrapfst__map, "struct __pyx_obj_9pywrapfst_Fst *(struct __pyx_obj_9pywrapfst_Fst *, struct __pyx_opt_args_9pywrapfst__map *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("arcmap", (void (*)(void))__pyx_f_9pywrapfst_arcmap, "struct __pyx_obj_9pywrapfst_Fst *(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_arcmap *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("randgen", (void (*)(void))__pyx_f_9pywrapfst_randgen, "struct __pyx_obj_9pywrapfst_MutableFst *(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_randgen *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("replace", (void (*)(void))__pyx_f_9pywrapfst_replace, "struct __pyx_obj_9pywrapfst_MutableFst *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_replace *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("reverse", (void (*)(void))__pyx_f_9pywrapfst_reverse, "struct __pyx_obj_9pywrapfst_MutableFst *(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_reverse *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- if (__Pyx_ExportFunction("_shortestdistance", (void (*)(void))__pyx_f_9pywrapfst__shortestdistance, "std::vector<fst::script::WeightClass> *(struct __pyx_obj_9pywrapfst_Fst *, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_ExportFunction("_shortestdistance", (void (*)(void))__pyx_f_9pywrapfst__shortestdistance, "void (struct __pyx_obj_9pywrapfst_Fst *, std::vector<fst::script::WeightClass> *, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("shortestpath", (void (*)(void))__pyx_f_9pywrapfst_shortestpath, "struct __pyx_obj_9pywrapfst_MutableFst *(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_shortestpath *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("statemap", (void (*)(void))__pyx_f_9pywrapfst_statemap, "struct __pyx_obj_9pywrapfst_Fst *(struct __pyx_obj_9pywrapfst_Fst *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("synchronize", (void (*)(void))__pyx_f_9pywrapfst_synchronize, "struct __pyx_obj_9pywrapfst_MutableFst *(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
static int __Pyx_modinit_type_init_code(void) {
__Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
/*--- Type init code ---*/
__pyx_vtabptr_9pywrapfst_Weight = &__pyx_vtable_9pywrapfst_Weight;
__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, 339, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 403, __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, 339, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Weight, (PyObject *)&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 339, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 339, __pyx_L1_error)
+ 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)
__pyx_ptype_9pywrapfst_Weight = &__pyx_type_9pywrapfst_Weight;
- __pyx_vtabptr_9pywrapfst__SymbolTable = &__pyx_vtable_9pywrapfst__SymbolTable;
- __pyx_vtable_9pywrapfst__SymbolTable._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst__SymbolTable *))__pyx_f_9pywrapfst_12_SymbolTable__raw;
- __pyx_vtable_9pywrapfst__SymbolTable._raise_nonexistent = (void (*)(struct __pyx_obj_9pywrapfst__SymbolTable *))__pyx_f_9pywrapfst_12_SymbolTable__raise_nonexistent;
- __pyx_vtable_9pywrapfst__SymbolTable._raw_ptr_or_raise = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst__SymbolTable *))__pyx_f_9pywrapfst_12_SymbolTable__raw_ptr_or_raise;
- __pyx_vtable_9pywrapfst__SymbolTable.available_key = (int64 (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_available_key;
- __pyx_vtable_9pywrapfst__SymbolTable.checksum = (PyObject *(*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_checksum;
- __pyx_vtable_9pywrapfst__SymbolTable.copy = (struct __pyx_obj_9pywrapfst_SymbolTable *(*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_copy;
- __pyx_vtable_9pywrapfst__SymbolTable.get_nth_key = (int64 (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_get_nth_key;
- __pyx_vtable_9pywrapfst__SymbolTable.labeled_checksum = (PyObject *(*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_labeled_checksum;
- __pyx_vtable_9pywrapfst__SymbolTable.member = (bool (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_member;
- __pyx_vtable_9pywrapfst__SymbolTable.name = (std::string (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_name;
- __pyx_vtable_9pywrapfst__SymbolTable.num_symbols = (size_t (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_num_symbols;
- __pyx_vtable_9pywrapfst__SymbolTable.write = (void (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_write;
- __pyx_vtable_9pywrapfst__SymbolTable.write_text = (void (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_write_text;
- __pyx_vtable_9pywrapfst__SymbolTable.write_to_string = (PyObject *(*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_write_to_string;
- if (PyType_Ready(&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 669, __pyx_L1_error)
+ __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._raise_nonexistent = (void (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_15SymbolTableView__raise_nonexistent;
+ __pyx_vtable_9pywrapfst_SymbolTableView._raw_ptr_or_raise = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_15SymbolTableView__raw_ptr_or_raise;
+ __pyx_vtable_9pywrapfst_SymbolTableView.available_key = (int64 (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_available_key;
+ __pyx_vtable_9pywrapfst_SymbolTableView.checksum = (PyObject *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_checksum;
+ __pyx_vtable_9pywrapfst_SymbolTableView.copy = (struct __pyx_obj_9pywrapfst_SymbolTable *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_copy;
+ __pyx_vtable_9pywrapfst_SymbolTableView.get_nth_key = (int64 (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_get_nth_key;
+ __pyx_vtable_9pywrapfst_SymbolTableView.labeled_checksum = (PyObject *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_labeled_checksum;
+ __pyx_vtable_9pywrapfst_SymbolTableView.member = (bool (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_member;
+ __pyx_vtable_9pywrapfst_SymbolTableView.name = (std::string (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_name;
+ __pyx_vtable_9pywrapfst_SymbolTableView.num_symbols = (size_t (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_num_symbols;
+ __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 PY_VERSION_HEX < 0x030800B1
- __pyx_type_9pywrapfst__SymbolTable.tp_print = 0;
+ __pyx_type_9pywrapfst_SymbolTableView.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 ((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__SymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 669, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SymbolTable, (PyObject *)&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 669, __pyx_L1_error)
- __pyx_ptype_9pywrapfst__SymbolTable = &__pyx_type_9pywrapfst__SymbolTable;
+ 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)
+ __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__SymbolTable;
- __pyx_vtable_9pywrapfst__EncodeMapperSymbolTableView.__pyx_base._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst__SymbolTable *))__pyx_f_9pywrapfst_28_EncodeMapperSymbolTableView__raw;
- __pyx_type_9pywrapfst__EncodeMapperSymbolTableView.tp_base = __pyx_ptype_9pywrapfst__SymbolTable;
- if (PyType_Ready(&__pyx_type_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 876, __pyx_L1_error)
+ __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 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, 876, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EncodeMapperSymbolTableView, (PyObject *)&__pyx_type_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 876, __pyx_L1_error)
+ 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)
__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__SymbolTable;
- __pyx_vtable_9pywrapfst__FstSymbolTableView.__pyx_base._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst__SymbolTable *))__pyx_f_9pywrapfst_19_FstSymbolTableView__raw;
- __pyx_type_9pywrapfst__FstSymbolTableView.tp_base = __pyx_ptype_9pywrapfst__SymbolTable;
- if (PyType_Ready(&__pyx_type_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 900, __pyx_L1_error)
+ __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 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, 900, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FstSymbolTableView, (PyObject *)&__pyx_type_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 900, __pyx_L1_error)
+ 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)
__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__SymbolTable;
- __pyx_vtable_9pywrapfst__MutableSymbolTable.__pyx_base._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst__SymbolTable *))__pyx_f_9pywrapfst_19_MutableSymbolTable__raw;
+ __pyx_vtable_9pywrapfst__MutableSymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst_SymbolTableView;
+ __pyx_vtable_9pywrapfst__MutableSymbolTable.__pyx_base._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_19_MutableSymbolTable__raw;
__pyx_vtable_9pywrapfst__MutableSymbolTable._mutable_raw = (fst::SymbolTable *(*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *))__pyx_f_9pywrapfst_19_MutableSymbolTable__mutable_raw;
__pyx_vtable_9pywrapfst__MutableSymbolTable._mutable_raw_ptr_or_raise = (fst::SymbolTable *(*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *))__pyx_f_9pywrapfst_19_MutableSymbolTable__mutable_raw_ptr_or_raise;
__pyx_vtable_9pywrapfst__MutableSymbolTable.add_symbol = (int64 (*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args))__pyx_f_9pywrapfst_19_MutableSymbolTable_add_symbol;
- __pyx_vtable_9pywrapfst__MutableSymbolTable.add_table = (void (*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19_MutableSymbolTable_add_table;
+ __pyx_vtable_9pywrapfst__MutableSymbolTable.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__SymbolTable;
- if (PyType_Ready(&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
+ __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 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, 923, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableSymbolTable, (PyObject *)&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
+ 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)
__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, 994, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1052, __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, 994, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableFstSymbolTableView, (PyObject *)&__pyx_type_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 994, __pyx_L1_error)
+ 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)
__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, 1009, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1067, __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, 1009, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SymbolTable_2, (PyObject *)&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1009, __pyx_L1_error)
+ 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)
__pyx_ptype_9pywrapfst_SymbolTable = &__pyx_type_9pywrapfst_SymbolTable;
- if (PyType_Ready(&__pyx_type_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1203, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1263, __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, 1203, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1203, __pyx_L1_error)
+ 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)
__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.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__SymbolTable *))__pyx_f_9pywrapfst_12EncodeMapper__set_input_symbols;
- __pyx_vtable_9pywrapfst_EncodeMapper._set_output_symbols = (void (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst__SymbolTable *))__pyx_f_9pywrapfst_12EncodeMapper__set_output_symbols;
- if (PyType_Ready(&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1235, __pyx_L1_error)
+ __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 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, 1235, __pyx_L1_error)
+ PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9pywrapfst_EncodeMapper, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1295, __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, 1235, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EncodeMapper, (PyObject *)&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1235, __pyx_L1_error)
+ 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)
__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.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.text = (std::string (*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_text *__pyx_optional_args))__pyx_f_9pywrapfst_3Fst_text;
__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, 1501, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1561, __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, 1501, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Fst, (PyObject *)&__pyx_type_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1501, __pyx_L1_error)
+ 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)
__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._minimize = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__minimize *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__minimize;
__pyx_vtable_9pywrapfst_MutableFst.mutable_arcs = (struct __pyx_obj_9pywrapfst_MutableArcIterator *(*)(struct __pyx_obj_9pywrapfst_MutableFst *, int64, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_10MutableFst_mutable_arcs;
__pyx_vtable_9pywrapfst_MutableFst.num_states = (int64 (*)(struct __pyx_obj_9pywrapfst_MutableFst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_10MutableFst_num_states;
- __pyx_vtable_9pywrapfst_MutableFst._project = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__project *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__project;
+ __pyx_vtable_9pywrapfst_MutableFst._project = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, PyObject *))__pyx_f_9pywrapfst_10MutableFst__project;
__pyx_vtable_9pywrapfst_MutableFst._prune = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__prune *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__prune;
__pyx_vtable_9pywrapfst_MutableFst._push = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__push *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__push;
__pyx_vtable_9pywrapfst_MutableFst._relabel_pairs = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_pairs *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__relabel_pairs;
__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__SymbolTable *))__pyx_f_9pywrapfst_10MutableFst__set_input_symbols;
- __pyx_vtable_9pywrapfst_MutableFst._set_output_symbols = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst__SymbolTable *))__pyx_f_9pywrapfst_10MutableFst__set_output_symbols;
+ __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, 1993, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2026, __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, 1993, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableFst, (PyObject *)&__pyx_type_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 1993, __pyx_L1_error)
+ 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)
__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, 2863, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 2891, __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, 2863, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_VectorFst, (PyObject *)&__pyx_type_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 2863, __pyx_L1_error)
+ 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)
__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, 3039, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3068, __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, 3039, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Arc, (PyObject *)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3039, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3039, __pyx_L1_error)
+ 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)
__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, 3106, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 3135, __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, 3106, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArcIterator, (PyObject *)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 3106, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 3106, __pyx_L1_error)
+ 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)
__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, 3217, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3246, __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, 3217, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableArcIterator, (PyObject *)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3217, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3217, __pyx_L1_error)
+ 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)
__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, 3337, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3366, __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, 3337, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StateIterator, (PyObject *)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3337, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3337, __pyx_L1_error)
+ 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)
__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, 4242, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4275, __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, 4242, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Compiler, (PyObject *)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4242, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4242, __pyx_L1_error)
+ 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)
__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, 4379, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4412, __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, 4379, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FarReader, (PyObject *)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4379, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4379, __pyx_L1_error)
+ 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)
__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, 4525, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4567, __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, 4525, __pyx_L1_error)
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FarWriter, (PyObject *)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4525, __pyx_L1_error)
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4525, __pyx_L1_error)
+ 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)
__pyx_ptype_9pywrapfst_FarWriter = &__pyx_type_9pywrapfst_FarWriter;
- if (PyType_Ready(&__pyx_type_9pywrapfst___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 3237, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_9pywrapfst___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 3266, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_9pywrapfst___pyx_scope_struct____iter__.tp_print = 0;
#endif
}
-#if PY_MAJOR_VERSION < 3
-#ifdef CYTHON_NO_PYINIT_EXPORT
-#define __Pyx_PyMODINIT_FUNC void
-#else
+#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
+#elif PY_MAJOR_VERSION < 3
+#ifdef __cplusplus
+#define __Pyx_PyMODINIT_FUNC extern "C" void
+#else
+#define __Pyx_PyMODINIT_FUNC void
#endif
#else
-#ifdef CYTHON_NO_PYINIT_EXPORT
-#define __Pyx_PyMODINIT_FUNC PyObject *
+#ifdef __cplusplus
+#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
-#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
+#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
- std::string __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
__Pyx_RefNannyDeclarations
#if CYTHON_PEP489_MULTI_PHASE_INIT
if (__pyx_m) {
}
#endif
/*--- Builtin init code ---*/
- if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Constants init code ---*/
- if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global type/function init code ---*/
(void)__Pyx_modinit_global_init_code();
(void)__Pyx_modinit_variable_export_code();
- if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
- if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
+ if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
(void)__Pyx_modinit_type_import_code();
(void)__Pyx_modinit_variable_import_code();
(void)__Pyx_modinit_function_import_code();
* # Python imports.
* import logging # <<<<<<<<<<<<<<
* import numbers
- * import subprocess
+ * 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);
* # Python imports.
* import logging
* 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_GOTREF(__pyx_t_1);
/* "pywrapfst.pyx":101
* import logging
* import numbers
- * import subprocess # <<<<<<<<<<<<<<
- *
- * # TODO(kbg): Used to handle the deprecation of `text`; remove on next release.
+ * 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, 101, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 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_subprocess, __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, 101, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":104
- *
- * # TODO(kbg): Used to handle the deprecation of `text`; remove on next release.
- * import warnings # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":102
+ * import numbers
+ * import os
+ * import subprocess # <<<<<<<<<<<<<<
+ * import sys
*
- * warnings.simplefilter("always", DeprecationWarning)
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_subprocess, 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_warnings, __pyx_t_1) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_subprocess, __pyx_t_1) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":106
- * import warnings
- *
- * warnings.simplefilter("always", DeprecationWarning) # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":103
+ * import os
+ * import subprocess
+ * import sys # <<<<<<<<<<<<<<
*
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_simplefilter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
+
+ /* "pywrapfst.pyx":110
+ * # 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_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_typing, __pyx_t_1) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "pywrapfst.pyx":112
+ * 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)
+
+ /* "pywrapfst.pyx":117
+ * # 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)
+
+ /* "pywrapfst.pyx":119
+ * 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)
+
+ /* "pywrapfst.pyx":121
+ * 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)
+
+ /* "pywrapfst.pyx":122
+ * "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)
+
+ /* "pywrapfst.pyx":128
+ * "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)
+
+ /* "pywrapfst.pyx":129
+ * ]"""
+ * 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)
+
+ /* "pywrapfst.pyx":131
+ * 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)
+
+ /* "pywrapfst.pyx":132
+ * "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)
+
+ /* "pywrapfst.pyx":133
+ * 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)
+
+ /* "pywrapfst.pyx":134
+ * 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)
+
+ /* "pywrapfst.pyx":136
+ * 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)
+
+ /* "pywrapfst.pyx":141
*
*
* class FstError(Exception): # <<<<<<<<<<<<<<
*
* pass
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __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, 112, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstError, __pyx_n_s_FstError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __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, 141, __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, 112, __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, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstError, __pyx_t_4) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstError, __pyx_t_4) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":117
+ /* "pywrapfst.pyx":146
*
*
* class FstArgError(FstError, ValueError): # <<<<<<<<<<<<<<
*
* pass
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_builtin_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, 117, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstArgError, __pyx_n_s_FstArgError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __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, 146, __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, 117, __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, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstArgError, __pyx_t_4) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstArgError, __pyx_t_4) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":122
+ /* "pywrapfst.pyx":151
*
*
* class FstBadWeightError(FstError, ValueError): # <<<<<<<<<<<<<<
*
* pass
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_builtin_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, 122, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstBadWeightError, __pyx_n_s_FstBadWeightError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __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, 151, __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, 122, __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, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstBadWeightError, __pyx_t_4) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstBadWeightError, __pyx_t_4) < 0) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":127
+ /* "pywrapfst.pyx":156
*
*
- * class FstDeletedConstructorError(FstError, RuntimeError): # <<<<<<<<<<<<<<
+ * class FstIndexError(FstError, IndexError): # <<<<<<<<<<<<<<
*
* pass
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __Pyx_INCREF(__pyx_builtin_RuntimeError);
- __Pyx_GIVEREF(__pyx_builtin_RuntimeError);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_RuntimeError);
+ __Pyx_INCREF(__pyx_builtin_IndexError);
+ __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, 127, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstDeletedConstructorError, __pyx_n_s_FstDeletedConstructorError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __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, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstDeletedConstructorError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __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, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstDeletedConstructorError, __pyx_t_4) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIndexError, __pyx_t_4) < 0) __PYX_ERR(0, 156, __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":132
+ /* "pywrapfst.pyx":161
*
*
- * class FstIndexError(FstError, IndexError): # <<<<<<<<<<<<<<
+ * class FstIOError(FstError, IOError): # <<<<<<<<<<<<<<
*
* pass
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_INCREF(__pyx_builtin_IndexError);
- __Pyx_GIVEREF(__pyx_builtin_IndexError);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_IndexError);
+ __Pyx_INCREF(__pyx_builtin_IOError);
+ __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, 132, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstIndexError, __pyx_n_s_FstIndexError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __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, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstIndexError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __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, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIndexError, __pyx_t_4) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIOError, __pyx_t_4) < 0) __PYX_ERR(0, 161, __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":137
+ /* "pywrapfst.pyx":166
*
*
- * class FstIOError(FstError, IOError): # <<<<<<<<<<<<<<
+ * class FstOpError(FstError, RuntimeError): # <<<<<<<<<<<<<<
*
* pass
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __Pyx_INCREF(__pyx_builtin_IOError);
- __Pyx_GIVEREF(__pyx_builtin_IOError);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_IOError);
+ __Pyx_INCREF(__pyx_builtin_RuntimeError);
+ __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, 137, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstIOError, __pyx_n_s_FstIOError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __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, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstIOError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __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, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIOError, __pyx_t_4) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstOpError, __pyx_t_4) < 0) __PYX_ERR(0, 166, __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":142
- *
- *
- * class FstOpError(FstError, RuntimeError): # <<<<<<<<<<<<<<
- *
- * pass
- */
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_INCREF(__pyx_builtin_RuntimeError);
- __Pyx_GIVEREF(__pyx_builtin_RuntimeError);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_RuntimeError);
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstOpError, __pyx_n_s_FstOpError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstOpError, __pyx_t_1, __pyx_t_3, NULL, 0, 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_FstOpError, __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":397
+ /* "pywrapfst.pyx":460
*
* @classmethod
* def Zero(cls, weight_type): # <<<<<<<<<<<<<<
* """
* Weight.Zero(weight_type)
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_Zero); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
+ __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_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":396
+ /* "pywrapfst.pyx":459
* # C++ part out-of-class and then call it from within.
*
* @classmethod # <<<<<<<<<<<<<<
* def Zero(cls, weight_type):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_Zero, __pyx_t_2) < 0) __PYX_ERR(0, 397, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __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)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Weight);
- /* "pywrapfst.pyx":406
+ /* "pywrapfst.pyx":469
*
* @classmethod
* def One(cls, weight_type): # <<<<<<<<<<<<<<
* """
* Weight.One(weight_type)
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_One); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __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_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":405
+ /* "pywrapfst.pyx":468
* return _Zero(weight_type)
*
* @classmethod # <<<<<<<<<<<<<<
* def One(cls, weight_type):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_One, __pyx_t_1) < 0) __PYX_ERR(0, 406, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Weight);
- /* "pywrapfst.pyx":415
+ /* "pywrapfst.pyx":478
*
* @classmethod
* def NoWeight(cls, weight_type): # <<<<<<<<<<<<<<
* """
* Weight.NoWeight(weight_type)
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_NoWeight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
+ __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_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":414
+ /* "pywrapfst.pyx":477
* return _One(weight_type)
*
* @classmethod # <<<<<<<<<<<<<<
* def NoWeight(cls, weight_type):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_NoWeight, __pyx_t_2) < 0) __PYX_ERR(0, 415, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __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)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Weight);
- /* "pywrapfst.pyx":450
+ /* "pywrapfst.pyx":513
*
*
* def plus(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* plus(lhs, rhs)
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_1plus, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_plus, __pyx_t_2) < 0) __PYX_ERR(0, 450, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_plus, __pyx_t_1) < 0) __PYX_ERR(0, 513, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":482
+ /* "pywrapfst.pyx":545
*
*
* def times(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* times(lhs, rhs)
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_3times, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_times, __pyx_t_2) < 0) __PYX_ERR(0, 482, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_times, __pyx_t_1) < 0) __PYX_ERR(0, 545, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":514
+ /* "pywrapfst.pyx":577
*
*
* def divide(Weight lhs, Weight rhs): # <<<<<<<<<<<<<<
* """
* divide(lhs, rhs)
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_5divide, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_divide, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_divide, __pyx_t_1) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":547
+ /* "pywrapfst.pyx":610
*
*
* def power(Weight w, size_t n): # <<<<<<<<<<<<<<
* """
* power(lhs, rhs)
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_7power, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_power, __pyx_t_2) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_power, __pyx_t_1) < 0) __PYX_ERR(0, 610, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "pywrapfst.pyx":952
+ /* "pywrapfst.pyx":1009
* return mutable_raw
*
* cpdef int64 add_symbol(self, symbol, int64 key=fst.kNoSymbol) except *: # <<<<<<<<<<<<<<
* """
* add_symbol(self, symbol, key=NO_SYMBOL)
*/
- __pyx_k__3 = fst::kNoSymbol;
- __pyx_k__3 = fst::kNoSymbol;
+ __pyx_k__6 = fst::kNoSymbol;
+ __pyx_k__6 = fst::kNoSymbol;
- /* "pywrapfst.pyx":1036
+ /* "pywrapfst.pyx":1094
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
* """
* SymbolTable.read(source)
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1036, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __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_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":1035
+ /* "pywrapfst.pyx":1093
* return self._smart_table.get()
*
* @classmethod # <<<<<<<<<<<<<<
* def read(cls, source):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read, __pyx_t_1) < 0) __PYX_ERR(0, 1036, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1093, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":1057
+ /* "pywrapfst.pyx":1115
*
* @classmethod
* def read_text(cls, source, bool allow_negative_labels=False): # <<<<<<<<<<<<<<
* """
* SymbolTable.read_text(source)
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
+ __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_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":1056
- * return _init_SymbolTable(move(syms))
+ /* "pywrapfst.pyx":1114
+ * return _init_SymbolTable(move(_symbols))
*
* @classmethod # <<<<<<<<<<<<<<
* def read_text(cls, source, bool allow_negative_labels=False):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1056, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_text, __pyx_t_2) < 0) __PYX_ERR(0, 1057, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __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)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":1082
+ /* "pywrapfst.pyx":1141
*
* @classmethod
* def read_fst(cls, source, bool input_table): # <<<<<<<<<<<<<<
* """
* SymbolTable.read_fst(source, input_table)
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_fst); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __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_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":1081
- * return _init_SymbolTable(move(syms))
+ /* "pywrapfst.pyx":1140
+ * return _init_SymbolTable(move(_symbols))
*
* @classmethod # <<<<<<<<<<<<<<
* def read_fst(cls, source, bool input_table):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_fst, __pyx_t_1) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1140, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
- /* "pywrapfst.pyx":1337
+ /* "pywrapfst.pyx":1397
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
* """
* EncodeMapper.read(source)
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
+ __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_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":1336
+ /* "pywrapfst.pyx":1396
* return self._mapper.get().Properties(mask)
*
* @classmethod # <<<<<<<<<<<<<<
* def read(cls, source):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1336, __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, __pyx_t_2) < 0) __PYX_ERR(0, 1337, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); 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;
+ 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)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_EncodeMapper);
- /* "pywrapfst.pyx":1359
+ /* "pywrapfst.pyx":1419
*
* @staticmethod
* def read_from_string(state): # <<<<<<<<<<<<<<
* """
* read_from_string(state)
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_12EncodeMapper_19read_from_string, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper->tp_dict, __pyx_n_s_read_from_string, __pyx_t_2) < 0) __PYX_ERR(0, 1359, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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_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)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_EncodeMapper);
- /* "pywrapfst.pyx":1358
- * return _init_EncodeMapper(mapper.release())
+ /* "pywrapfst.pyx":1418
+ * return _init_EncodeMapper(_mapper.release())
*
* @staticmethod # <<<<<<<<<<<<<<
* def read_from_string(state):
* """
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_n_s_read_from_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __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, 1419, __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_from_string, __pyx_t_1) < 0) __PYX_ERR(0, 1359, __pyx_L1_error)
+ __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_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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_EncodeMapper);
- /* "pywrapfst.pyx":1844
+ /* "pywrapfst.pyx":1915
*
* @classmethod
* def read(cls, source): # <<<<<<<<<<<<<<
* """
* read(source)
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_Fst, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
+ __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_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":1843
+ /* "pywrapfst.pyx":1914
* return self._fst.get().Properties(mask, test)
*
* @classmethod # <<<<<<<<<<<<<<
* def read(cls, source):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1843, __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, __pyx_t_2) < 0) __PYX_ERR(0, 1844, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); 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;
+ 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)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Fst);
- /* "pywrapfst.pyx":1862
+ /* "pywrapfst.pyx":1933
*
* @classmethod
* def read_from_string(cls, state): # <<<<<<<<<<<<<<
* """
* read_from_string(state)
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_Fst, __pyx_n_s_read_from_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1862, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __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_GOTREF(__pyx_t_1);
- /* "pywrapfst.pyx":1861
+ /* "pywrapfst.pyx":1932
* return _read_Fst(source)
*
* @classmethod # <<<<<<<<<<<<<<
* def read_from_string(cls, state):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1861, __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_from_string, __pyx_t_1) < 0) __PYX_ERR(0, 1862, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1932, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_Fst);
- /* "pywrapfst.pyx":2273
+ /* "pywrapfst.pyx":2306
*
* cdef void _minimize(self,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
* bool allow_nondet=False) except *:
* # This runs in-place when the second argument is null.
*/
- __pyx_k__10 = fst::kShortestDelta;
+ __pyx_k__12 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2279
+ /* "pywrapfst.pyx":2312
* self._check_mutating_imethod()
*
* def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False): # <<<<<<<<<<<<<<
* """
* minimize(self, delta=1e-6, allow_nondet=False)
*/
- __pyx_k__11 = fst::kShortestDelta;
+ __pyx_k__13 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2375
+ /* "pywrapfst.pyx":2407
*
* cdef void _prune(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
* weight=None) except *:
*/
- __pyx_k__12 = fst::kDelta;
+ __pyx_k__14 = fst::kDelta;
- /* "pywrapfst.pyx":2376
+ /* "pywrapfst.pyx":2408
* cdef void _prune(self,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* weight=None) except *:
* # Threshold is set to semiring Zero (no pruning) if no weight is specified.
*/
- __pyx_k__13 = fst::kNoStateId;
+ __pyx_k__15 = fst::kNoStateId;
- /* "pywrapfst.pyx":2385
+ /* "pywrapfst.pyx":2417
*
* def prune(self,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
* weight=None):
*/
- __pyx_k__14 = fst::kDelta;
+ __pyx_k__16 = fst::kDelta;
- /* "pywrapfst.pyx":2386
+ /* "pywrapfst.pyx":2418
* def prune(self,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* weight=None):
* """
*/
- __pyx_k__15 = fst::kNoStateId;
+ __pyx_k__17 = fst::kNoStateId;
- /* "pywrapfst.pyx":2411
+ /* "pywrapfst.pyx":2443
*
* cdef void _push(self,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
* bool remove_total_weight=False,
* bool to_final=False):
*/
- __pyx_k__16 = fst::kShortestDelta;
+ __pyx_k__18 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2418
+ /* "pywrapfst.pyx":2452
*
* def push(self,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
* bool remove_total_weight=False,
* bool to_final=False):
*/
- __pyx_k__17 = fst::kShortestDelta;
+ __pyx_k__19 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2656
+ /* "pywrapfst.pyx":2683
* bool connect=True,
* weight=None,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* float delta=fst.kShortestDelta) except *:
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(self.weight_type(),
*/
- __pyx_k__18 = fst::kNoStateId;
+ __pyx_k__20 = fst::kNoStateId;
- /* "pywrapfst.pyx":2657
+ /* "pywrapfst.pyx":2684
* weight=None,
* int64 nstate=fst.kNoStateId,
* float delta=fst.kShortestDelta) except *: # <<<<<<<<<<<<<<
- * cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
- * weight)
+ * cdef fst.WeightClass _weight = _get_WeightClass_or_Zero(self.weight_type(),
+ * weight)
*/
- __pyx_k__19 = fst::kShortestDelta;
+ __pyx_k__21 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2673
+ /* "pywrapfst.pyx":2701
* bool connect=True,
* weight=None,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* float delta=fst.kShortestDelta):
* """
*/
- __pyx_k__20 = fst::kNoStateId;
+ __pyx_k__22 = fst::kNoStateId;
- /* "pywrapfst.pyx":2674
+ /* "pywrapfst.pyx":2702
* weight=None,
* int64 nstate=fst.kNoStateId,
* float delta=fst.kShortestDelta): # <<<<<<<<<<<<<<
* """
* rmepsilon(self, queue_type="auto", connect=True, weight=None,
*/
- __pyx_k__21 = fst::kShortestDelta;
+ __pyx_k__23 = fst::kShortestDelta;
- /* "pywrapfst.pyx":2948
+ /* "pywrapfst.pyx":2977
*
*
* NO_LABEL = fst.kNoLabel # <<<<<<<<<<<<<<
* NO_STATE_ID = fst.kNoStateId
* NO_SYMBOL = fst.kNoSymbol
*/
- __pyx_t_1 = __Pyx_PyInt_From_int(fst::kNoLabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2948, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_LABEL, __pyx_t_1) < 0) __PYX_ERR(0, 2948, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_int(fst::kNoLabel); 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_LABEL, __pyx_t_2) < 0) __PYX_ERR(0, 2977, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2949
+ /* "pywrapfst.pyx":2978
*
* NO_LABEL = fst.kNoLabel
* NO_STATE_ID = fst.kNoStateId # <<<<<<<<<<<<<<
* NO_SYMBOL = fst.kNoSymbol
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2949, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_STATE_ID, __pyx_t_1) < 0) __PYX_ERR(0, 2949, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_int(fst::kNoStateId); 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_STATE_ID, __pyx_t_2) < 0) __PYX_ERR(0, 2978, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2950
+ /* "pywrapfst.pyx":2979
* NO_LABEL = fst.kNoLabel
* NO_STATE_ID = fst.kNoStateId
* NO_SYMBOL = fst.kNoSymbol # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_int64_t(fst::kNoSymbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2950, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_SYMBOL, __pyx_t_1) < 0) __PYX_ERR(0, 2950, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_int64_t(fst::kNoSymbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2979, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2956
+ /* "pywrapfst.pyx":2985
*
*
* EXPANDED = fst.kExpanded # <<<<<<<<<<<<<<
* MUTABLE = fst.kMutable
* ERROR = fst.kError
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2956, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXPANDED, __pyx_t_1) < 0) __PYX_ERR(0, 2956, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2985, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":2957
+ /* "pywrapfst.pyx":2986
*
* EXPANDED = fst.kExpanded
* MUTABLE = fst.kMutable # <<<<<<<<<<<<<<
* ERROR = fst.kError
* ACCEPTOR = fst.kAcceptor
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2957, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_MUTABLE, __pyx_t_1) < 0) __PYX_ERR(0, 2957, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2958
+ /* "pywrapfst.pyx":2987
* EXPANDED = fst.kExpanded
* MUTABLE = fst.kMutable
* ERROR = fst.kError # <<<<<<<<<<<<<<
* ACCEPTOR = fst.kAcceptor
* NOT_ACCEPTOR = fst.kNotAcceptor
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2958, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_1) < 0) __PYX_ERR(0, 2958, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2959
+ /* "pywrapfst.pyx":2988
* MUTABLE = fst.kMutable
* ERROR = fst.kError
* ACCEPTOR = fst.kAcceptor # <<<<<<<<<<<<<<
* NOT_ACCEPTOR = fst.kNotAcceptor
* I_DETERMINISTIC = fst.kIDeterministic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2959, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCEPTOR, __pyx_t_1) < 0) __PYX_ERR(0, 2959, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2960
+ /* "pywrapfst.pyx":2989
* ERROR = fst.kError
* ACCEPTOR = fst.kAcceptor
* NOT_ACCEPTOR = fst.kNotAcceptor # <<<<<<<<<<<<<<
* I_DETERMINISTIC = fst.kIDeterministic
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2960, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_1) < 0) __PYX_ERR(0, 2960, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2961
+ /* "pywrapfst.pyx":2990
* ACCEPTOR = fst.kAcceptor
* NOT_ACCEPTOR = fst.kNotAcceptor
* I_DETERMINISTIC = fst.kIDeterministic # <<<<<<<<<<<<<<
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
* O_DETERMINISTIC = fst.kODeterministic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2961, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2961, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2962
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2962, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2962, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2963
+ /* "pywrapfst.pyx":2992
* I_DETERMINISTIC = fst.kIDeterministic
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
* O_DETERMINISTIC = fst.kODeterministic # <<<<<<<<<<<<<<
* NON_O_DETERMINISTIC = fst.kNonODeterministic
* EPSILONS = fst.kEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2963, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2963, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2964
+ /* "pywrapfst.pyx":2993
* NON_I_DETERMINISTIC = fst.kNonIDeterministic
* O_DETERMINISTIC = fst.kODeterministic
* NON_O_DETERMINISTIC = fst.kNonODeterministic # <<<<<<<<<<<<<<
* EPSILONS = fst.kEpsilons
* NO_EPSILONS = fst.kNoEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2964, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2964, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2965
+ /* "pywrapfst.pyx":2994
* O_DETERMINISTIC = fst.kODeterministic
* NON_O_DETERMINISTIC = fst.kNonODeterministic
* EPSILONS = fst.kEpsilons # <<<<<<<<<<<<<<
* NO_EPSILONS = fst.kNoEpsilons
* I_EPSILONS = fst.kIEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2965, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2965, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2966
+ /* "pywrapfst.pyx":2995
* NON_O_DETERMINISTIC = fst.kNonODeterministic
* EPSILONS = fst.kEpsilons
* NO_EPSILONS = fst.kNoEpsilons # <<<<<<<<<<<<<<
* I_EPSILONS = fst.kIEpsilons
* NO_I_EPSILONS = fst.kNoIEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2966, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2966, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2967
+ /* "pywrapfst.pyx":2996
* EPSILONS = fst.kEpsilons
* NO_EPSILONS = fst.kNoEpsilons
* I_EPSILONS = fst.kIEpsilons # <<<<<<<<<<<<<<
* NO_I_EPSILONS = fst.kNoIEpsilons
* O_EPSILONS = fst.kOEpsilons
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2967, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2967, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2968
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2968, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_I_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2968, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2969
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2969, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2969, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2970
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2970, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_O_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2970, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2971
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2971, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2971, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2972
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2972, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2972, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2973
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2973, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2973, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2974
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2974, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2974, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2975
+ /* "pywrapfst.pyx":3004
* O_LABEL_SORTED = fst.kOLabelSorted
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
* WEIGHTED = fst.kWeighted # <<<<<<<<<<<<<<
* UNWEIGHTED = fst.kUnweighted
* CYCLIC = fst.kCyclic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2975, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED, __pyx_t_1) < 0) __PYX_ERR(0, 2975, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2976
+ /* "pywrapfst.pyx":3005
* NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
* WEIGHTED = fst.kWeighted
* UNWEIGHTED = fst.kUnweighted # <<<<<<<<<<<<<<
* CYCLIC = fst.kCyclic
* ACYCLIC = fst.kAcyclic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2976, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED, __pyx_t_1) < 0) __PYX_ERR(0, 2976, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2977
+ /* "pywrapfst.pyx":3006
* WEIGHTED = fst.kWeighted
* UNWEIGHTED = fst.kUnweighted
* CYCLIC = fst.kCyclic # <<<<<<<<<<<<<<
* ACYCLIC = fst.kAcyclic
* INITIAL_CYCLIC = fst.kInitialCyclic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2977, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_CYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2977, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2978
+ /* "pywrapfst.pyx":3007
* UNWEIGHTED = fst.kUnweighted
* CYCLIC = fst.kCyclic
* ACYCLIC = fst.kAcyclic # <<<<<<<<<<<<<<
* INITIAL_CYCLIC = fst.kInitialCyclic
* INITIAL_ACYCLIC = fst.kInitialAcyclic
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2978, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2978, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2979
+ /* "pywrapfst.pyx":3008
* CYCLIC = fst.kCyclic
* ACYCLIC = fst.kAcyclic
* INITIAL_CYCLIC = fst.kInitialCyclic # <<<<<<<<<<<<<<
* INITIAL_ACYCLIC = fst.kInitialAcyclic
* TOP_SORTED = fst.kTopSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2979, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2979, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2980
+ /* "pywrapfst.pyx":3009
* ACYCLIC = fst.kAcyclic
* INITIAL_CYCLIC = fst.kInitialCyclic
* INITIAL_ACYCLIC = fst.kInitialAcyclic # <<<<<<<<<<<<<<
* TOP_SORTED = fst.kTopSorted
* NOT_TOP_SORTED = fst.kNotTopSorted
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2980, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2980, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2981
+ /* "pywrapfst.pyx":3010
* INITIAL_CYCLIC = fst.kInitialCyclic
* INITIAL_ACYCLIC = fst.kInitialAcyclic
* TOP_SORTED = fst.kTopSorted # <<<<<<<<<<<<<<
* NOT_TOP_SORTED = fst.kNotTopSorted
* ACCESSIBLE = fst.kAccessible
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2981, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOP_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2981, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2982
+ /* "pywrapfst.pyx":3011
* INITIAL_ACYCLIC = fst.kInitialAcyclic
* TOP_SORTED = fst.kTopSorted
* NOT_TOP_SORTED = fst.kNotTopSorted # <<<<<<<<<<<<<<
* ACCESSIBLE = fst.kAccessible
* NOT_ACCESSIBLE = fst.kNotAccessible
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2982, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2982, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2983
+ /* "pywrapfst.pyx":3012
* TOP_SORTED = fst.kTopSorted
* NOT_TOP_SORTED = fst.kNotTopSorted
* ACCESSIBLE = fst.kAccessible # <<<<<<<<<<<<<<
* NOT_ACCESSIBLE = fst.kNotAccessible
* COACCESSIBLE = fst.kCoAccessible
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2983, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2983, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2984
+ /* "pywrapfst.pyx":3013
* NOT_TOP_SORTED = fst.kNotTopSorted
* ACCESSIBLE = fst.kAccessible
* NOT_ACCESSIBLE = fst.kNotAccessible # <<<<<<<<<<<<<<
* COACCESSIBLE = fst.kCoAccessible
* NOT_COACCESSIBLE = fst.kNotCoAccessible
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2984, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2984, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2985
+ /* "pywrapfst.pyx":3014
* ACCESSIBLE = fst.kAccessible
* NOT_ACCESSIBLE = fst.kNotAccessible
* COACCESSIBLE = fst.kCoAccessible # <<<<<<<<<<<<<<
* NOT_COACCESSIBLE = fst.kNotCoAccessible
* STRING = fst.kString
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2985, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2985, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2986
+ /* "pywrapfst.pyx":3015
* NOT_ACCESSIBLE = fst.kNotAccessible
* COACCESSIBLE = fst.kCoAccessible
* NOT_COACCESSIBLE = fst.kNotCoAccessible # <<<<<<<<<<<<<<
* STRING = fst.kString
* NOT_STRING = fst.kNotString
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2986, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2986, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2987
+ /* "pywrapfst.pyx":3016
* COACCESSIBLE = fst.kCoAccessible
* NOT_COACCESSIBLE = fst.kNotCoAccessible
* STRING = fst.kString # <<<<<<<<<<<<<<
* NOT_STRING = fst.kNotString
* WEIGHTED_CYCLES = fst.kWeightedCycles
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2987, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_1) < 0) __PYX_ERR(0, 2987, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2988
+ /* "pywrapfst.pyx":3017
* NOT_COACCESSIBLE = fst.kNotCoAccessible
* STRING = fst.kString
* NOT_STRING = fst.kNotString # <<<<<<<<<<<<<<
* WEIGHTED_CYCLES = fst.kWeightedCycles
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2988, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_STRING, __pyx_t_1) < 0) __PYX_ERR(0, 2988, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2989
+ /* "pywrapfst.pyx":3018
* STRING = fst.kString
* NOT_STRING = fst.kNotString
* WEIGHTED_CYCLES = fst.kWeightedCycles # <<<<<<<<<<<<<<
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
* NULL_PROPERTIES = fst.kNullProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2989, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_1) < 0) __PYX_ERR(0, 2989, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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":2990
+ /* "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_1 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2990, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_1) < 0) __PYX_ERR(0, 2990, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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":2991
+ /* "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_1 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2991, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2991, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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":2992
+ /* "pywrapfst.pyx":3021
* UNWEIGHTED_CYCLES = fst.kUnweightedCycles
* NULL_PROPERTIES = fst.kNullProperties
* COPY_PROPERTIES = fst.kCopyProperties # <<<<<<<<<<<<<<
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2992, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COPY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2992, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2993
+ /* "pywrapfst.pyx":3022
* NULL_PROPERTIES = fst.kNullProperties
* COPY_PROPERTIES = fst.kCopyProperties
* INTRINSIC_PROPERTIES = fst.kIntrinsicProperties # <<<<<<<<<<<<<<
* EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
* SET_START_PROPERTIES = fst.kSetStartProperties
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2993, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2993, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2994
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2994, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2994, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2995
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2995, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2995, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2996
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2996, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2996, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2997
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2997, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2997, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2998
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2998, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":2999
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2999, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2999, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3000
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3000, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3000, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3001
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3001, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3001, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3002
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3002, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3002, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3003
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3003, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3003, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3004
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3004, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3004, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3005
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3005, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3005, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3006
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3006, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3006, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3007
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3007, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3007, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3008
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3008, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3008, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3009
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3009, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3009, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3010
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3010, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3010, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3011
+ /* "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
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3011, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3011, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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;
- /* "pywrapfst.pyx":3012
+ /* "pywrapfst.pyx":3041
* TRINARY_PROPERTIES = fst.kTrinaryProperties
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties # <<<<<<<<<<<<<<
* FST_PROPERTIES = fst.kFstProperties
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3012, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3012, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3013
+ /* "pywrapfst.pyx":3042
* POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
* NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
* FST_PROPERTIES = fst.kFstProperties # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3013, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_FST_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 3013, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3019
+ /* "pywrapfst.pyx":3048
*
*
* ARC_I_LABEL_VALUE = fst.kArcILabelValue # <<<<<<<<<<<<<<
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(fst::kArcILabelValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3019, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_I_LABEL_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 3019, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcILabelValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3048, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3020
+ /* "pywrapfst.pyx":3049
*
* ARC_I_LABEL_VALUE = fst.kArcILabelValue
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue # <<<<<<<<<<<<<<
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(fst::kArcOLabelValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3020, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_O_LABEL_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 3020, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcOLabelValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3049, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3021
+ /* "pywrapfst.pyx":3050
* ARC_I_LABEL_VALUE = fst.kArcILabelValue
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue
* ARC_WEIGHT_VALUE = fst.kArcWeightValue # <<<<<<<<<<<<<<
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
* ARC_NO_CACHE = fst.kArcNoCache
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(fst::kArcWeightValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3021, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_WEIGHT_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 3021, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcWeightValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3050, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3022
+ /* "pywrapfst.pyx":3051
* ARC_O_LABEL_VALUE = fst.kArcOLabelValue
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue # <<<<<<<<<<<<<<
* ARC_NO_CACHE = fst.kArcNoCache
* ARC_VALUE_FLAGS = fst.kArcValueFlags
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(fst::kArcNextStateValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3022, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NEXT_STATE_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 3022, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcNextStateValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3051, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3023
+ /* "pywrapfst.pyx":3052
* ARC_WEIGHT_VALUE = fst.kArcWeightValue
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
* ARC_NO_CACHE = fst.kArcNoCache # <<<<<<<<<<<<<<
* ARC_VALUE_FLAGS = fst.kArcValueFlags
* ARC_FLAGS = fst.kArcFlags
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(fst::kArcNoCache); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3023, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NO_CACHE, __pyx_t_1) < 0) __PYX_ERR(0, 3023, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcNoCache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3052, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3024
+ /* "pywrapfst.pyx":3053
* ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
* ARC_NO_CACHE = fst.kArcNoCache
* ARC_VALUE_FLAGS = fst.kArcValueFlags # <<<<<<<<<<<<<<
* ARC_FLAGS = fst.kArcFlags
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(fst::kArcValueFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3024, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_VALUE_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 3024, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcValueFlags); 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_VALUE_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3053, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3025
+ /* "pywrapfst.pyx":3054
* ARC_NO_CACHE = fst.kArcNoCache
* ARC_VALUE_FLAGS = fst.kArcValueFlags
* ARC_FLAGS = fst.kArcFlags # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(fst::kArcFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3025, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 3025, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcFlags); 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_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3054, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3031
+ /* "pywrapfst.pyx":3060
*
*
* ENCODE_LABELS = fst.kEncodeLabels # <<<<<<<<<<<<<<
* ENCODE_WEIGHTS = fst.kEncodeWeights
* ENCODE_FLAGS = fst.kEncodeFlags
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(fst::kEncodeLabels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3031, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_LABELS, __pyx_t_1) < 0) __PYX_ERR(0, 3031, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kEncodeLabels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3060, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3032
+ /* "pywrapfst.pyx":3061
*
* ENCODE_LABELS = fst.kEncodeLabels
* ENCODE_WEIGHTS = fst.kEncodeWeights # <<<<<<<<<<<<<<
* ENCODE_FLAGS = fst.kEncodeFlags
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(fst::kEncodeWeights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3032, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_WEIGHTS, __pyx_t_1) < 0) __PYX_ERR(0, 3032, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kEncodeWeights); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3061, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3033
+ /* "pywrapfst.pyx":3062
* ENCODE_LABELS = fst.kEncodeLabels
* ENCODE_WEIGHTS = fst.kEncodeWeights
* ENCODE_FLAGS = fst.kEncodeFlags # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_uint8_t(fst::kEncodeFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3033, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 3033, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kEncodeFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3062, __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)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":3405
+ /* "pywrapfst.pyx":3434
*
* cdef Fst _map(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
- * map_type=b"identity",
+ * map_type="identity",
* double power=1.,
*/
- __pyx_k__30 = fst::kDelta;
+ __pyx_k__32 = fst::kDelta;
- /* "pywrapfst.pyx":3421
+ /* "pywrapfst.pyx":3450
*
* cpdef Fst arcmap(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
- * map_type=b"identity",
+ * map_type="identity",
* double power=1.,
*/
- __pyx_k__31 = fst::kDelta;
+ __pyx_k__33 = fst::kDelta;
- /* "pywrapfst.pyx":3420
+ /* "pywrapfst.pyx":3449
*
*
* cpdef Fst arcmap(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
- * map_type=b"identity",
+ * map_type="identity",
*/
- __pyx_k__31 = fst::kDelta;
+ __pyx_k__33 = fst::kDelta;
- /* "pywrapfst.pyx":3531
+ /* "pywrapfst.pyx":3559
*
* cpdef MutableFst determinize(Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
- * det_type=b"functional",
+ * det_type="functional",
* int64 nstate=fst.kNoStateId,
*/
- __pyx_k__32 = fst::kShortestDelta;
+ __pyx_k__34 = fst::kShortestDelta;
- /* "pywrapfst.pyx":3533
+ /* "pywrapfst.pyx":3561
* float delta=fst.kShortestDelta,
- * det_type=b"functional",
+ * det_type="functional",
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* int64 subsequential_label=0,
* weight=None,
*/
- __pyx_k__33 = fst::kNoStateId;
+ __pyx_k__35 = fst::kNoStateId;
- /* "pywrapfst.pyx":3531
+ /* "pywrapfst.pyx":3559
*
* cpdef MutableFst determinize(Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
- * det_type=b"functional",
+ * det_type="functional",
* int64 nstate=fst.kNoStateId,
*/
- __pyx_k__32 = fst::kShortestDelta;
+ __pyx_k__34 = fst::kShortestDelta;
- /* "pywrapfst.pyx":3533
+ /* "pywrapfst.pyx":3561
* float delta=fst.kShortestDelta,
- * det_type=b"functional",
+ * det_type="functional",
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* int64 subsequential_label=0,
* weight=None,
*/
- __pyx_k__33 = fst::kNoStateId;
+ __pyx_k__35 = fst::kNoStateId;
- /* "pywrapfst.pyx":3627
+ /* "pywrapfst.pyx":3658
*
* cpdef MutableFst disambiguate(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
*/
- __pyx_k__34 = fst::kDelta;
+ __pyx_k__36 = fst::kDelta;
- /* "pywrapfst.pyx":3628
+ /* "pywrapfst.pyx":3659
* cpdef MutableFst disambiguate(Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* int64 subsequential_label=0,
* weight=None):
*/
- __pyx_k__35 = fst::kNoStateId;
+ __pyx_k__37 = fst::kNoStateId;
- /* "pywrapfst.pyx":3627
+ /* "pywrapfst.pyx":3658
*
* cpdef MutableFst disambiguate(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
* int64 subsequential_label=0,
*/
- __pyx_k__34 = fst::kDelta;
+ __pyx_k__36 = fst::kDelta;
- /* "pywrapfst.pyx":3628
+ /* "pywrapfst.pyx":3659
* cpdef MutableFst disambiguate(Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* int64 subsequential_label=0,
* weight=None):
*/
- __pyx_k__35 = fst::kNoStateId;
+ __pyx_k__37 = fst::kNoStateId;
- /* "pywrapfst.pyx":3697
+ /* "pywrapfst.pyx":3729
*
*
* cpdef bool equal(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
* """
* equal(ifst1, ifst2, delta=0.0009765625)
*/
- __pyx_k__36 = fst::kDelta;
- __pyx_k__36 = fst::kDelta;
+ __pyx_k__38 = fst::kDelta;
+ __pyx_k__38 = fst::kDelta;
- /* "pywrapfst.pyx":3718
+ /* "pywrapfst.pyx":3750
*
*
* cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
* """
* equivalent(ifst1, ifst2, delta=0.0009765625)
*/
- __pyx_k__37 = fst::kDelta;
- __pyx_k__37 = fst::kDelta;
+ __pyx_k__39 = fst::kDelta;
+ __pyx_k__39 = fst::kDelta;
- /* "pywrapfst.pyx":3774
+ /* "pywrapfst.pyx":3806
*
*
* cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=fst.kDelta): # <<<<<<<<<<<<<<
* """
* isomorphic(ifst1, ifst2, delta=0.0009765625)
*/
- __pyx_k__38 = fst::kDelta;
- __pyx_k__38 = fst::kDelta;
+ __pyx_k__40 = fst::kDelta;
+ __pyx_k__40 = fst::kDelta;
- /* "pywrapfst.pyx":3799
+ /* "pywrapfst.pyx":3831
*
* cpdef MutableFst prune(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
* weight=None):
*/
- __pyx_k__39 = fst::kDelta;
+ __pyx_k__41 = fst::kDelta;
- /* "pywrapfst.pyx":3800
+ /* "pywrapfst.pyx":3832
* cpdef MutableFst prune(Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* weight=None):
* """
*/
- __pyx_k__40 = fst::kNoStateId;
+ __pyx_k__42 = fst::kNoStateId;
- /* "pywrapfst.pyx":3799
+ /* "pywrapfst.pyx":3831
*
* cpdef MutableFst prune(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
* weight=None):
*/
- __pyx_k__39 = fst::kDelta;
+ __pyx_k__41 = fst::kDelta;
- /* "pywrapfst.pyx":3800
+ /* "pywrapfst.pyx":3832
* cpdef MutableFst prune(Fst ifst,
* float delta=fst.kDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
* weight=None):
* """
*/
- __pyx_k__40 = fst::kNoStateId;
+ __pyx_k__42 = fst::kNoStateId;
- /* "pywrapfst.pyx":3830
+ /* "pywrapfst.pyx":3863
*
* cpdef MutableFst push(Fst ifst,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
* bool push_weights=False,
* bool push_labels=False,
*/
- __pyx_k__41 = fst::kDelta;
+ __pyx_k__43 = fst::kDelta;
- /* "pywrapfst.pyx":3829
+ /* "pywrapfst.pyx":3862
*
*
* cpdef MutableFst push(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kDelta,
* bool push_weights=False,
*/
- __pyx_k__41 = fst::kDelta;
+ __pyx_k__43 = fst::kDelta;
- /* "pywrapfst.pyx":3888
+ /* "pywrapfst.pyx":3921
* Fst ifst2,
* int32 npath=1,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
- * time_t seed=0,
- * select=b"uniform",
+ * select="uniform",
+ * int32 max_length=INT32_MAX,
*/
- __pyx_k__42 = fst::kDelta;
+ __pyx_k__44 = fst::kDelta;
- /* "pywrapfst.pyx":3891
- * time_t seed=0,
- * select=b"uniform",
- * int32 max_length=INT32_MAX) except *: # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3923
+ * float delta=fst.kDelta,
+ * select="uniform",
+ * int32 max_length=INT32_MAX, # <<<<<<<<<<<<<<
+ * uint64 seed=0) except *:
* """
- * randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, seed=0,
*/
- __pyx_k__43 = INT32_MAX;
+ __pyx_k__45 = INT32_MAX;
- /* "pywrapfst.pyx":3888
+ /* "pywrapfst.pyx":3921
* Fst ifst2,
* int32 npath=1,
* float delta=fst.kDelta, # <<<<<<<<<<<<<<
- * time_t seed=0,
- * select=b"uniform",
+ * select="uniform",
+ * int32 max_length=INT32_MAX,
*/
- __pyx_k__42 = fst::kDelta;
+ __pyx_k__44 = fst::kDelta;
- /* "pywrapfst.pyx":3891
- * time_t seed=0,
- * select=b"uniform",
- * int32 max_length=INT32_MAX) except *: # <<<<<<<<<<<<<<
+ /* "pywrapfst.pyx":3923
+ * float delta=fst.kDelta,
+ * select="uniform",
+ * int32 max_length=INT32_MAX, # <<<<<<<<<<<<<<
+ * uint64 seed=0) except *:
* """
- * randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, seed=0,
*/
- __pyx_k__43 = INT32_MAX;
+ __pyx_k__45 = INT32_MAX;
- /* "pywrapfst.pyx":3940
- * time_t seed=0,
- * select=b"uniform",
+ /* "pywrapfst.pyx":3973
+ * int32 npath=1,
+ * select="uniform",
* int32 max_length=INT32_MAX, # <<<<<<<<<<<<<<
* bool weighted=False,
- * bool remove_total_weight=False):
+ * bool remove_total_weight=False,
*/
- __pyx_k__44 = INT32_MAX;
+ __pyx_k__46 = INT32_MAX;
- /* "pywrapfst.pyx":3936
+ /* "pywrapfst.pyx":3970
*
*
* cpdef MutableFst randgen(Fst ifst, # <<<<<<<<<<<<<<
* int32 npath=1,
- * time_t seed=0,
+ * select="uniform",
*/
- __pyx_k__44 = INT32_MAX;
+ __pyx_k__46 = INT32_MAX;
- /* "pywrapfst.pyx":4076
- *
- * cdef vector[fst.WeightClass] *_shortestdistance(Fst ifst,
- * float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
- * int64 nstate=fst.kNoStateId,
- * queue_type=b"auto",
+ /* "pywrapfst.pyx":4112
+ * cdef void _shortestdistance(Fst ifst,
+ * vector[fst.WeightClass] *distance,
+ * float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
+ * int64 nstate=fst.kNoStateId,
+ * queue_type="auto",
*/
- __pyx_k__45 = fst::kShortestDelta;
+ __pyx_k__47 = fst::kShortestDelta;
- /* "pywrapfst.pyx":4077
- * cdef vector[fst.WeightClass] *_shortestdistance(Fst ifst,
- * float delta=fst.kShortestDelta,
- * int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * queue_type=b"auto",
- * bool reverse=False) except *:
+ /* "pywrapfst.pyx":4113
+ * vector[fst.WeightClass] *distance,
+ * float delta=fst.kShortestDelta,
+ * int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
+ * queue_type="auto",
+ * bool reverse=False) except *:
*/
- __pyx_k__46 = fst::kNoStateId;
+ __pyx_k__48 = fst::kNoStateId;
- /* "pywrapfst.pyx":4100
+ /* "pywrapfst.pyx":4131
*
* def shortestdistance(Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
* int64 nstate=fst.kNoStateId,
- * queue_type=b"auto",
+ * queue_type="auto",
*/
- __pyx_k__47 = fst::kShortestDelta;
+ __pyx_k__49 = fst::kShortestDelta;
- /* "pywrapfst.pyx":4101
+ /* "pywrapfst.pyx":4132
* def shortestdistance(Fst ifst,
* float delta=fst.kShortestDelta,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * queue_type=b"auto",
+ * queue_type="auto",
* bool reverse=False):
*/
- __pyx_k__48 = fst::kNoStateId;
+ __pyx_k__50 = fst::kNoStateId;
- /* "pywrapfst.pyx":4099
+ /* "pywrapfst.pyx":4130
*
*
* def shortestdistance(Fst ifst, # <<<<<<<<<<<<<<
* float delta=fst.kShortestDelta,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_55shortestdistance, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_1) < 0) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __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_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_2) < 0) __PYX_ERR(0, 4130, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "pywrapfst.pyx":4137
+ /* "pywrapfst.pyx":4168
*
* cpdef MutableFst shortestpath(Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_k__49 = fst::kShortestDelta;
+ __pyx_k__51 = fst::kShortestDelta;
- /* "pywrapfst.pyx":4139
+ /* "pywrapfst.pyx":4170
* float delta=fst.kShortestDelta,
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * queue_type=b"auto",
+ * queue_type="auto",
* bool unique=False,
*/
- __pyx_k__50 = fst::kNoStateId;
+ __pyx_k__52 = fst::kNoStateId;
- /* "pywrapfst.pyx":4137
+ /* "pywrapfst.pyx":4168
*
* cpdef MutableFst shortestpath(Fst ifst,
* float delta=fst.kShortestDelta, # <<<<<<<<<<<<<<
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId,
*/
- __pyx_k__49 = fst::kShortestDelta;
+ __pyx_k__51 = fst::kShortestDelta;
- /* "pywrapfst.pyx":4139
+ /* "pywrapfst.pyx":4170
* float delta=fst.kShortestDelta,
* int32 nshortest=1,
* int64 nstate=fst.kNoStateId, # <<<<<<<<<<<<<<
- * queue_type=b"auto",
+ * queue_type="auto",
* bool unique=False,
*/
- __pyx_k__50 = fst::kNoStateId;
+ __pyx_k__52 = fst::kNoStateId;
- /* "pywrapfst.pyx":4294
- *
- * def __cinit__(self,
- * string fst_type=b"vector", # <<<<<<<<<<<<<<
- * string arc_type=b"standard",
- * SymbolTable isymbols=None,
- */
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_vector); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4294, __pyx_L1_error)
- __pyx_k__51 = __pyx_t_5;
-
- /* "pywrapfst.pyx":4295
- * def __cinit__(self,
- * string fst_type=b"vector",
- * string arc_type=b"standard", # <<<<<<<<<<<<<<
- * SymbolTable isymbols=None,
- * SymbolTable osymbols=None,
- */
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_standard); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4295, __pyx_L1_error)
- __pyx_k__52 = __pyx_t_5;
-
- /* "pywrapfst.pyx":4403
+ /* "pywrapfst.pyx":4435
*
* @classmethod
* def open(cls, *sources): # <<<<<<<<<<<<<<
* """
* FarReader.open(*sources)
*/
- __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4403, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
+ __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_GOTREF(__pyx_t_2);
- /* "pywrapfst.pyx":4402
- * return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self))
+ /* "pywrapfst.pyx":4434
+ * return f"<{self.far_type()} FarReader at 0x{id(self):x}>"
*
* @classmethod # <<<<<<<<<<<<<<
* def open(cls, *sources):
* """
*/
- __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4402, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarReader->tp_dict, __pyx_n_s_open, __pyx_t_2) < 0) __PYX_ERR(0, 4403, __pyx_L1_error)
+ __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_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;
PyType_Modified(__pyx_ptype_9pywrapfst_FarReader);
- /* "pywrapfst.pyx":4553
+ /* "pywrapfst.pyx":4594
*
* @classmethod
- * def create(cls, source, arc_type=b"standard", far_type=b"default"): # <<<<<<<<<<<<<<
+ * def create(cls, source, arc_type="standard", far_type="default"): # <<<<<<<<<<<<<<
* """
* FarWriter.
*/
- __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4553, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
+ __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);
- /* "pywrapfst.pyx":4552
- * return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(self))
+ /* "pywrapfst.pyx":4593
+ * return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
*
* @classmethod # <<<<<<<<<<<<<<
- * def create(cls, source, arc_type=b"standard", far_type=b"default"):
+ * def create(cls, source, arc_type="standard", far_type="default"):
* """
*/
- __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4552, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarWriter->tp_dict, __pyx_n_s_create, __pyx_t_1) < 0) __PYX_ERR(0, 4553, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_Method_ClassMethod(__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;
+ 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_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_ptype_9pywrapfst_FarWriter);
- /* "pywrapfst.pyx":4644
+ /* "pywrapfst.pyx":4685
*
* # Masks fst_error_fatal in-module.
* fst.FLAGS_fst_error_fatal = False # <<<<<<<<<<<<<<
* # Licensed under the Apache License, Version 2.0 (the "License");
* # you may not use this file except in compliance with the License.
*/
- __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "vector.from_py":45
*
- * @cname("__pyx_convert_vector_from_py_int64")
- * cdef vector[X] __pyx_convert_vector_from_py_int64(object o) except *: # <<<<<<<<<<<<<<
+ * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
+ * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *: # <<<<<<<<<<<<<<
* cdef vector[X] v
* for item in o:
*/
return result;
}
+/* PyObjectFormatAndDecref */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
+ if (unlikely(!s)) return NULL;
+ if (likely(PyUnicode_CheckExact(s))) return s;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(s))) {
+ PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
+ Py_DECREF(s);
+ return result;
+ }
+ #endif
+ return __Pyx_PyObject_FormatAndDecref(s, f);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
+ PyObject *result = PyObject_Format(s, f);
+ Py_DECREF(s);
+ return result;
+}
+
+/* JoinPyUnicode */
+static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
+ CYTHON_UNUSED Py_UCS4 max_char) {
+#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ PyObject *result_uval;
+ int result_ukind;
+ Py_ssize_t i, char_pos;
+ void *result_udata;
+#if CYTHON_PEP393_ENABLED
+ result_uval = PyUnicode_New(result_ulength, max_char);
+ if (unlikely(!result_uval)) return NULL;
+ result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
+ result_udata = PyUnicode_DATA(result_uval);
+#else
+ result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
+ if (unlikely(!result_uval)) return NULL;
+ result_ukind = sizeof(Py_UNICODE);
+ result_udata = PyUnicode_AS_UNICODE(result_uval);
+#endif
+ char_pos = 0;
+ for (i=0; i < value_count; i++) {
+ int ukind;
+ Py_ssize_t ulength;
+ void *udata;
+ PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
+ if (unlikely(__Pyx_PyUnicode_READY(uval)))
+ goto bad;
+ ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
+ if (unlikely(!ulength))
+ continue;
+ if (unlikely(char_pos + ulength < 0))
+ goto overflow;
+ ukind = __Pyx_PyUnicode_KIND(uval);
+ udata = __Pyx_PyUnicode_DATA(uval);
+ if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
+ memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
+ } else {
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
+ _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
+ #else
+ Py_ssize_t j;
+ for (j=0; j < ulength; j++) {
+ Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
+ __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
+ }
+ #endif
+ }
+ char_pos += ulength;
+ }
+ return result_uval;
+overflow:
+ PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
+bad:
+ Py_DECREF(result_uval);
+ return NULL;
+#else
+ result_ulength++;
+ value_count++;
+ return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
+#endif
+}
+
/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
}
#endif
-/* PyObjectCall2Args */
-static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
- PyObject *args, *result = NULL;
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(function)) {
- PyObject *args[2] = {arg1, arg2};
- return __Pyx_PyFunction_FastCall(function, args, 2);
- }
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(function)) {
- PyObject *args[2] = {arg1, arg2};
- return __Pyx_PyCFunction_FastCall(function, args, 2);
- }
- #endif
- args = PyTuple_New(2);
- if (unlikely(!args)) goto done;
- Py_INCREF(arg1);
- PyTuple_SET_ITEM(args, 0, arg1);
- Py_INCREF(arg2);
- PyTuple_SET_ITEM(args, 1, arg2);
- Py_INCREF(function);
- result = __Pyx_PyObject_Call(function, args, NULL);
- Py_DECREF(args);
- Py_DECREF(function);
-done:
- return result;
-}
-
/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
}
#endif
-/* PyDictVersioning */
-#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
-static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
- PyObject *dict = Py_TYPE(obj)->tp_dict;
- return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
-}
-static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
- PyObject **dictptr = NULL;
- Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
- if (offset) {
-#if CYTHON_COMPILING_IN_CPYTHON
- dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
-#else
- dictptr = _PyObject_GetDictPtr(obj);
-#endif
- }
- return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
-}
-static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
- PyObject *dict = Py_TYPE(obj)->tp_dict;
- if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
- return 0;
- return obj_dict_version == __Pyx_get_object_dict_version(obj);
-}
-#endif
-
-/* GetModuleGlobalName */
-#if CYTHON_USE_DICT_VERSIONS
-static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
-#else
-static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
-#endif
-{
- PyObject *result;
-#if !CYTHON_AVOID_BORROWED_REFS
-#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
- result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
- __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
- if (likely(result)) {
- return __Pyx_NewRef(result);
- } else if (unlikely(PyErr_Occurred())) {
- return NULL;
- }
-#else
- result = PyDict_GetItem(__pyx_d, name);
- __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
- if (likely(result)) {
- return __Pyx_NewRef(result);
- }
-#endif
-#else
- result = PyObject_GetItem(__pyx_d, name);
- __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
- if (likely(result)) {
- return __Pyx_NewRef(result);
- }
- PyErr_Clear();
-#endif
- return __Pyx_GetBuiltinName(name);
-}
-
/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
}
#endif
+/* PyDictVersioning */
+#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
+ return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
+}
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
+ PyObject **dictptr = NULL;
+ Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
+ if (offset) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
+#else
+ dictptr = _PyObject_GetDictPtr(obj);
+#endif
+ }
+ return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
+}
+static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
+ if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
+ return 0;
+ return obj_dict_version == __Pyx_get_object_dict_version(obj);
+}
+#endif
+
+/* GetModuleGlobalName */
+#if CYTHON_USE_DICT_VERSIONS
+static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
+#else
+static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
+#endif
+{
+ PyObject *result;
+#if !CYTHON_AVOID_BORROWED_REFS
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
+ result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
+ if (likely(result)) {
+ return __Pyx_NewRef(result);
+ } else if (unlikely(PyErr_Occurred())) {
+ return NULL;
+ }
+#else
+ result = PyDict_GetItem(__pyx_d, name);
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
+ if (likely(result)) {
+ return __Pyx_NewRef(result);
+ }
+#endif
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
+ if (likely(result)) {
+ return __Pyx_NewRef(result);
+ }
+ PyErr_Clear();
+#endif
+ return __Pyx_GetBuiltinName(name);
+}
+
+/* PyObjectCall2Args */
+static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
+ PyObject *args, *result = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(function)) {
+ PyObject *args[2] = {arg1, arg2};
+ return __Pyx_PyFunction_FastCall(function, args, 2);
+ }
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(function)) {
+ PyObject *args[2] = {arg1, arg2};
+ return __Pyx_PyCFunction_FastCall(function, args, 2);
+ }
+ #endif
+ args = PyTuple_New(2);
+ if (unlikely(!args)) goto done;
+ Py_INCREF(arg1);
+ PyTuple_SET_ITEM(args, 0, arg1);
+ Py_INCREF(arg2);
+ PyTuple_SET_ITEM(args, 1, arg2);
+ Py_INCREF(function);
+ result = __Pyx_PyObject_Call(function, args, NULL);
+ Py_DECREF(args);
+ Py_DECREF(function);
+done:
+ return result;
+}
+
+/* PyObjectFormat */
+#if CYTHON_USE_UNICODE_WRITER
+static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
+ int ret;
+ _PyUnicodeWriter writer;
+ if (likely(PyFloat_CheckExact(obj))) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
+ _PyUnicodeWriter_Init(&writer, 0);
+#else
+ _PyUnicodeWriter_Init(&writer);
+#endif
+ ret = _PyFloat_FormatAdvancedWriter(
+ &writer,
+ obj,
+ format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
+ } else if (likely(PyLong_CheckExact(obj))) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
+ _PyUnicodeWriter_Init(&writer, 0);
+#else
+ _PyUnicodeWriter_Init(&writer);
+#endif
+ ret = _PyLong_FormatAdvancedWriter(
+ &writer,
+ obj,
+ format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
+ } else {
+ return PyObject_Format(obj, format_spec);
+ }
+ if (unlikely(ret == -1)) {
+ _PyUnicodeWriter_Dealloc(&writer);
+ return NULL;
+ }
+ return _PyUnicodeWriter_Finish(&writer);
+}
+#endif
+
/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
}
name = first_kw_arg;
#if PY_MAJOR_VERSION < 3
- if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ if (likely(PyString_Check(key))) {
while (*name) {
if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
&& _PyString_Eq(**name, key)) {
while (*name) {
int cmp = (**name == key) ? 0 :
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
#endif
PyUnicode_Compare(**name, key);
if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
while (argname != first_kw_arg) {
int cmp = (**argname == key) ? 0 :
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
#endif
PyUnicode_Compare(**argname, key);
if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
}
#endif
-/* FastTypeChecks */
-#if CYTHON_COMPILING_IN_CPYTHON
-static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
- while (a) {
- a = a->tp_base;
- if (a == b)
- return 1;
- }
- return b == &PyBaseObject_Type;
-}
-static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
- PyObject *mro;
- if (a == b) return 1;
- mro = a->tp_mro;
- if (likely(mro)) {
- Py_ssize_t i, n;
- n = PyTuple_GET_SIZE(mro);
- for (i = 0; i < n; i++) {
- if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
- return 1;
- }
- return 0;
- }
- return __Pyx_InBases(a, b);
-}
-#if PY_MAJOR_VERSION == 2
-static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
- PyObject *exception, *value, *tb;
- int res;
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ErrFetch(&exception, &value, &tb);
- res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
- if (unlikely(res == -1)) {
- PyErr_WriteUnraisable(err);
- res = 0;
- }
- if (!res) {
- res = PyObject_IsSubclass(err, exc_type2);
- if (unlikely(res == -1)) {
- PyErr_WriteUnraisable(err);
- res = 0;
- }
- }
- __Pyx_ErrRestore(exception, value, tb);
- return res;
-}
-#else
-static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
- int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
- if (!res) {
- res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
- }
- return res;
-}
-#endif
-static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+/* PyErrExceptionMatches */
+#if CYTHON_FAST_THREAD_STATE
+static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
Py_ssize_t i, n;
- assert(PyExceptionClass_Check(exc_type));
n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
for (i=0; i<n; i++) {
}
#endif
for (i=0; i<n; i++) {
- PyObject *t = PyTuple_GET_ITEM(tuple, i);
- #if PY_MAJOR_VERSION < 3
- if (likely(exc_type == t)) return 1;
- #endif
- if (likely(PyExceptionClass_Check(t))) {
- if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
- } else {
- }
+ if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
}
return 0;
}
-static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
- if (likely(err == exc_type)) return 1;
- if (likely(PyExceptionClass_Check(err))) {
- if (likely(PyExceptionClass_Check(exc_type))) {
- return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
- } else if (likely(PyTuple_Check(exc_type))) {
- return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
- } else {
- }
- }
- return PyErr_GivenExceptionMatches(err, exc_type);
-}
-static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
- assert(PyExceptionClass_Check(exc_type1));
- assert(PyExceptionClass_Check(exc_type2));
- if (likely(err == exc_type1 || err == exc_type2)) return 1;
- if (likely(PyExceptionClass_Check(err))) {
- return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
- }
- return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ if (unlikely(PyTuple_Check(err)))
+ return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
+ return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
-/* PyErrExceptionMatches */
-#if CYTHON_FAST_THREAD_STATE
-static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
- Py_ssize_t i, n;
- n = PyTuple_GET_SIZE(tuple);
-#if PY_MAJOR_VERSION >= 3
- for (i=0; i<n; i++) {
- if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
- }
-#endif
- for (i=0; i<n; i++) {
- if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
- }
- return 0;
-}
-static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
- PyObject *exc_type = tstate->curexc_type;
- if (exc_type == err) return 1;
- if (unlikely(!exc_type)) return 0;
- if (unlikely(PyTuple_Check(err)))
- return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
- return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
-}
-#endif
-
/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
return -1;
}
+/* PyObjectGetAttrStrNoError */
+static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
+ __Pyx_PyErr_Clear();
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
+ PyObject *result;
+#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
+ return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
+ }
+#endif
+ result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
+ if (unlikely(!result)) {
+ __Pyx_PyObject_GetAttrStr_ClearAttributeError();
+ }
+ return result;
+}
+
/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
int ret;
#endif
reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
- reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto __PYX_BAD;
- ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
- ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
+ if (likely(reduce_cython)) {
+ ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ } else if (reduce == object_reduce || PyErr_Occurred()) {
+ goto __PYX_BAD;
+ }
setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
if (!setstate) PyErr_Clear();
if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
- setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto __PYX_BAD;
- ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
- ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
+ if (likely(setstate_cython)) {
+ ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ } else if (!setstate || PyErr_Occurred()) {
+ goto __PYX_BAD;
+ }
}
PyType_Modified((PyTypeObject*)type_obj);
}
{
#if PY_MAJOR_VERSION >= 3
if (level == -1) {
- if (strchr(__Pyx_MODULE_NAME, '.')) {
+ if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
module = PyImport_ImportModuleLevelObject(
name, global_dict, empty_dict, list, 1);
if (!module) {
#if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY
if (PyMethodDescr_Check(method))
#else
+ #if PY_MAJOR_VERSION == 2
static PyTypeObject *methoddescr_type = NULL;
if (methoddescr_type == NULL) {
PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
methoddescr_type = Py_TYPE(meth);
Py_DECREF(meth);
}
+ #else
+ PyTypeObject *methoddescr_type = &PyMethodDescr_Type;
+ #endif
if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
{
else if (PyMethod_Check(method)) {
return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
}
- else if (PyCFunction_Check(method)) {
- return PyClassMethod_New(method);
- }
-#ifdef __Pyx_CyFunction_USED
- else if (__Pyx_CyFunction_Check(method)) {
+ else {
return PyClassMethod_New(method);
}
-#endif
- PyErr_SetString(PyExc_TypeError,
- "Class-level classmethod() can only be called on "
- "a method_descriptor or instance method.");
- return NULL;
}
/* GetNameInClass */
/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
-static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
+static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
PyObject *use_cline;
PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
int new_max = __pyx_code_cache.max_count + 64;
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
- __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
if (unlikely(!entries)) {
return;
}
}
/* CIntFromPy */
-static CYTHON_INLINE time_t __Pyx_PyInt_As_time_t(PyObject *x) {
- const time_t neg_one = (time_t) ((time_t) 0 - (time_t) 1), const_zero = (time_t) 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- if (sizeof(time_t) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(time_t, long, PyInt_AS_LONG(x))
- } else {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- goto raise_neg_overflow;
- }
- return (time_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 (time_t) 0;
- case 1: __PYX_VERIFY_RETURN_INT(time_t, digit, digits[0])
- case 2:
- if (8 * sizeof(time_t) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(time_t) >= 2 * PyLong_SHIFT) {
- return (time_t) (((((time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0]));
- }
- }
- break;
- case 3:
- if (8 * sizeof(time_t) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(time_t) >= 3 * PyLong_SHIFT) {
- return (time_t) (((((((time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0]));
- }
- }
- break;
- case 4:
- if (8 * sizeof(time_t) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(time_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(time_t) >= 4 * PyLong_SHIFT) {
- return (time_t) (((((((((time_t)digits[3]) << PyLong_SHIFT) | (time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_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 (time_t) -1;
- if (unlikely(result == 1))
- goto raise_neg_overflow;
- }
-#endif
- if (sizeof(time_t) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT_EXC(time_t, unsigned long, PyLong_AsUnsignedLong(x))
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(time_t) <= sizeof(unsigned PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(time_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 (time_t) 0;
- case -1: __PYX_VERIFY_RETURN_INT(time_t, sdigit, (sdigit) (-(sdigit)digits[0]))
- case 1: __PYX_VERIFY_RETURN_INT(time_t, digit, +digits[0])
- case -2:
- if (8 * sizeof(time_t) - 1 > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(time_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(time_t) - 1 > 2 * PyLong_SHIFT) {
- return (time_t) (((time_t)-1)*(((((time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])));
- }
- }
- break;
- case 2:
- if (8 * sizeof(time_t) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(time_t) - 1 > 2 * PyLong_SHIFT) {
- return (time_t) ((((((time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])));
- }
- }
- break;
- case -3:
- if (8 * sizeof(time_t) - 1 > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(time_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(time_t) - 1 > 3 * PyLong_SHIFT) {
- return (time_t) (((time_t)-1)*(((((((time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])));
- }
- }
- break;
- case 3:
- if (8 * sizeof(time_t) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(time_t) - 1 > 3 * PyLong_SHIFT) {
- return (time_t) ((((((((time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])));
- }
- }
- break;
- case -4:
- if (8 * sizeof(time_t) - 1 > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(time_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(time_t) - 1 > 4 * PyLong_SHIFT) {
- return (time_t) (((time_t)-1)*(((((((((time_t)digits[3]) << PyLong_SHIFT) | (time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])));
- }
- }
- break;
- case 4:
- if (8 * sizeof(time_t) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(time_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(time_t) - 1 > 4 * PyLong_SHIFT) {
- return (time_t) ((((((((((time_t)digits[3]) << PyLong_SHIFT) | (time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])));
- }
- }
- break;
- }
-#endif
- if (sizeof(time_t) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT_EXC(time_t, long, PyLong_AsLong(x))
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(time_t) <= sizeof(PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(time_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
- time_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 (time_t) -1;
- }
- } else {
- time_t val;
- PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
- if (!tmp) return (time_t) -1;
- val = __Pyx_PyInt_As_time_t(tmp);
- Py_DECREF(tmp);
- return val;
- }
-raise_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to time_t");
- return (time_t) -1;
-raise_neg_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to time_t");
- return (time_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;
return (int) -1;
}
+/* FastTypeChecks */
+#if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+ while (a) {
+ a = a->tp_base;
+ if (a == b)
+ return 1;
+ }
+ return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+ PyObject *mro;
+ if (a == b) return 1;
+ mro = a->tp_mro;
+ if (likely(mro)) {
+ Py_ssize_t i, n;
+ n = PyTuple_GET_SIZE(mro);
+ for (i = 0; i < n; i++) {
+ if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+ return 1;
+ }
+ return 0;
+ }
+ return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+ PyObject *exception, *value, *tb;
+ int res;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&exception, &value, &tb);
+ res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ if (!res) {
+ res = PyObject_IsSubclass(err, exc_type2);
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ }
+ __Pyx_ErrRestore(exception, value, tb);
+ return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+ int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+ if (!res) {
+ res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+ }
+ return res;
+}
+#endif
+static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+ Py_ssize_t i, n;
+ assert(PyExceptionClass_Check(exc_type));
+ n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+ for (i=0; i<n; i++) {
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+ }
+#endif
+ for (i=0; i<n; i++) {
+ PyObject *t = PyTuple_GET_ITEM(tuple, i);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(exc_type == t)) return 1;
+ #endif
+ if (likely(PyExceptionClass_Check(t))) {
+ if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
+ } else {
+ }
+ }
+ return 0;
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+ if (likely(err == exc_type)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ if (likely(PyExceptionClass_Check(exc_type))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+ } else if (likely(PyTuple_Check(exc_type))) {
+ return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
+ } else {
+ }
+ }
+ return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+ assert(PyExceptionClass_Check(exc_type1));
+ assert(PyExceptionClass_Check(exc_type2));
+ if (likely(err == exc_type1 || err == exc_type2)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+ }
+ return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
PyObject* fake_module;